//+------------------------------------------------------------------+ //| V.mq4 | //| Victor Nicolaev | //| vinin@mail.ru | //+------------------------------------------------------------------+ #property copyright "Victor Nicolaev" #property link "vinin@mail.ru" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Yellow extern int MAPeriod=13; extern int mode=0; double MA[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexDrawBegin(0,2*MAPeriod); SetIndexBuffer(0,MA); IndicatorShortName("V"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i,j, counted_bars=IndicatorCounted(), limit=Bars-counted_bars-1; double Value[5]; for (i=limit;i>=0;i--) { for (j=0;j<5;j++) Value[j]=iMA(NULL,0,MAPeriod,0,MODE_EMA,PRICE_CLOSE,i+j); if (mode==0) MA[i]=Value[0]+(((Value[0]-Value[1])+(Value[0]-Value[2])/2.0+(Value[0]-Value[3])/3.0+(Value[0]-Value[4])/4.0)/4.0); if (mode==1) MA[i]=Value[0]+(2.0*Value[0]-Value[3]-Value[4])/4; } return(0); }
Sample
Analysis
Market Information Used:
Indicator Curves created:
Implements a curve of type DRAW_LINE
Indicators Used:
Moving average indicator
Custom Indicators Used:
Order Management characteristics:
Other Features: