Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetTrailStop clarification desired

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

    SetTrailStop clarification desired

    When using SetTrailStop in ninjascript, is it called just once after the trade is entered and the stop automatically adjusted or does it have to be called every time the price moves up/down the specified amount?

    SetTrailStop("myLongEntry", CalculationMode.Ticks, ticksTrailingStop, bSimStop);

    #2
    Hello Ricktek,

    Thank you for your note.

    The order will get place as you enter into a position and will start working off of live data at that point.

    Please note that in a backtest, we don't have the intrabar data so it will update once and accordingly with the close price of each bar. I.E. the number ticks the close is from the Entry point
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by ricktek View Post
      When using SetTrailStop in ninjascript, is it called just once after the trade is entered and the stop automatically adjusted or does it have to be called every time the price moves up/down the specified amount?

      SetTrailStop("myLongEntry", CalculationMode.Ticks, ticksTrailingStop, bSimStop);
      Both. SetTrailStop() will be activated and start trailing as soon as you enter the trade. If you want to change the amount of the trail (tighten the stop as the trade gets long in the tooth), you can always call SetTrailStop() again with the tighter trailing offset.

      That is why we tell you to reset the TrailStop when the trade goes flat. Of course, if you never changed it, the point is moot.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      151 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      79 views
      0 likes
      Last Post PaulMohn  
      Working...
      X