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

Bid/Ask spread in FOREX

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

    Bid/Ask spread in FOREX

    Let me try this again....

    I'm new to NT and this forum so I hope this his the right place to ask this question.

    In developing and backtesting strategies using Ninjascript I find that my 'EnterLong()' and 'EnterShort()' calls are placing orders at the CurrentAsk and CurrentBid price - which happens to be the same. Does NT take into account the currancy pair pip spread? and if so, how do I set it?

    Or do I have to program the spread in my strategy? And if so, how do I do that - for both long and shorts?

    #2
    There is no concept of bid or ask price in a backtest. In a backtest, we only have a bar OHLCV information. During a backtest, bid and ask price are subsituted with the bar's closing price.

    If you want to take into account a spread, I would set my slippage amount when running a backtest to a value of 3 if the currency being tested has a spread of 3.
    RayNinjaTrader Customer Service

    Comment


      #3
      So that was easy enough to do... once I knew what I was doing

      However, the Slippage only goes as high/low as the bar high/low - meaning that I lose a pip spread here and there.

      It dawned on me that I could just determine my trading "cost" by not setting slippage to 0 and then just multipling the pip spread by the number of trades in a backtest.

      See any problems with that?

      Comment


        #4
        No, I do not see any problem with that.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RookieTrader, Today, 09:37 AM
        4 responses
        17 views
        0 likes
        Last Post RookieTrader  
        Started by PaulMohn, Today, 12:36 PM
        0 responses
        2 views
        0 likes
        Last Post PaulMohn  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        38 views
        0 likes
        Last Post love2code2trade  
        Started by alifarahani, Today, 09:40 AM
        2 responses
        14 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by junkone, Today, 11:37 AM
        3 responses
        21 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X