Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What should I use to accomodate both backtesting

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

    What should I use to accomodate both backtesting

    and real trading?

    I have developed a couple of strategies already. Finally, all has problems in either backtesting or real time trading because the lack of knowledge about some details of NT. Now I am going to make a new strategy. Can anybody help me to see what I should use? My requirements and questions are:

    1. The ability to backtest in a same or similar result as real time trading;

    2. I am going to make the trading code in second bar object under OnBarUpdate with CalculateOnBarClose to true. Is this the best solution? I know that I will lose the tick handling in this way, but second is good enough for me because I know that tick will not allow backtest.

    Thanks!

    #2
    Hello,

    1- To backtest with interbar granularity:
    You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by

    However, no backtest is ever 100% like live trading:


    2- Yes, this is your easiest solution, but again please read the second link above.
    DenNinjaTrader Customer Service

    Comment


      #3
      Thanks, Ben! According to my understanding, the Backtest

      Originally posted by NinjaTrader_Ben View Post
      Hello,

      1- To backtest with interbar granularity:
      You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by

      However, no backtest is ever 100% like live trading:


      2- Yes, this is your easiest solution, but again please read the second link above.
      with interbar granularity you mentioned on your 1st link is for setting CalculateOnBarClose to false and build the capability for backtest, right?

      If I set the CalculatOnBarClose to true, do I need to use interbar granularity for backtesting? If I do, do I need to make some code for real time trading?

      Comment


        #4
        Hello,

        1- Yes, I gave this to you so you understand your options with NT.

        2 - No, you don't. Remember even though your strategy may calculate on the close of the bar, your results will be different. See the link I posted.
        DenNinjaTrader Customer Service

        Comment


          #5
          I got it.

          Thanks, Ben!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          656 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          371 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          579 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X