I have program a strategy that use a function to adjust position size according to margin by contract requirement of the instrument.
i got 3 strategies running on 3 different instruments
I would like to adjust position size if there is submitted orders or opened positions in one or two of the others intruments.
So I would calculate the margin used and remaining to re adjust position size.
Can I do something like this :
If the strategy trade the USOIL and there is an order or position on the US3O
// Check for other orders or opened positions by other Algos
if (PositionAccount.MarketPosition != MarketPosition.Flat || if there is submitted orders in instruments differents than USOIL ){
if (PositionAccount.Instrument.MasterInstrument.Name == "@US30") {
// I will calculate used margin here to retract it from avalaible capital
}
// And will do the same for the third instrument
}
Thanks for the help
Comment