How to input Lot size from runtime variable? Need help — Tradetron Community
← Community

How to input Lot size from runtime variable? Need help

Uncategorized 1,083 views

Tradetron Team Tradetron team

Get Runtime inside an Fx formula only works when the leg’s Position Builder is set to QTY, not LOTS or VALUE. That is why your setup does not work.

Steps

  1. In Initialize Variables, create my_lots with a value, e.g. Number(2).
  2. In the Position Builder, switch the leg’s quantity type to QTY.
  3. In Qty Fx, convert lots to quantity:
    Math Operation(Get Runtime Number(my_lots), Lot Size(<instrument>), '*')
    Use Get Runtime Number (Get Runtime returns text) and the Lot Size keyword, so the quantity stays right if the exchange changes the lot size.
  4. For NIFTY and BANKNIFTY legs, use each leg’s own instrument in Lot Size.

Example

my_lots = 2 → Qty Fx = 2 × Lot Size of that contract. Change the variable (or push a new value through the API) and the next entry uses the new size.

Notes

  • Make sure the variable has a value before the entry reads it; an unset variable has no value.
  • Deployment Multiplier still applies on top.
  • Test in Live Offline and check the order quantity in the Notification Log.

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