MA_PriceCcrossHiLo

Author:
MA_PriceCcrossHiLo
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
MA_PriceCcrossHiLo
//+------------------------------------------------------------------+
//|                                                            MA_xP |
//+------------------------------------------------------------------+
//2008fxtsd  ki  
#property copyright ""
#property link      ""

#property indicator_chart_window
#property indicator_buffers 3

#property indicator_color1 Gold
#property indicator_color2 Red
#property indicator_color3 Blue

#property indicator_width2 2
#property indicator_width3 2


extern int ma_period  =9;
extern int ma_method =1;
extern int ma_price  =0;

double Buffer1[];
double Buffer2[];
double Buffer3[];



//+---

int init()
  {

  SetIndexBuffer(0,Buffer1);  SetIndexStyle(0,DRAW_LINE);
  SetIndexBuffer(1,Buffer2);  SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,158); SetIndexEmptyValue (1,EMPTY_VALUE);
  SetIndexBuffer(2,Buffer3);  SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,158); SetIndexEmptyValue (2,EMPTY_VALUE);


   return(0);
  }

//+----
int deinit()
{
   return(0);
}


int start()
{
   int i,limit;
   int counted_bars=IndicatorCounted();

   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;

   limit = Bars-counted_bars;

   for(i=limit; i>=0; i--)
   {

   double MA=iMA(NULL,0,ma_period,0,ma_method,ma_price,i) ;


   Buffer1[i] = MA;   
   Buffer2[i] = EMPTY_VALUE; 
   Buffer3[i] = EMPTY_VALUE;
      
      
   if (High[i]<MA) Buffer2[i]= MA;   
   if (Low [i]>MA) Buffer3[i]= MA;

   }
 
  
   return(0);
}
//+---------------

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---