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

PeriodType.Day not looking back on intraday chart?

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

    PeriodType.Day not looking back on intraday chart?

    Hi,
    I wonder if you could give some guidance.
    I am running a strategy on a 1min chart in NT7 with
    CalculateOnBarClose = false;
    and use 'FirstTickOfBar' to replicate a bar-close type strategy.I only trade 1 instrument.
    In addition to running the strategy on the 1min chart I have also added the following timeframes:
    Add(PeriodType.Minute, 15);
    Add(PeriodType.Minute, 60);
    Add(PeriodType.Day, 1);

    I have programmed much of my strategy adding in 15min and 60min data/signals but I seem to have a problem with the daily data.
    I have put in a null check as follows ( I require at least 3 days data for the values I would like to calculate using daily data):

    if (CurrentBars[3] < 4 ) return;

    But when I check the value of CurrentBars[3] in the output window, it never gets above zero - ie it appears that despite having 10 days of data loaded on my 1min chart the CurrentBars[3] array is unable to load for whatever reason. (If I remove the daily data, then my strategy works fine across all 10 days using 1min, 15min, 60min barsarrays.)

    Is there a reason why I cannot load daily data on a 1min chart if, for example, 'CalculateOnBarClose = false;'?
    I recall that NT6.5 required barsarrays to be loaded in decreasing size order I think - is something similar causing a problem for my data loading here perhaps?

    Any tips/guidance much appreciated. Many thanks.

    #2
    Pourleau, what BarsRequired are you setting in your strategy properties as you start it up? This # would apply to all series, so also your daily one and if you only load 10 days it would never be satisfied then being on it's default 20 setting.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks, Bertrand - that was indeed the problem.

      I had set another variable to check days (private int DaysRequired) but this of course is subject to BarsRequired also.
      many thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by traderqz, Today, 12:06 AM
      1 response
      2 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by kujista, Today, 06:23 AM
      1 response
      2 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      33 views
      0 likes
      Last Post Pattontje  
      Started by abdo22, Yesterday, 03:15 PM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by f.saeidi, Yesterday, 02:09 PM
      3 responses
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X