Calculate TP price for Martingale Expert

 

Hello,

I need to know How dose the EA calculate the TP price by using Martingale strategy for each trade...

If can some one share the formula with us in Exel sheet to use it ..

Thank you for ur time

 
Ahmed Balfageeh:

Hello,

I need to know How dose the EA calculate the TP price by using Martingale strategy for each trade...

If can some one share the formula with us in Exel sheet to use it ..

Thank you for ur time

You can close at Fix Point, Average Point or Netting Point.

  • Fix Point is the TP based on first position's volume.
  • Average Point is the TP based on last position's volume.
  • Netting Point is the TP based on total position's volume.

Ex. TP = 50 points:

1st position: 0,01, 2nd position: 0,02, 3rd position: 0,03.

Your profit would be the volume x 50 (0,50, 1,50 or 3,00).

 

I am using this formula below with expert I trading with ... but I can't understand it ...  I want to transfer it to exel

Sum += OrderOpenPrice() * OrderLots();
Vol += OrderLots();
Average = Sum / Vol;
TP All = Average +- TakeProfit;

 
Ahmed Balfageeh #:

I am using this formula below with expert I trading with ... but I can't understand it ...  I want to transfer it to exel

It seems what you call Average is Breakeven in fact.

 

Code:

in_orders_loop_sum:
 total_buy += OrderOpenPrice() * OrderLots();   // example: $1 * 0.1 lots + $2 * 0.1 lots = 0.3 (for two orders)     
 total_lots_buy += OrderLots();                 //      example =0.2 lots total

// calculation to obtain TakeProfit price
double total_buy  = NormalizeDouble(total_buy / total_lots_buy, Digits);            // calculate break even price. example: .3 / .2 = $1.50 breakeven price
double TakeProfitBuy= NormalizeDouble(total_buy + TakeProfitPips * PointValue,Digits); // Break even price + TakeProfitPips  
 
maximo #:

Code:

Can u please explain the code with example numbers .. 
 
Ahmed Balfageeh:

Hello,

I need to know How dose the EA calculate the TP price by using Martingale strategy for each trade...

If can some one share the formula with us in Exel sheet to use it ..

Thank you for ur time

Hello

 
Ahmed Balfageeh: by using Martingale strategy for each trade...

Martingale is not a strategy. It's a betting system.

Hedging, grid trading, same as Martingale.
          Martingale, Hedging and Grid : MHG - General - MQL5 programming forum (2016)

Martingale, guaranteed to blow your account eventually. If your strategy is not profitable without, it is definitely not profitable with.
          Martingale vs. Non Martingale (Simplified RoR vs Profit and the Illusions) - MQL5 programming forum (2015)

Why it won't work:
          Calculate Loss from Lot Pips - MQL5 programming forum (2017)
          THIS Trading Strategy is a LIE... I took 100,000 TRADES with the Martingale Strategy - YouTube (2020)

Reason: