Вы находитесь на странице: 1из 3

BATTLEPLANN .

mq4 |

//+——————————————————————+

//| Battleplan.mq4 |

//| Copyright © 2010, MetaQuotes Software Corp. |

//| http://www.metaquotes.net |

//+——————————————————————+

//+——————————————————————+

#property indicator_chart_window

#property indicator_buffers 1

#property indicator_color1 Lime

extern int year=2010;

extern int month=6;

extern int day=1;

extern int hour=0;

extern int minute=0;

extern double inf=1.28000;

extern double sup=1.32000;

extern double cyclelength=60;

extern double trend=0;

//—- buffers

double Hurst[];

//+——————————————————————+

//| Custom indicator initialization function |

//+——————————————————————+

int init()

//—- indicators

IndicatorBuffers(1);

SetIndexBuffer(0,Hurst);

SetIndexStyle(0,DRAW_LINE,0,2);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));

IndicatorShortName(WindowExpertName());

return(0);

//+——————————————————————+

//| Custom indicator deinitialization function |

//+——————————————————————+

int deinit()

//—-

//—-

return(0);

//+——————————————————————+

//| Custom indicator iteration function |

//+——————————————————————+

int start()

double a,ma,w1,w2,w3,w4,cycle,x,grc,c,b,pi;

int i,limit,phase;

int flag;

int counted_bars = IndicatorCounted();

if(counted_bars =0; i–) {

if (day==TimeDay(Time[i]) && month==TimeMonth(Time[i]) && year==TimeYear(Time[i]) &&

hour==TimeHour(Time[i]) && minute==TimeMinute(Time[i])){

flag=1;

if( flag==0) {

Hurst[i]=EMPTY_VALUE;

}
else

a=a+1;

x=(360/cyclelength)*a;

phase=-90;

pi=3.1415926535;

w1=MathSin(((8*x+phase)*pi)/180);

w2=2*MathSin(((4*x+phase)*pi)/180);

w3=3*MathSin(((2*x+phase)*pi)/180);

w4=4*MathSin(((x+phase)*pi)/180);

cycle=(w1+w2+w3+w4);

grc=0.01029;

c=(grc*trend*1);

b=b+c;

Hurst[i]=(cycle+b+10)*((sup-inf)/15)+inf;

return(0);

//+—————————–+

--+

Вам также может понравиться