Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting incomplete Results when running test on EOD data. Where am I messing up ?

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

    Getting incomplete Results when running test on EOD data. Where am I messing up ?

    Hello Everyone,

    Here is the script I am testing :
    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    Print(Time[0].ToString("dd/MM/yyyy") + "," + Time[0].ToString("HH:mm:ss") + "," + Close[0]);
    }


    Timeframe : 1/1/2015 to 02/23/2015

    However the output I am getting is this :

    30/01/2015,06:00:00,187.7
    31/01/2015,06:00:00,179.85
    03/02/2015,06:00:00,180.65
    04/02/2015,06:00:00,181.55
    05/02/2015,06:00:00,185.85
    06/02/2015,06:00:00,184.15
    07/02/2015,06:00:00,184.2
    10/02/2015,06:00:00,181.95
    11/02/2015,06:00:00,183.6
    12/02/2015,06:00:00,189.65
    13/02/2015,06:00:00,190.5
    14/02/2015,06:00:00,187.6
    17/02/2015,06:00:00,182.9
    18/02/2015,06:00:00,182.9
    19/02/2015,06:00:00,178.8
    20/02/2015,06:00:00,178.9


    The data for almost all of January is missing and more importantly that from 21/02/2015 which is [0] is also missing (it is available as can be seen in charts and Data box).

    Data source is yahoo.

    Could you help me please?

    Thank you !
    Vin

    P.S I have attached the Backtest Setup parameters which I've been using. I am working with Daily charts.
    Attached Files

    #2
    Hello fish.without.meat,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    The Minimum Bars Required are set to 20, so most of January would need to be loaded before the print starts. So you can reduce this to 0 if needed.

    In addition, CalculateOnBarClose is set to True. So the last bar is not used as it has not closed until a new bar forms after it. Try setting this to CalculateOnBarClose = False and test again.

    Comment


      #3
      Thanks a lot !

      Thank you so much Patrick ! Totally misinterpreted the meaning of 'minimum bars required'.. Finally I can move forward :-)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      68 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X