if (Position.MarketPosition == MarketPosition.Long){
SetTrailStop("",CalculationMode.Percent,2*ATR(20)[0]/Position.AvgPrice,true);
}}
Is it correct to code as the above way, if what I want to achieve is set a trail stop at the level I picked and then let the system to handle the trail automatically afterward?
In fact, I'm not so sure where should SetTrialStop be put, OnBarUpdate or OnOrderUpdate?
Meanwhile, how to know the most updated trail stop level (once it start trialing) ?

Comment