How to calculate leverage adjusted lot size ?.

 

Lot size = Risk Money / (Stop Loss Distance * Tick Value)

This formula retrieves the lot size. Since Price levels are same and tick values are same for every broker that lot size is the common lot size. But the required margin for that lot size could be different due to the leverage of the trading account. 

example -: 

if you do calculate the lot size in regular way, the calculation formula is returning the same lot size (ex - 03 lots) for the 1:500 leveraged broker and for the 1:100 leveraged broker. because the tick value of the symbol is always same for every broker. but you may be able to open 03 lots trade on 1:500 broker but not be able to open 03 lot trade in 1:100 leveraged broker due to insufficient margin

That is the question. How to calculate leverage adjusted lot size?

so even the price levels are same for two different brokers, the lot size will be different due to leverage. 


Honestly, I tried so many formulas. none of them calculate the leverage adjusted lot size. :(

 

Usually, lot size should be calculated based on SL distance, tick value and the amount of money you want to risk.

Leverage or margin is out of this equation because it do not changes the potential loss, but only the required margin.

It comes from itself, that on a lower leverage account, you need to decrease your "risk money".

If you want it to be automatical, you can simply multiply your obtained lot size * (AccountLeverage / 500), so based on your example, in 1:100 account you will have lot size 5 times less than on 1:500 account.

 

Risk depends on your initial stop loss, lot size, and the value of the symbol. It does not depend on margin or leverage. No SL means you have infinite risk (on leveraged symbols). Never risk more than a small percentage of your trading funds, certainly less than 2% per trade, 6% account total.

  1. You place the stop where it needs to be — where the reason for the trade is no longer valid. E.g. trading a support bounce, the stop goes below the support. Then you compute your lot size.

  2. AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/PIP, but it takes account of the exchange rates of the pair vs. your account currency.)

  3. Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency.
              MODE_TICKVALUE is not reliable on non-fx instruments with many brokers - MQL4 programming forum (2017)
              Is there an universal solution for Tick value? - Currency Pairs - General - MQL5 programming forum (2018)
              Lot value calculation off by a factor of 100 - MQL5 programming forum (2019)

  4. You must normalize lots properly and check against min and max.

  5. You must also check Free Margin to avoid stop out

  6. For MT5, see 'Money Fixed Risk' - MQL5 Code Base (2017)

Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5 or 0.1 Lots maximum.

 

The fixed variable under your control is the "amount of money" you can lose: i.e., = SL distance * PipValue * LotSize.

Leverage has nothing to to do with the amount of lost money at all. You can lose the same money whether non-leveraged or with 1:100 leverage or 1:500 leverage. Or, even you can lose less money with 1:500 leverage than 1:100 leverage by decreasing lotsize or SL distance.

Leverage means the "deposit" money that is reserved to control the same LotSize in the above equation. Leverage only determines the required margin to control that position size.

For whatever LotSize, you must have enough funds (margin) for it. You account balance should cover both the potential loss (usually 2% of balance) + required margin.

If required margin > balance: you must decrease LotSize (and probably increase SL distance).

Reason: