No announcement yet.

Partner 728x90


Backtest with spread.

  • Filter
  • Time
  • Show
Clear All
new posts

    Backtest with spread.

    I am very happy with Ninjatrader, I have been trading for a couple of years and it is the platform I like the most.

    I have some questions about the backtest:

    The Backtest NOT INCLUDE spread any type, all orders no contain Spread (spread is 0) ?

    Is it correct this or not?

    If I want the backtets to be made with Spread, I must use the Slippage to configure it?

    Is it correct this or not?

    If i have Spread 2 pips in EUR/USD (Bid 1.2340 Ask 1.2338) this spread is 2 pips, I most put slippage in "20"?, By entering that value in the "Slippage" means that ALL ORDERS will have Spread of "2".

    It would very grateful that they could clarify my doubt, since the results change dramatically when changing the "Slippage" (or spread?). Greetings and thanks.

    Hello samir,

    Thanks for opening the thread.

    Backtests do not include spread. To mimic this, the recommended approach is to add commission levels for forex instruments to account for the average spread.

    Use the following steps to set commission levels for forex instruments:
    1. Determine the average spread for the instrument in question (spreads vary by instrument, time, and brokerage account)
    2. Use the average spread to set the minimum commission at the instrument level
    3. (Note, users may need to change this value over time, as average spreads change for each forex pair)

    Backtests in the Strategy Analyzer will inherit the Commission Template assigned to the Sim101 account.

    I've included some publicly available resources for working with and applying Commissions Templates.

    Working with Commissions Templates -

    Applying Commissions Templates -

    Please let us know if we can be of further assistance.
    JimNinjaTrader Customer Service


      Jim. thanks for the answer.

      I was wrong about sub forum and I put the subject in Ninja 8, when I was really in NInja 7, I'm sorry.

      On the subject, in question, I only want to simulate the Spread that I want, I know that the Spread value is dynamic, because for the same reason my robots are very sensitive to spreads, so what I want to do is simulate a spread above average with a security factor 1.5 to ensure more or less that can work and not have to be doing backtets in demo accounts in real time.

      I have not had time right now to follow the issue (tonight I will have time), but is it acceptable to use the SLIPPAGE to simulate the spread ?, since it would be more or less the same as the spread or not? It is simply to open the order at a distance against my order. Or not?,

      Grettigns and regards.


        Hello samir,

        Thanks for the reply.

        Slippage is used to fill the order a certain distance away from the fill price, and within the bounds of the bars high and low used to simulate the fill. Historically, the bid will be used for the last price and the ask values would not contribute to the bars high and low. So simulating the bid-ask spread with slippage may not fully equate to the bid-ask spread.

        Finding an average spread could give you an idea for what the performance would be, but if you are looking for a more dynamic approach, I may suggest using different order types when backtesting and to set those prices a certain distance away from your original target prices to factor in a dynamic spread.

        I'll include some information on NT7's historical fill processing and how to set up commissions in NT7.

        Understanding Historical Fill Processing (NT7) -

        Using the Commissions tab (NT7) -

        If there is anything else we can do to assist, please let us know.
        JimNinjaTrader Customer Service


        Latest Posts


        Topics Statistics Last Post
        Started by muratb35, Today, 03:36 AM
        0 responses
        Last Post muratb35  
        Started by fernlicht, Today, 02:16 AM
        2 responses
        Last Post fernlicht  
        Started by fernlicht, 04-12-2021, 06:01 PM
        1 response
        Last Post NinjaTrader_PaulH  
        Started by memonolog, Today, 02:10 AM
        3 responses
        Last Post memonolog  
        Started by orenytz, Today, 12:25 AM
        0 responses
        Last Post orenytz
        by orenytz