Martingale formula help required — Tradetron Community
← Community

Martingale formula help required

Strategy 970 views

Ramakrishnan

please help me to get the formula for

MARTINGALE .

I am using the formula as shown in fig.

it gives result as 1,2,3 and so on

I want a result as 1,2,4,8 and so on

Tradetron Team Tradetron team

Short answer: keep the lot count in a runtime variable and multiply it by 2 after a losing trade, instead of adding 1. That gives 1, 2, 4, 8.

Idea

  1. Initialize lots = Number ( 1 ).
  2. Set the leg’s quantity mode to QTY (Get Runtime in an Fx formula only reads in QTY mode, not LOTS or VALUE). Qty Fx: Get Runtime Number ( lots ) × Lot Size of the instrument, built with Math Operation.
  3. After a loss: in that exit’s runtime block set lots = Get Runtime ( lots ) * Number ( 2 ). You can also use Math Operation with '*', or '^' for powers of 2.
  4. After a win: reset lots = Number ( 1 ).
  5. Add a cap, e.g. use Min of Get Runtime Number ( lots ) and Number ( 8 ), so size cannot run away.

Caution: martingale sizing grows exposure quickly after a losing streak. Check margin at the maximum size and test in Live Offline first. A Universal Exit clears runtime variables, so the sequence restarts after one.

:sparkles: Answer written with AI from Tradetron docs (Oct 2026). Original replies are kept above. Spot something wrong? Reply below.