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 port119, 04-27-2024, 02:43 PM
      3 responses
      30 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by sastrades, 01-31-2024, 10:19 PM
      13 responses
      203 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by reynoldsn, Today, 04:40 PM
      0 responses
      4 views
      0 likes
      Last Post reynoldsn  
      Started by Philippe56140, 04-27-2024, 02:35 PM
      6 responses
      54 views
      0 likes
      Last Post bltdavid  
      Started by ETFVoyageur, Yesterday, 06:05 PM
      7 responses
      45 views
      0 likes
      Last Post ETFVoyageur  
      Working...
      X