need help about take profit

 
in my expert i want the distance between (open price-EMA)*2 for take profit?how can i do this in mql4?
 

Same for  buy and sell: (open-ema)*2?

For a buy: open-price + (ask-bid = spread) + fabs(open-price-ema*2) and
for a sell : open-price - (ask-bid = spread) - fabs(open-price-ema*2)?

 
Carl Schreiber #:

Same for  buy and sell: (open-ema)*2?

For a buy: open-price + (ask-bid = spread) + fabs(open-price-ema*2) and
for a sell : open-price - (ask-bid = spread) - fabs(open-price-ema*2)?

*2 does not work

this does not multiply by 2

 
Armin Abolfathi #:

*2 does not work

this does not multiply by 2

?? Why not? Go through your EA with the debugger: https://www.mql5.com/en/articles/654
Debugging MQL5 Programs
Debugging MQL5 Programs
  • www.mql5.com
This article is intended primarily for the programmers who have already learned the language but have not fully mastered the program development yet. It reveals some debugging techniques and presents a combined experience of the author and many other programmers.