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 daily series to minute series

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

    Add daily series to minute series

    NJ experts,

    I have a multiple time frame issue: I could not add Daily data series to minute data series.

    In my case, the primary chart is 1 minute. I have no problem in adding another minute data series of different period, no problem in adding second and tick data series. But When i add day series and above, the program will not work. The compiling will be successful, though, without any error message.

    I have simplified the issue in the following code. No variable is declared so this one can be tested by copy and paste.

    Any comments/suggestions are welcome.

    protectedoverridevoid Initialize()

    {
    //Add(PeriodType.Minute, 60);
    //Add(PeriodType.Second, 30);
    //Add(PeriodType.Tick, 30);
    Add(PeriodType.Day, 2); // BarsInProgress == 1. BarsArray[1]
    CalculateOnBarClose = false;
    }
    protectedoverridevoid OnBarUpdate()

    {
    if (Close[1]>Close[2])
    {
    Print(
    "Data series 0 value is" + ATR(1)[0].ToString());
    Print(
    "Data series 1 value is" + ATR(BarsArray[1],1)[0].ToString());
    }
    }

    #2
    binwang2,

    Are you making an indicator or a strategy? Multi-series indicators is currently not available. You can only do this in a strategy.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I am doing it in a strategy.
      No error message in compliling. But as long as it is at day level (week is the same), there will be no output.

      Comment


        #4
        binwang2,

        Please be sure you have enough data on all series. For daily bars you need to have at least 20 days.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Changed default settings to include at least 35 days of data. It works. Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sidlercom80, 10-28-2023, 08:49 AM
          172 responses
          2,279 views
          0 likes
          Last Post sidlercom80  
          Started by Irukandji, Yesterday, 02:53 AM
          2 responses
          17 views
          0 likes
          Last Post Irukandji  
          Started by adeelshahzad, Today, 03:54 AM
          0 responses
          4 views
          0 likes
          Last Post adeelshahzad  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by WeyldFalcon, 12-10-2020, 06:48 PM
          14 responses
          1,431 views
          0 likes
          Last Post Handclap0241  
          Working...
          X