Indicators Used
0
Views
0
Downloads
0
Favorites
ma_MA_Slope_SigMA_roc
//+------------------------------------------------------------------+
//| ma_MA_Slope_smz_roc.mq4 |
//| |
//+------------------------------------------------------------------+
// ma roc sig ma
#property copyright ""
#property link ""
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 DodgerBlue //
// #property indicator_width1 2
#property indicator_width2 2
extern int MA_Period = 21;
extern int MA_Mode = 1;
extern int MA_Price = 0;
extern int roc_length = 1;
extern int SigMA_Period = 11;
extern int SigMA_Mode = 1;
double buffer1[];
double buffer11[];
double buffer12[];
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(3);
SetIndexBuffer(2,buffer1);
SetIndexBuffer(0,buffer11);
SetIndexBuffer(1,buffer12);
SetIndexLabel(0,"MA1 "+MA_Period+" roc");
SetIndexLabel(1,"MA1rocSigMA "+SigMA_Period+"");
IndicatorShortName("MA roc ("+MA_Period+") SigMA ("+SigMA_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;
//limit=MathMax(limit,SigMA_Period);
for(i=limit; i>=0; i--)
buffer1[i] =iMA(NULL,0,MA_Period,0,MA_Mode,MA_Price,i);
for(i=limit; i>=0; i--)
{
if (buffer1[i]!=0)
buffer11[i] = (buffer1[i]-buffer1[i+roc_length])/(buffer1[i]);
}
for(i=limit; i>=0; i--)
buffer12[i] = iMAOnArray(buffer11,0,SigMA_Period,0,SigMA_Mode,i);
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
---