if( TotalOrdersCount()==0 ) { int result=0; static datetime time0; if(time0!=Time[0]&&(iRSI(NULL,0,14,PRICE_CLOSE,2)<70)&&(iRSI(NULL,0,14,PRICE_CLOSE,1)>70)) // Here is your open buy rule { result=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"EA Generator www.ForexEAdvisor.com",MagicNumber,0,Blue); if(result>0) { time0=Time[0]; TheStopLoss=0; TheTakeProfit=0; if(TakeProfit>0) TheTakeProfit=Ask+TakeProfit*MyPoint; if(StopLoss>0) TheStopLoss=Ask-StopLoss*MyPoint; OrderSelect(result,SELECT_BY_TICKET); OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(TheStopLoss,Digits),NormalizeDouble(TheTakeProfit,Digits),0,Green); } if(time0!=Time[0]&&(iRSI(NULL,0,14,PRICE_CLOSE,2)>30)&&(iRSI(NULL,0,14,PRICE_CLOSE,1)<30)) // Here is your open Sell rule { result=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,"EA Generator www.ForexEAdvisor.com",MagicNumber,0,Red); if(result>0) { time0=Time[0];
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Can anyone help me please. when my ea hits TP or SL it opens trades again but i do not want to use same signal at the same bar . please can anyone tell me what should i do now.
code is given