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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X