0
Views
0
Downloads
0
Favorites
dpo_mtf
//+------------------------------------------------------------------+
//| dpo_mtf.mq4 |
//| |
//+------------------------------------------------------------------+
//2009fxtsd
#property copyright ""
#property link ""
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
extern int DPOperiod = 7;
extern int DPOprice = 0;
extern int DPOMAmethod = 0;
extern int primeSmzPeriod = 1;
extern int primeSmzMAmethod = 1;
extern int TimeFrame=0;
extern string MA_Method_Price = "SMA0 EMA1 SMMA2 LWMA3||0O,1C 2H3L,4Md 5Tp 6WghC: Md(HL/2)4,Tp(HLC/3)5,Wgh(HLCC/4)6";
extern string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF";
double buffer1[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,buffer1);
if (primeSmzPeriod>1) string name =" smz ("+primeSmzPeriod+","+primeSmzMAmethod+") ";
else name=" ";
TimeFrame = MathMax(TimeFrame,Period());
IndicatorShortName("DPO "+DPOperiod+name+" M"+TimeFrame);
SetIndexLabel(0,"DPO");
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;
if(TimeFrame!=Period())
limit = MathMax(limit,TimeFrame/Period());
for(i=limit; i>=0; i--)
{
if (primeSmzPeriod<1)primeSmzPeriod =1;
int y = iBarShift(NULL,TimeFrame,Time[i]);
buffer1[i] = iMA(NULL, TimeFrame, primeSmzPeriod, 0, primeSmzMAmethod, DPOprice, y)-
iMA(NULL, TimeFrame, DPOperiod, 0, DPOMAmethod, DPOprice, y);
}
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
---