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 knowmad, Yesterday, 03:52 AM
      5 responses
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by ETFVoyageur, Yesterday, 07:05 PM
      3 responses
      23 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by geotrades1, Today, 07:54 AM
      2 responses
      6 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by prisonbreaker82, 02-24-2024, 11:16 AM
      2 responses
      35 views
      0 likes
      Last Post proptradingshop  
      Started by MGHORBEL, Today, 06:25 AM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X