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

Add problem

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

    Add problem

    I have data available in NT for the Eurostoxx 50 index from 2003-2013 on minute and day basis. If I open the graph on a daily basis I see all days untill 2003. I have a new indicator using the add command with period.week. If I display Closes[1][0] I see all the closing prices from 2003-2013 changing on a weekly basis. So far so good.

    If I add exactly the same with period.week in my strategy and I print Closes[1][0] I notice that my data is only printed from dec 2006 - 2013. I am not able to use dat before dec 2006.

    It seems that in the strategy the add command is not loading all available data. The indicator is loading all the data. What could cause the difference, because I will need the weekly data in my strategy? Is there a restriction in the amount of data loaded?

    Kind regards,
    Rene

    #2
    Hello,

    If you've ensured the start date on the Strategy UI is set properly, one thing to experiment with is the amount of bars that need to be loaded before processing begins.

    When using something like

    if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired)
    return;



    This will help prevent out of bounds errors but will also mean more time will have passed before bar processing can begin.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Hi, live is unfortunately not that easy. I have already include that check. BarsRequired is only 50 bars, but the Closes[1] is only availbale after 1000 bars and beside that in the indicator it is working ok and the Closes[1] is already availbale after 50 bars. If have checked and have the same problem with other products.

      Kind regards,
      Rene Kreileman

      Comment


        #4
        50 bars would be about 1 year if using weekly data.

        Could you post a simplified version of your code that replicates the error you're seeing?

        Located in (MY)Documents\NinjaTrader 7\bin\Custom\Strategy
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by xepher101, Today, 12:19 PM
        0 responses
        7 views
        0 likes
        Last Post xepher101  
        Started by marcus2300, Today, 10:21 AM
        4 responses
        10 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by joselube001, Today, 12:17 PM
        0 responses
        8 views
        0 likes
        Last Post joselube001  
        Started by tkaboris, Today, 06:27 AM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_RyanS  
        Started by chemo, Today, 12:05 PM
        0 responses
        6 views
        0 likes
        Last Post chemo
        by chemo
         
        Working...
        X