Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

bid-offer in backtesting

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

    bid-offer in backtesting

    Hi,

    I am new to Ninja trader and downloaded historic minute-data from IB that includes Bid, Offer and Last prices.

    However during the backtest, the function call GetCurrentAsk() returns the same value as GetCurrentBid() despite the fact that the data source shows different values. What is going on?

    How are bid-offers are taking into account?

    cheers

    #2
    Hello alexL,

    Thank you for your note.

    In a backtest the GetCurrentAsk() and Bid are subsituted with the close of the bar.

    The reason is because in historical data we only know the Open, High, Low, Close, and Volume of the bar and not the intrabar data.

    http://www.ninjatrader.com/support/h...currentbid.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hello Cal H

      thank you for your prompt response !
      Forgive me for still being confused: The data imported from IB into Ninja has three bars: Offer, Bid and a Last bar, each of which has an Open, Close, High, Low. So the question is why I wouldn't get filled on the Close of the Offer bar (for a buy) and the Close of the Bid bar ( in case of a sell).

      Let me ask you differently: Are trading costs effectively taken into account by ninja by "trading on the Last" or is there the need to include a slippage to incorporate transaction costs? What are your recommendations?

      many thanks in advance and best regards

      Comment


        #4
        AlexL,

        Does your strategy include additional data series for the bid and ask data that you have imported?

        What I mean is, there will be a syntax of code that will let the strategy use Ask and Bid data as well, instead of just using the Last price.

        Example -
        Code:
        Add(Instrument, PeriodType.Minute, 1, MarketDataType.Ask);
        Add(Instrument, PeriodType.Mintue, 1, MarketDataType.Bid);
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RookieTrader, Today, 09:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by kulwinder73, Today, 10:31 AM
        0 responses
        8 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by terofs, Yesterday, 04:18 PM
        1 response
        24 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        8 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Working...
        X