Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetTrailStop(), CalculationMode.Price and breakeven

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

    SetTrailStop(), CalculationMode.Price and breakeven

    I am using trailing stops, so naturally, I am using SetTrailStop and not SetStopLoss. I also want to set the stop to breakeven after x ticks.
    SetTrailStop("LongEntry1", CalculationMode.Price, Position.AvgPrice, false);

    However, in the documents for SetTrailStop() it says:
    Note: CalculationMode.Price is irrelevant for trail stops
    and
    The value the trail stop order is offset from the position entry price (exception is using .Price mode where 'value' will represent the actual price)

    That leaves me wondering can I or can I not use .Price with SetTrailStop to set to breakeven?

    If not, is there a way to use .Ticks to set to breakeven?

    #2
    Hello Ricktek,

    Thank you for your note.

    You cannot use .Price as this will set a hard value and not something to trail by.

    .Ticks or .Percent would be the preferred methods here.

    Additionally, TrailStop will start working the second that the order is placed and will trail the market with each tick in profit by the amount set.

    If you want to break-even per say you need to use either SetStopLoss() and dynamically set this in OnBarUpdate() or use Exit orders for this with the calculation logic.

    The reference sample below is how to dynamically set StopLoss -
    http://www.ninjatrader.com/support/f...ead.php?t=3222

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      That's what I thought but I found the documentation confusing because of that second quote I listed. Rhetorical question: Why is that statement even there if .Price cannot be used?

      I've already seen the link you suggested; it only refers to SetStopLoss (no trailing stop example). Since NT does not permit use of both SetStopLoss and SetTrailStop, that information does not apply. Thanks for trying.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      64 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      41 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      22 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      25 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      51 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X