Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot stop DataSeries values from Strategy

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

    Plot stop DataSeries values from Strategy

    I have custom stop loss logic that I want to display on the backtest charts whenever I am holding a position.

    Based on what I've read I can't put these data in a DataSeries and display that on the chart as a curve.

    However I don't think I can implement the logic as an Indicator because it needs to know that when the strategy is not in a position it should not display values (i.e., it should be DataSeries.Reset for those bars).

    What is the best solution to display this stop curve?

    #2
    Hello dbooksta,

    Thank you for your post.

    I do not see why you could not create this as an indicator and have it plot on the chart. Can you provide an example that you have attempted that does not work?

    Comment


      #3
      Maybe I can. Can an Indicator get Position.AvgPrice and Position.MarketPosition from a Strategy that instantiates it?

      Comment


        #4
        Hello dbooksta,

        Thank you for your response.

        That would be a good example that would not work unfortunately. The Indicator could not access those values and thus if the Stop Loss is based on that value we could not track it.

        You can however set up the plot via the strategy and pass it to the indicator as seen in our SampleStrategyPlot reference sample at the following link: http://www.ninjatrader.com/support/f...ead.php?t=6651

        Comment


          #5
          That example explicitly says it won't work for backtesting, which is what I want this feature for.

          Comment


            #6
            That would be unfortunately correct in understanding dbooksta, although backtesting from regular charts would show those plots normally. As alternative for debugging you could for example use Draw methods to show the levels, although I would limit to debug use as ample of those objects would carry a performance impact.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            573 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            575 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X