I want to ask if it is the correct way to have the setstoploss and setprofittarget in onbarupdate like
if (Positions[4].MarketPosition != MarketPosition.Short)
{SetStopLoss("rS1a", CalculationMode.Ticks, st1s1, false);
SetStopLoss("rS1b", CalculationMode.Ticks, st2s1, false);
SetProfitTarget("rS1a", CalculationMode.Ticks, t1s1);
}
Is this ok or do I need it to have it also in state.configure....?
And I want to ask please if with this code in script-strategy the stoploss and profittarget are working oco (if one is hit the other is cancelled) when working with NT-brokerage and continuum datafeed. How does it recognize for working oco, by the name "rS1a"? (is this here working same as doing a trade with a chart-trader ATM?)
Thank you!
Tony

Comment