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

Problem when adding secondary ticks data series (with tick replay mode)

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

    Problem when adding secondary ticks data series (with tick replay mode)

    Hi,
    After adding ticks dataseries in the OnStateChange method we get the exception listed below. It is happening only while loading the chart.

    In OnStateChanged we add the dataseries using the following line:
    AddDataSeries(BarsPeriodType.Tick, 1);

    We test this in replay mode. It is working on two PCs but on the third PC we get data out of the range of the chart, and this is why it is throwing the exception below.
    It is strange that if we use 32 days back chart it is not throwing the exception, but if we are using 30 days back chart we get the exception... While the 32 days chart has more bars than the 30 days chart.

    I want to note that we have tick replay data for 3 days back, all other 27 days are loaded historically (for them we do not have tick data in the NT8 DB)

    I am suspecting that this is DB/data issue, but decided to ask you and to see what you will suggest

    P.S.
    Even if we delete the tick replay data and download it again, the exception continues to exist.
    I get the current tick/bar closing price using - Closes[1][0]
    Two lines after that I am getting the prior tick bar close using
    if (p > Closes[1][1]) {...}
    and here it is the place where I get the exception. What is worrying me is that on one of the computers we get the following exception (on the other two test PCs we do not have this issue)

    Parameter name: index
    at System.ThrowHelper.ThrowArgumentOutOfRangeExceptio n(ExceptionArgument argument, ExceptionResource resource)
    at NinjaTrader.Data.BarsSeries.GetOpen(Int32 index)
    at NinjaTrader.Data.BarsSeries.GetClose(Int32 index)
    at NinjaTrader.Data.Bars.GetClose(Int32 index)
    at NinjaTrader.NinjaScript.PriceSeries.get_Item(Int32 barsAgo)
    at NinjaTrader.NinjaScript.Indicators.DValueAreaFinal _NoUI.OnBarUpdate() in c:\Users\abubi\Documents\NinjaTrader 8\bin\Custom\Indicators\DValueAreaFinal_NoUI.cs:li ne 1374

    #2
    Hello vlaladim,

    Thank you for your post.

    It certainly could be a data issue.

    To confirm, are you using the same type of connection on all three PCs? Who is your data provider? And the script tested is the same on all three computers as well?

    Would you be able to supply a reduced version of the code with all code unnecessary to reproduce removed? I'd like to see if I get the same on my end.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi Kate,
      Yes the tests are absolutely the same on all three computers. We are using Interactive Brokers as data provider.
      But this problem shows up only when we use replay data, and is happening only while it is processing Historical data, once the chart is updated and is with non historical state
      Attached Files

      Comment


        #4
        Hell vlaladim,

        Thank you for your reply.

        So this is occurring in Playback using Market Replay before it gets to the actual data being played back, is that correct?

        Can you confirm that this PC has historical tick data downloaded for the entire historical time period being loaded prior to starting playback? It's worth noting that the data loaded on the chart prior to beginning playback is loading from your historical data, and IB does not provide historical tick data. You can check the available tick data by going to the Historical Data window and expanding the Historical section and drilling down to the tick level.

        Thanks in advance; I look forward to assisting you further.

        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by chartchart, 05-19-2021, 04:14 PM
        3 responses
        577 views
        1 like
        Last Post NinjaTrader_Gaby  
        Started by bsbisme, Yesterday, 02:08 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by prdecast, Today, 06:07 AM
        0 responses
        3 views
        0 likes
        Last Post prdecast  
        Started by i019945nj, 12-14-2023, 06:41 AM
        3 responses
        60 views
        0 likes
        Last Post i019945nj  
        Started by TraderBCL, Today, 04:38 AM
        2 responses
        18 views
        0 likes
        Last Post TraderBCL  
        Working...
        X