//+------------------------------------------------------------------+ //| MTF_Cycle_KROUFR_version.mq4 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2008 | Grayman77, zIG, akadex" #property link "ForexResearch" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Red #property indicator_color2 White #property indicator_color3 Aqua #property indicator_level1 80 #property indicator_level2 20 #property indicator_level3 50 #property indicator_levelcolor SlateGray extern int Period2=240; extern int Period3=1440; extern int FastMA=12; extern int SlowMA=24; extern int Crosses=50; extern bool Comments=false; int Period1=0; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,ExtMapBuffer3); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //ObjectsDeleteAll(); Comment(""); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int i,limit,tm; int p1,p2; double vtmp1,vtmp2; double pr1,pr2; //---- ïðîâåðêà íà âîçìîæíûå îøèáêè if(counted_bars<0) return(-1); //---- ïîñëåäíèé ïîñ÷èòàííûé áàð áóäåò ïåðåñ÷èòàí if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; if(limit>Bars-2) limit=Bars-2; //---- p1=0; p2=0; pr1=0; pr2=0; //for(i=Bars-2;i>0;i--) for(i=limit;i>0;i--) { datetime _TimeBar=Time[i]; // ñìåùåíèå òåêóùåé ñâå÷è ÒÔ íà 2 ñòàðøå int Shift=iBarShift(Symbol(),Period1,_TimeBar,false); int Shift2=iBarShift(Symbol(),Period2,_TimeBar,false)+1; int Shift3=iBarShift(Symbol(),Period3,_TimeBar,false)+1; double v1=iCustom(Symbol(),Period1,"Cycle_KROUFR_version_",FastMA,SlowMA,Crosses,Comments,0,Shift); double v2=iCustom(Symbol(),Period2,"Cycle_KROUFR_version_",FastMA,SlowMA,Crosses,Comments,0,Shift2); double v3=iCustom(Symbol(),Period3,"Cycle_KROUFR_version_",FastMA,SlowMA,Crosses,Comments,0,Shift3); ExtMapBuffer1[i]=v1; ExtMapBuffer2[i]=v2; ExtMapBuffer3[i]=v3; } //---- 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_LINE
Indicators Used:
Custom Indicators Used:
Cycle_KROUFR_version_
Order Management characteristics:
Other Features: