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 r68cervera, Today, 05:29 AM
          0 responses
          3 views
          0 likes
          Last Post r68cervera  
          Started by geddyisodin, Today, 05:20 AM
          0 responses
          4 views
          0 likes
          Last Post geddyisodin  
          Started by JonesJoker, 04-22-2024, 12:23 PM
          6 responses
          35 views
          0 likes
          Last Post JonesJoker  
          Started by GussJ, 03-04-2020, 03:11 PM
          12 responses
          3,239 views
          0 likes
          Last Post Leafcutter  
          Started by AveryFlynn, Today, 04:57 AM
          0 responses
          6 views
          0 likes
          Last Post AveryFlynn  
          Working...
          X