Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting

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

    Backtesting

    I have a problem with backtesting.

    I have historical prices on SP500. If i put in 01-01-1950 as from date and 01-05-2010 as to date and then test a strategy notting appears on summary. Every thing is $0, but the Chart appears correctly, but there is no executions, trades or orders.

    The test strategy is pretty simple. Buy if the short average cross above the long average and sell when the short average cross below the long average.

    protectedoverridevoid OnBarUpdate()
    {
    // Condition set 1
    if (CrossAbove(SMA(MediumAverage), SMA(LongAverage), 1))
    {
    EnterLong(DefaultQuantity,
    "BUY");
    }
    // Condition set 2
    if (CrossBelow(SMA(MediumAverage), SMA(LongAverage), 1))
    {
    ExitLong(
    "SELL", "");
    }
    }

    I hope someone can help me.

    #2
    superjma,

    Please check your Control Center logs for runtime errors. What are your values for MediumAverage and LongAverage?
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Log and values

      The Log are empty and the values are 50 and 200.

      I have attached a image showing the settings.
      Attached Files

      Comment


        #4
        superjma, please try backtesting this strategy on a stock or ETF, on indices it'll unfortunately not work as those are not directly tradable.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          It worked

          Thanks a lot.

          I just created the index as a new stock and imported the data and it worked fine.

          Perfect.. now i'm ready to develop a strategy.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          6 responses
          27 views
          0 likes
          Last Post ScottWalsh  
          Started by frankthearm, Today, 09:08 AM
          10 responses
          36 views
          0 likes
          Last Post frankthearm  
          Started by mmenigma, Today, 02:22 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by NRITV, Today, 01:15 PM
          2 responses
          9 views
          0 likes
          Last Post NRITV
          by NRITV
           
          Working...
          X