Indicators Used
0
Views
0
Downloads
0
Favorites
ma_2c
//+------------------------------------------------------------------+
//| |
//| |
//+------------------------------------------------------------------+
//2009fxtsd
#property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 Red
extern int period = 11;
extern int method = 1;
extern int price = 0;
double buffer1[];
double buffer2[];
double buffer3[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,buffer1);
SetIndexBuffer(1,buffer2);
SetIndexBuffer(2,buffer3);
// IndicatorShortName("cci triple " +period);
SetIndexLabel(0,"ma2c " +period);
return(0);
}
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int limit,i;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i=limit; i>=0; i--)
{
buffer1[i] = iMA(NULL, 0, period, 0,method , price, i);
buffer2[i]=EMPTY_VALUE; buffer3[i]=EMPTY_VALUE;
if (buffer1[i]<buffer1[i+1])
{
if(buffer2[i+2]==EMPTY_VALUE)
{
buffer2[i]=buffer1[i]; buffer2[i+1]=buffer1[i+1];
}
else
{
buffer3[i]=buffer1[i]; buffer3[i+1]=buffer1[i+1];
}
}
}
return(0);
}
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---