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 llanqui, Today, 10:32 AM
        0 responses
        2 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by StockTrader88, 03-06-2021, 08:58 AM
        45 responses
        3,992 views
        3 likes
        Last Post johntraderuser2  
        Started by TAJTrades, Today, 09:46 AM
        0 responses
        8 views
        0 likes
        Last Post TAJTrades  
        Started by rhyminkevin, Yesterday, 04:58 PM
        5 responses
        62 views
        0 likes
        Last Post dp8282
        by dp8282
         
        Started by realblubb, Today, 09:28 AM
        0 responses
        8 views
        0 likes
        Last Post realblubb  
        Working...
        X