//////////////////////////////////////////////////////////////////////////////////////////////////// ////back_BOT.mq4////v1.0////06-2010////cu6yu4////cu6yu4@gmail.com/////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// #property show_inputs //---- parameters extern int BackPips=50; extern datetime EndDate = D'2010.06.01 00:00'; extern datetime InsertionDate = D'2008.06.01 00:00'; //////////////////////////////////////////////////////////////////////////////////////////////////// int init() { //// return(0); } //////////////////////////////////////////////////////////////////////////////////////////////////// int deinit() { //// return(0); } //////////////////////////////////////////////////////////////////////////////////////////////////// int start() { //---- variables double Converter,TrendWing,OldTrendWing,RealBackPips,WeekRemainder; int PairDigits,TrendSense,Sense,ExtCountedBars,I,PresentInstant,FutureInstant,Handle; datetime TrendWingTime; string XRange; //---- write variables string FileName,IniText,EndText,InsertionDay,EndDay; //---- normal or jpy PairDigits=Digits; if (PairDigits==4||PairDigits==5) { Converter=0.0001; } if (PairDigits==2||PairDigits==3) { Converter=0.01; } RealBackPips=BackPips*Converter; //---- shift ExtCountedBars=IndicatorCounted(); if (ExtCountedBars>0) { ExtCountedBars--; } I=Bars-ExtCountedBars-1; //---- first TrendWing=High[I]; Sense=1; //---- file //---- string times IniText=TimeToStr(InsertionDate,TIME_DATE); InsertionDay=StringConcatenate(StringSubstr(IniText,0,4),StringSubstr(IniText,5,2),StringSubstr(IniText,8,2)); EndText=TimeToStr(EndDate,TIME_DATE); EndDay=StringConcatenate(StringSubstr(EndText,0,4),StringSubstr(EndText,5,2),StringSubstr(EndText,8,2)); FileName=StringConcatenate(Symbol(),"______",InsertionDay,"__",EndDay,"______",BackPips,".html"); Handle=FileOpen("/back_BOT/"+FileName,FILE_CSV|FILE_READ|FILE_WRITE,' '); FileWrite(Handle," ",FileName,"

 

 

",""); //---- cycle while(I>=0) { if (Sense==1) { if (MathAbs(Low[I]-TrendWing)>=RealBackPips) { //---- XRange if (High[I]>TrendWing) { TrendWing=High[I]; TrendWingTime=Time[I]; } XRange=DoubleToStr(MathAbs(TrendWing-OldTrendWing)/Converter,1); //---- write FileWrite(Handle,""); //--- legacy OldTrendWing=TrendWing; //---- flip TrendWing=Low[I]; TrendWingTime=Time[I]; Sense=-1; //// } else if (High[I]>TrendWing) { TrendWing=High[I]; TrendWingTime=Time[I]; } //// } else if (Sense==-1) { if (MathAbs(High[I]-TrendWing)>=RealBackPips) { //---- XRange if (Low[I] "); //--- legacy OldTrendWing=TrendWing; //---- flip TrendWing=High[I]; TrendWingTime=Time[I]; Sense=1; //// } else if (Low[I]

 

 

"); FileClose(Handle); //// return(0); } //////////////////////////////////////////////////////////////////////////////////////////////////// ////back_BOT.mq4////v1.0////06-2010////cu6yu4////cu6yu4@gmail.com/////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
Time Price Sense Range
",TimeToStr(TrendWingTime,TIME_DATE|TIME_MINUTES)," ",TrendWing," ","+++"," ",XRange,"
",TimeToStr(TrendWingTime,TIME_DATE|TIME_MINUTES)," ",TrendWing," ","---"," ",XRange,"