//+------------------------------------------------------------------+ //| ZZ_MTF_XO_2.mq4 | //| | //+------------------------------------------------------------------+ #property copyright "AHGDP" #property link " ZZ_MTF_XO_2 " #property indicator_separate_window #property indicator_buffers 4 #property indicator_color1 Teal #property indicator_color2 Orange #property indicator_color3 Lime #property indicator_color4 Red #property indicator_width1 3 #property indicator_width2 3 #property indicator_width3 3 #property indicator_width4 3 #property indicator_maximum 2.5 #property indicator_minimum -2.5 extern double KirPER1=4.5; extern double KirPER2=6.5; extern int TF1= 240 ; extern int LineSize1=3; extern int CountBars=5000; double xoup1 , xodn1 ; double xoup2 , xodn2 ; double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,LineSize1); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,LineSize1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_HISTOGRAM,EMPTY,LineSize1); SetIndexBuffer(2,ExtMapBuffer3); SetIndexStyle(3,DRAW_HISTOGRAM,EMPTY,LineSize1); SetIndexBuffer(3,ExtMapBuffer4); string ThisName = "ZZ_MTF_XO_2"; string Text=ThisName; Text=Text+" ("+TF1; Text=Text+")"; Text=Text+"("; Text=Text+" "+DoubleToStr(KirPER1,1); Text=Text+", "+DoubleToStr(KirPER2,1); Text=Text+") "; IndicatorShortName(Text); } //---- return(0); //+------------------------------------------------------------------+ //| MTF Parabolic Sar | //+------------------------------------------------------------------+ int start() { int i,limit,y=0,counted_bars=IndicatorCounted(); limit=Bars-counted_bars; limit=Bars-counted_bars; limit=Bars-counted_bars; limit=Bars-counted_bars; if(counted_bars>0) limit++; else if (limit>100) limit=CountBars; SetIndexDrawBegin(0,Bars-CountBars); SetIndexDrawBegin(1,Bars-CountBars); SetIndexDrawBegin(2,Bars-CountBars); SetIndexDrawBegin(3,Bars-CountBars); int lastp15=0, lastp30=0, lastp60=0; for(i=0,y=0;i<limit;i++) { int p1; p1 = iBarShift( NULL, TF1, Time[i], false ); //======================================================================================== double xo1a = iCustom(NULL,TF1,"XO",KirPER1,0,p1); double xo1b = iCustom(NULL,TF1,"XO",KirPER1,1,p1); if ((xo1a > 0)){ xoup1 = 1; xodn1 = 0; } if ((xo1b < 0)){ xoup1 = 0; xodn1 = 1; } double xo2a = iCustom(NULL,TF1,"XO",KirPER2,0,p1); double xo2b = iCustom(NULL,TF1,"XO",KirPER2,1,p1); if ((xo2a > 0)){ xoup2 = 1; xodn2 = 0; } if ((xo2b < 0)){ xoup2 = 0; xodn2 = 1; } //======================================================================================== double TF1Up = 0.0; double TF1Down = 0.0; double TF2Up = 0.0; double TF2Down = 0.0; if ( (xoup1 + xoup2 ) == 2 ) TF1Up = 2 ; if ( (xodn1 + xodn2 ) == 2 ) TF1Down = - 2 ; if ( TF1Up == 2 || TF1Down == - 2 ) { ExtMapBuffer3[i] = TF1Up; ExtMapBuffer4[i] = TF1Down; } //========================================================================================= if ( ( xoup2) == 1 ) TF2Up = 1 ; if ( ( xodn2) == 1 ) TF2Down = - 1 ; if ( TF2Up == 1 || TF2Down == - 1 ) { ExtMapBuffer1[i] = TF2Up; ExtMapBuffer2[i] = TF2Down; } //================================================================== } return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains open time of each bar
Indicator Curves created:
Implements a curve of type DRAW_HISTOGRAM
Indicators Used:
Custom Indicators Used:
XO
Order Management characteristics:
Other Features: