Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting multiinstrument strategy wrong date range

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

    Backtesting multiinstrument strategy wrong date range

    I'm backtesting multiinstrument strategy on a date range(for example 01.01.2011 - 12.01.2011). If there is a symbol in a list which is traded only part of that range (since 06.01.2011) all strategy executing only on the range of this instrument(since 06.01.2011).
    How can I solve this problem? Is there any way to check if instrument was traded during the whole range I need before using Add(instrument)?

    #2
    Hello nysetrader,
    Thanks for writing in and I am happy to assist you.

    You can check time of the first bar and take proper steps
    Code:
    if (CurrentBar == Math.Max(0, BarsRequired))
    {
    	//do something
    }
    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      I think I can use your code in OnBarUpdate(). And I need to use it in Initialize() before Add(). Should be smth like this:
      protected override void Initialize()
      {
      if(EnoughData on Symbol)
      {
      Add(Symbol, PeriodType.Minute, 1);
      }
      }
      How can I check it?
      Last edited by nysetrader; 03-20-2012, 10:37 AM.

      Comment


        #4
        Hello nysetrader,
        Unfortunately there is no supported way of checking the data without loading it first.

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Stanfillirenfro, Today, 07:23 AM
        9 responses
        23 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by George21, Today, 10:07 AM
        0 responses
        6 views
        0 likes
        Last Post George21  
        Started by DayTradingDEMON, Today, 09:28 AM
        2 responses
        16 views
        0 likes
        Last Post DayTradingDEMON  
        Started by navyguy06, Today, 09:28 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        8 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X