protected override void OnBarUpdate()
{
// Check if flat
if (GetAtmStrategyMarketPosition("id") == MarketPosition.Flat)
Print("ATM Strategy position is currently flat");
}
or
protected override void OnBarUpdate()
{
// If not flat print our open PnL
if (Position.MarketPosition != MarketPosition.Flat)
Print("Open PnL: " + Position.GetProfitLoss(Close[0], PerformanceUnit.Points));
}
I can't seem to get the first approach to work although other "get AtmStrategy...." commands are working.
Is there a preference for one over the other and are there limitations in using one over the other that need to be taken into account?
Also, in the if (GetAtmStrategyMarketPosition("id") == MarketPosition.Flat)
is the "id" element the unique id assigned to the atm strategy or "orderId" from the AtmStategyCreate command or "atmstrategyId" also from the AtmStrategyCreate Command?
daven
Comment