Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Printed values from within Strategy dont match the plots

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

    Printed values from within Strategy dont match the plots

    Printed values from within indicator don't match the chart plots but the plots match the data box..

    I want to use the indicator values..

    enclosed is the indicator

    at the end of the indicator is my print statements.. any clue to this mystery will be appreciated....
    Don
    Attached Files

    #2
    Hello gg80108,

    The plot set method is using an overload that is not the same as the Draw method.

    For your plots you're using:
    DataSeries.Set(int barsAgo, double value)
    You can also set the value for historical bars by including a "barsAgo" value that represents the number of bars ago that you want the double value to be stored at.

    for(n=i0;n<=i0+p;n++)
    {
    Sqh.Set(n,Fx[n]+sq);
    Sql.Set(n,Fx[n]-sq);
    }

    Compared to:

    DrawText("Sqh"+CurrentBar, "Sqh " + Sqh[0].ToString("#.##"), 0, High[0] + 8* TickSize, Color.Blue);
    DrawText(
    "Sql"+CurrentBar, "Sql " +Sql[0].ToString("#.##"), 0, High[0] + 7 * TickSize, Color.Blue);


    Your set method is applying the value to n bars ago and the draw method is not.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Yes I can see this.. but still wondering how the plotted graphs come out like they do without [0] containing the value plotted on the current bar.?

      Comment


        #4
        gg80108, you would need to check into the source indicator used - like the best fit Linear Regression channel this will produce a best fit estimate over the lookback length - which means that historical values seen in the plot would not match up with the databox entries.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X