Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

set trailing stop

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    set trailing stop

    Hi,
    my strategy is calculating based on oneachtick and I am using SetTrailStop(@"Long", CalculationMode.Ticks, StopLossDistanceInTicks, false); to trail the stop. Now, is it possible to update the trailing stop only on bar close? I am using the settrailstop method in state.configure? If yes, can you please suggest?

    #2
    Hello asmmbillah,

    Thanks for the post.

    The SetTrailStop would follow the scripts Calculate setting so that would not be possible with that method specifically. You could submit your own stop order using SetStopLoss instead of using the SetTrailStop and then control the trailing from OnBarUpdate. In OnBarUpdate you can add a condition that uses IsFirstTickOfBar to simulate OnBarClose.





    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NinjaTrader_Brett, 05-12-2025, 03:19 PM
    0 responses
    200 views
    0 likes
    Last Post NinjaTrader_Brett  
    Started by domjabs, 05-12-2025, 01:55 PM
    2 responses
    49 views
    0 likes
    Last Post domjabs
    by domjabs
     
    Started by Morning Cup Of Trades, 05-12-2025, 11:50 AM
    1 response
    53 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by imjustkaze, 05-12-2025, 12:20 PM
    2 responses
    89 views
    0 likes
    Last Post imjustkaze  
    Started by IanS00, 05-12-2025, 11:57 AM
    3 responses
    33 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Working...
    X