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 DayTradingDEMON, Today, 09:28 AM
      4 responses
      21 views
      0 likes
      Last Post DayTradingDEMON  
      Started by geddyisodin, Yesterday, 05:20 AM
      9 responses
      50 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by George21, Today, 10:07 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by Stanfillirenfro, Today, 07:23 AM
      9 responses
      24 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by navyguy06, Today, 09:28 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X