take profit modified into martingale strategy
-
good evening guys, some information. Can anyone decipher this for me on fxdreema? Thank you
tp=NormalizeDouble(last_open(OP_BUY)+(TakeProfitPointPOINTX),Digits);
this is the take profitt for strategy martingala
-
The normalised double part will just remove extra 0's by the number of digits in the pair/asset, using the last buy open price added to the take profit distance. Not sure what POINTX is, on FX you can add code, but might be better to recreate. TakeProfitPointPOINTX might be the name of a variable
-
The code you provided calculates the take profit price for a strategy using the Martingale approach. Here’s a breakdown:
NormalizeDouble() ensures that the value is within the allowed range of double values in MQL4/MQL5.
last_open(OP_BUY) gets the Open price of the last opened buy order.
TakeProfitPointPOINTX is a constant that represents the take profit value in points.
Digits is the number of decimal places used for the symbol’s price.
Calculation:
The take profit price is calculated by adding the TakeProfitPointPOINTX value (in points) to the Open price of the last buy order and then normalizing the result to ensure it’s within the allowed range.