how to trade only one time in a up or down trend?

 

hi 

i was trying to code my ea to limit to trade only one trade in a up trend, but somehow it cannot be acheived. can any one help to give some examples here? Thank you!

 
Zero your count when the trend changes. Increment the count when you open an order. Test your count before opening. What's the problem?
 
William Roeder #:
Zero your code when the trend changes. Increment the count when you open an order. Test your count before opening. What's the problem?

thanks for reply, i saw your reply before https://www.mql5.com/en/forum/141838


static bool signalCurr; bool signalPrev = signalCurr;
signalCurr = ... // Your open condition
if (signalCurr && !signalPrev) ... // Now open

but it is not working , maybe i configure it wrong?

i need only one trade per signal
i need only one trade per signal
  • 2012.10.26
  • www.mql5.com
hi all, i need some guide on writing a code, can anyone show me suggestion and how i do it...