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 samish18, Yesterday, 08:31 AM
        2 responses
        8 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by Mestor, 03-10-2023, 01:50 AM
        16 responses
        389 views
        0 likes
        Last Post z.franck  
        Started by rtwave, 04-12-2024, 09:30 AM
        4 responses
        31 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by yertle, Yesterday, 08:38 AM
        7 responses
        29 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        23 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Working...
        X