Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Backtest with spread.

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

    Backtest with spread.

    Hi,
    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.

    #2
    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 - https://ninjatrader.com/support/help...commissi_2.htm

    Applying Commissions Templates - https://ninjatrader.com/support/help...commissi_3.htm

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

    Comment


      #3
      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.

      Comment


        #4
        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) - https://ninjatrader.com/support/help...a_strategy.htm

        Using the Commissions tab (NT7) - https://ninjatrader.com/support/help...ission_tab.htm

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by love2code2trade, Yesterday, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Started by funk10101, Today, 09:43 PM
        0 responses
        7 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        44 views
        0 likes
        Last Post bill2023  
        Started by yertle, Today, 08:38 AM
        6 responses
        26 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Working...
        X