Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use Ask/Bid prices for historical backtesting

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

    How to use Ask/Bid prices for historical backtesting

    Hi,

    I have recording of Ask/Bid/Last ticks for several instruments.
    I saw that I can load them directly through the Historical Data Manager and to choose the correct Data Type.
    How can I use this in my backtest? GetCurrentBid() only works in realtime...
    How can I have access to the bid ask data I loaded to the instrument?

    Thanks,
    Roy

    #2
    Hello freewind,

    Yes, you can use ask or bid data by configuring 'Price based on', see screenshot.
    Attached Files
    JasonNinjaTrader Customer Service

    Comment


      #3
      Yes, but if within my script I want to access the bid ask prices, how can I do it?

      Comment


        #4
        Hello Roy,
        You can create a multi series code to add the bid/ask series.

        Please refer to our help guide to know more about multi series concepts


        A sample code to add the ask series for example will be like

        Code:
        protected override void Initialize()
        {
        Add("ES 12-12", PeriodType.Minute, 1, MarketDataType.Ask);
        //rest of the codes
        }
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Thanks Joydeep.
          Then I can access this stream BIP.

          I think as an improvement and feature idea you should incorporate in GetCurrentAsk() so there will be minimal changes between backtesting and production versions.

          Comment


            #6
            Hello Roy,
            Yes, you can access it via BIP.

            I will forward your feature request to development for future consideration.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by usazencortex, Today, 12:43 AM
            0 responses
            5 views
            0 likes
            Last Post usazencortex  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,265 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X