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 helpwanted, Today, 03:06 AM
        1 response
        10 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        9 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        387 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X