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 zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      150 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      6 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      6 views
      0 likes
      Last Post tkaboris  
      Working...
      X