One Trade Per Signal

Edward Ramirez  

Hi everyone,

I have created an expert advisor using an online EA generator. It gave me the code and everything but there is one small detail I would like to get fixed. 

Context:

The Expert Advisor is simple and trades on the 1hr timeframe. The conditions are as follows:

1. If previous candle closes above/below 120 simple moving average
2. If CCI is above/below "30/-30" (CCI levels vary from currency to currency)
3. If Bulls level is above/below "0"
4. If MACD Signal is above/below "0" (settings are 5,15,9)

It's proven to be pretty profitable but my problem has been that when pice hits Take Profit, and the above conditions are met, it will open another trade in the same direction, and will most likely result in a Stop Loss being hit. 

In the attached image below I've set an example on EURUSD. A sell signal would have been picked up at 1.17618 and TP would have been hit at 1.16517. But, since the conditions are still giving a sell signal, another Sell position would have opened up at 1.16517 and would have been stopped out. 

I'm looking for someone to please help code a little line of code that will prevent this from happening, and just do one trade per signal. I would be glad to share the code with anyone that can help out. 

Thanks!

Julian Jaeger  

"I'm looking for someone to please help code a little line of code that will prevent this from happening, and just do one trade per signal. I would be glad to share the code with anyone that can help out. "


Hi Edward, 

just create an order in the freelance section https://www.mql5.com/en/job . 

cheers, Julian

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
Hi there, Thanks for viewing my EA request. In a previous previous job I have ordered the creation of a simple breakout strategy indicator and EA based on that indicator. It draws a box on predefined periods of time (first hours of 3 major forex sessions) to display high/low prices of that period. High/low lines are placed and after a candle is...
Reason: