//+------------------------------------------------------------------+ //| iFxOverEasy.mq4 | //| Copyright © 2005, Shahin Monsef | //| shahinmonsef@hotmail.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, Shahin Monsef/Shimodax" #property link "shahinonsef@hotmail.com" /* History: Version 1.0 - intial expert coded by Shahin Monsef Version 1.1 / Aug 27, 2005: mods by Shimodax - option for min channel width - now checks laguerre for level crossing - option to use or ignore asctrend from decision - added trail stop trigger (profit from which trailstop gets activated) Version 1.2 / Aug 28, 2005: mods by Shimodax - handle laguerre signal correctly (stays valid for x (Input) minutes) - don't reenter trades on the same bar */ #define LONGCOLOR DodgerBlue #define SHORTCOLOR OrangeRed extern bool UseAscTrend= 0; extern int StopLoss=15, TrailingStopTrigger= 15, TrailingStop= 10, MinChannelWidth= 40, TakeProfit= 150, PauseToReEntryMinutes= 15, LaguerreValidityMinutes= 45; extern bool DebugTrace= 1; int LastSignalTime, LaguerreSignal, LaguerreSignaltime; int init(){return(0);} int deinit(){return(0);} int start() { double UL,DL; int res= 0; if(Bars<20) return(0); int currenttrades=0; for( int x=0;xTL2){ UL=TL1; DL=TL2; }else{ UL=TL2; DL=TL1; } double i_Trend1 =iCustom(NULL,0,"i_Trend" ,0,0); double i_Trend2 =iCustom(NULL,0,"i_Trend" ,1,0); double Juice1 =iCustom(NULL,0,"Juice" ,0,0); double PAsctrnd1= 0, PAsctrnd2= 0; if (UseAscTrend) { PAsctrnd1= iCustom(NULL,0,"PerkyAsctrend1",0,0); PAsctrnd2= iCustom(NULL,0,"PerkyAsctrend1",1,0); } else { PAsctrnd1= 1; // not taken into account (make it irrelevant, i.e. set always true) PAsctrnd2= 1; } // must be checked after AscTrend(!) double Laguerre1= iCustom(NULL,0,"Laguerre",0,0); double Laguerre2= iCustom(NULL,0,"Laguerre",0,1); if (Laguerre2<0.15 && Laguerre1>=0.15) { LaguerreSignal= 1; // LONG LaguerreSignaltime= Time[0]; } else if (Laguerre2>0.75 && Laguerre1<=0.75) { LaguerreSignal= -1; // SHORT LaguerreSignaltime= Time[0]; } if (LaguerreSignal!=0 && (Time[0]-LaguerreSignaltime)>LaguerreValidityMinutes*60) { LaguerreSignal= 0; // expire laguerre crossing signal after n mintues } res= 0; if(Juice1>0.0 && UL-DL>MinChannelWidth*Point && (Time[0]-LastSignalTime)>PauseToReEntryMinutes*60) { if(MIDL2>MIDL1 && Ask