/*[[ Name := FX10 Author := Barcode Link := Notes := Enable Alerts := Yes Lots := 1.00 Stop Loss := 25 Take Profit := 100 Trailing Stop := 50 ]]*/ Defines : slippage(5),WMAPeriod(5),SMAPeriod(10); Defines : RSIPeriod(14),StochPeriod(5),StochperiodMid(3),StochperiodEnd(3),MACDPeriod(12),NumOfTrades(1); Defines : StartHour1(9),EndHour1(12),StartHour2(15),EndHour2(20),StochLow(30),StochHigh(70); Variable : newbar(0),RSIup(false),RSIdn(false),StochUp(false),StochDn(false); variable : PriceOpen(0),MacdCurrent(0),MacdPrevious(0),SignalCurrent(0),WMA(0),SMA(0); variable : Handle1(0), first(true),MACDup(false),MACDdn(false); variable : i(0),b4plusdi(0),nowplusdi(0),b4minusdi(0),nowminusdi(0),diff(0); variable : StoMain0(0),StoMain1(0),StoSig0(0),DeMark1(0),DeMark2(0),DeMarkup(false),DeMarkdn(false); If TotalTrades < NumOfTrades and newbar != t[0] Then { newbar = t[0]; If hour < StartHour1 or hour > EndHour2 Then Exit; If hour > EndHour1 and hour < StartHour2 Then Exit; RSIup = iRSI(RSIPeriod,1) > iRSI(RSIPeriod,2) and iRSI(RSIPeriod,1) > 50; RSIdn = iRSI(RSIPeriod,2) > iRSI(RSIPeriod,1) and iRSI(RSIPeriod,1) < 50; StochUp = iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_MAIN,1) > iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_SIGNAL,1) and iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_MAIN,1) > iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_MAIN,2) and iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_MAIN,1) >= StochHigh; StochDn = iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_MAIN,1) < iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_SIGNAL,1) and iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_MAIN,1) < iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_MAIN,2) and iSTO(Stochperiod,StochperiodMid,StochperiodEnd,MODE_SMA,MODE_MAIN,1) <= StochLow; MacdCurrent =iMACD(MACDPeriod,26,9,MODE_MAIN,1); MacdPrevious =iMACD(MACDPeriod,26,9,MODE_MAIN,2); SignalCurrent =iMACD(MACDPeriod,26,9,MODE_SIGNAL,1); MACDup = MacdCurrent > MacdPrevious and MacdCurrent > SignalCurrent and MacdCurrent > 50; MACDdn = MacdCurrent < MacdPrevious and MacdCurrent < SignalCurrent and MacdCurrent < 50; WMA = iMA(WMAPeriod,MODE_LWMA,1); SMA = iMA(SMAPeriod,MODE_SMA,1); if WMA > SMA and StochUp and RSIup and MACDup Then { SetOrder(OP_BUY, Lots, Ask, Slippage, ask-StopLoss*Point, Ask+TakeProfit*Point , BLUE); Exit; }; if WMA < SMA and StochDn and RSIdn and MACDdn Then { SetOrder(OP_SELL, Lots, Bid, Slippage, Bid+StopLoss*Point, Bid-TakeProfit*Point , BLUE); Exit; }; }; For i=1 to TotalTrades { If Ord(i,VAL_TYPE)=OP_BUY then { If Mod((PriceBid*1000),20) == 0 then { Closeorder(i,Lots,PriceBid,Slippage,red); }; }; If Ord(i,VAL_TYPE)=OP_SELL then { If Mod((PriceAsk*1000),20) == 0 then { Closeorder(i,Lots,PriceAsk,Slippage,red); }; }; }; //