Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

a few questions about strategy backtesting

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

    a few questions about strategy backtesting

    I have a NinjaTrader strategy which I am trying to fine-tune. I have a few questions:

    1.How do I add a commissions field and how do I have the strategy deduct commissions in the backtests?

    2.How does the slippage function work? I have tried using the number 1 per trade but it seems to be overstating how much slippage is calculated in the backtests.

    3.How can I add a variable for times of day so I can test, say 10 am to 12 pm, on a 24 hour chart instead of using the market hours chart which eliminates the overnight data?

    Look forward to comments.

    #2
    Hello TurnSignalJim,

    1. Commission can be included in your PnL calculations provided you have correctly configured NinjaTrader. Commission values can be defined for each connectivity provider per instrument and per instrument type.

    You may follow the instructions below to define commission values per instrument type:

    * From within the NinjaTrader Control Center window select the menu Tools > Options
    * Select the tab "Commission"
    * Here is a link to our Help Guide that goes over example of how commissions can be setup.


    Critical: Ensure that 'Apply commission to PnL calculations' is enabled under Tools > Options > General tab for real-time trades and in Backtests make sure to "Include commission" is set to true.

    2. If you set the "slippage" variable NinjaTrader will apply that many ticks in slippage to the price of your orders if price allows it. Meaning that if you place a Market Order with 1 tick of slippage it will try to buy/sell at the next bar's open but price allows 1 tick of slippage then NinjaTrader will apply this to your order.

    3. Not exactly sure what you are looking for. Did you only want to trade in between those hours or do you only want your chart to show data in between those hours?
    JCNinjaTrader Customer Service

    Comment


      #3
      Thank you, JC.

      To backtest, I know how to create time templates for specific periods but the chart only begins to load data on the first bar of the period. I want to be able to bactest on a 24 hr chart to look at portions of it separately.

      Hope this clarifies.

      Comment


        #4
        Hello TurnSignalJim,

        Could you give me an example of this so that I may try to assist you further?
        JCNinjaTrader Customer Service

        Comment


          #5
          Okay, I am using a 24/7 chart so I can see all the market movement from Jan 6 to Jan 10 but I want to backtest the hours of 10am to 12 pm on each day. If I set the chart to only give me info from 10-12 then the market movement in the other times will not be taken into account by the indicators I am using in my strategy.

          Comment


            #6
            Hello TurnSignalJim,

            Thanks for the clarification. I believe I know what you are looking for now.

            From what I understand that you want to still load the data 24/7 for your chart so that you have all of the data but only want to trade between those hours. To do this you may create a time filter in your strategy to limit the hours that your strategy is trading but still keep all of the data loaded. Here is an example of how to create a time filter that you may view.



            Let us know if you have any questions.
            JCNinjaTrader Customer Service

            Comment


              #7
              Thank you, JC, I will get back to you if I have more questions.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              637 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              366 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              107 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              569 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              572 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X