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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        85 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        47 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        29 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        67 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X