/*[[ Name := % Play v0.5 Author := tageiger (fxid10t) Copyright © 2004, MetaQuotes Software Corp. Link := http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_In Notes := Lots := 1.00 Stop Loss := 50 Take Profit := 500 Trailing Stop := 15 ]]*/ //Defines & Variables Defines: Slippage(2), Entry_Retrace_%(23.6), Stop_Loss_%(38.2), Periods(1440); Vars: Lt(0), //Trade Lot Size P(0), //Bar Periods LH(0), //Last High Bar Number LL(0), //Last Low Bar Number R(0), //23.6% of range from Hi to Lo R1(0), //Entry_Retrace_% multiplier H1(0), //Last High L1(0), //Last Low S(0), //High less R B(0), //Low plus R S1(0), //Short Stop Order Price B1(0), //Long Stop Order Price S2(0), //Short Limit Order Price B2(0), //Long Limit Order Price SL(0), //StopLoss pips SL1(0), //Stop_Loss_% multiplier BSL(0), //Long StopLoss SSL(0), //Short StopLoss TP(0), //Target Price (arbitrarily calculated) msg(0), //Message Counter cnt(0); //Open Trade Counter Variable, For Trade Management //Defines to Variable assignment R1=(Entry_Retrace_%/100); SL1=(Stop_Loss_%/100); P=Periods; //Validation If Bars
1 then msg=1; If Period>1 then Alert("WARNING! PLEASE READ. This expert was developed using the 1 minute GDP chart. Backtest and adjust 'User defined variables.'"); exit; }; //Trade lot size calculation based on account equity If Equity>10000 then Lt=Floor(Equity/10000) else Lt=Ceil(Equity*10/10000)/10; If Lt>25 then Lt=25; //Entry criteria value calculations LH=Highest(High,P,P); LL=Lowest(Low,P,P); H1=H[LH]; L1=L[LL]; R=((H1-L1)*R1); SL=((H1-L1)*SL1); If Period<=5 & SL>(50*point) then SL=(50*Point); TP=(5*Point+iATR(10,1)*5.5)*10; S=H1-R; B=L1+R; Comment("Period Hi/Lo: ",H1," ",L1," Period Range=",(H1-L1)); Print("S=",S," ",ask," B=",B); If Totaltrades<1 then { If Bid