Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        1 view
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        8 responses
        61 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        4 responses
        3,289 views
        1 like
        Last Post jgualdronc  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        5 views
        0 likes
        Last Post Option Whisperer  
        Started by halgo_boulder, 04-20-2024, 08:44 AM
        2 responses
        22 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X