Hi Funyoo,

I have been reading all these MQL code snippets, but couldn't find anything to add a "Cost Average" function to an EA. Or may be I am not able to figure out that.

Anyway, I would be greatful if you could help me on this please.

The idea is to open a new trade if the same signal is still valid (as of the last trade) and drawdown is 20pips. The take profit will be the same as of the last trade opened when the signal was generated.