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

Deficiencies between 2nd series indicator values and actual chart indicator values

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

    Deficiencies between 2nd series indicator values and actual chart indicator values

    Hello,

    I have faced the following issue:

    1. I am adding secondary data series to a strategy
    Code:
    if (State == State.Configure){
       AddDataSeries(BarsPeriodType.Minute,500);
    }
    2. Print the 14-period ATR value at the close of each secondary series bar
    Code:
    if (BarsInProgress == 1){
       Print("New secondary series bar: "+ATR(14)[0].ToString());
    }
    3. Compare these printed values with the 14-period ATR values on the actual 500-minute chart (should be the same, as I would have expected)
    4. And observe big differences on all the bars (around 10 points)

    If I use the same secondary series as the main series or series with rather similar period (for example, main series = 5-minute and secondary series = 5-minute or 60-minute) then there are no differences between those printed by the strategy and by those observed on the actual chart.

    Can you please advise me on if there is anything I do wrong?

    Best regards,
    Alexei

    #2
    Hello Alexei,

    Are both the script and the chart using the same number of Days to load?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      I guess the answer is "no" as I haven't specified the amount of bars to load in the AddDataSeries method. Can this be the reason of the issue?

      In relation to this, can you please advise me how can I specify the barsPeriodType and barsToLoad parameters in one AddDataSeries call?

      Best regards,
      Alexei

      Comment


        #4
        Hello Chelsea,

        Sorry, I have understood what you mean - please, disregard my previous message. I need to launch the strategy on a chart that has enough loaded days for the ATR(14) to be calculated on the secondary series. Thank you for your help!

        Best regards,
        Alexei

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Brevo, Today, 01:45 AM
        0 responses
        3 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        3 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        240 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        6 views
        0 likes
        Last Post oviejo
        by oviejo
         
        Working...
        X