Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Stop Issue

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

    Trailing Stop Issue

    In the strategy builder, whenever I try to backtest a strategy with a trailing stop, the strategy analyzer comes back with every trade having been entered and exited at the same time.
    My summary shows that every trade fails with commission being the only dollar amount.
    Upon looking at the chart, every trade it would have made is showing an entry and exit at the same price on the same bar.
    I've made sure the trailing stop is the only exit condition.
    Does the strategy analyzer not function using a trailing stop? I feel like I've looked through every resource and can't find an answer.

    #2
    Hello ThatProblemGuy,

    Welcome to the NinjaTrader forums!

    What values have you used for the trailing stop?

    Enable TraceOrders and print the time of the bar and the position average price.

    Below is a link to a forum post that demonstrates using prints to understand behavior and discusses enabling TraceOrders.


    What is the position average price?
    What is the stop price of the order?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Is this the Print you are referring to?
      I set it to backtest from September.
      I see the issue being that it assumes the price to be zero in 99+% of cases, but I'm unsure how to fix that.

      NinjaScript Output 1_4_2022 3_01 AM.txt
      Attached Files

      Comment


        #4
        Hello ThatProblemGuy,

        Below is a direct link to TraceOrders in the help guide, that was linked in the forum post above in case this was overlooked.


        I'm not sure what is in this output as there are no labels. The post above highly encourages labeling the output so we know what numbers are.

        Is this is the Position.AveragePrice? Is this the <order>.AverageFillPrice when the order is OrderState.Filled?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        65 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
        23 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        26 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        52 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X