Its odd that SQX does not yet support or have any concept of Margin risk management for Futures.
Return / (Drawdown + Margin)
this is to ensure the account does not get margin calls, especially in portfolio scenario.
This applies primarily to futures. Some futures contracts have 8-12% margin requirements, some even higher, e.g. Bitcoin futures at 50% margin. with a drawdown of 50% the account will get margin call..
When you trade multiple strategies on the same portfolio it can get even more of a problem.
It should be a very simple change, but will help manage margin risks greatly.
Like how you enter spreads as an input, you can have either of
(1) calculated margin based on position value per lot based on a % input
(2) just a fixed margin $ value per lot as a $ input
if you chose to implement (1) then input will be a % value. formula to calculate $margin = (position $value) x (%margin) x (lot size)
if you chose to implement (2) then input will be a $ value. formula to calculate $margin = ($margin) x (lot size)
Then then can be used for calculations for reports and optimizations etc.
Note, futures has this concept of initial, maintenance etc margins. To keep it simple just use a single value.
with no risky (rather gambling) we cant get margin calls with this kind of strategies