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 Shansen, 08-30-2019, 10:18 PM
      24 responses
      939 views
      0 likes
      Last Post spwizard  
      Started by Max238, Today, 01:28 AM
      0 responses
      7 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by rocketman7, Today, 01:00 AM
      0 responses
      4 views
      0 likes
      Last Post rocketman7  
      Started by wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      28 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      33 views
      0 likes
      Last Post wzgy0920  
      Working...
      X