Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

currentbid and currentask question

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

    currentbid and currentask question

    hello,

    I know that if I refer to currentbid or currentask just at the begining of my conection to my datafeed before any new MD event type ask or type bid arrives, these properties will have as value the close of the prior bar.

    But, let's suppouse I create a new chart for ES 12-10 in the globex, and in the properties of this chart I set as SessionBegin 8:30, I know the globex session starts before than that time but I'm interested in price from that time on. If I am conected to my data feed before 8:30, with my chart active, no price action will be showed (no new bars) but, if in the first tick of the first bar I call currentbid or currentask, will I have the real bid or ask or I will get the close of the previous session?

    thanks in advance

    #2
    Hello telbental,

    It will no longer process OnBarUpdate() events if the session template excludes the current time.

    It will still receive updates via OnMarketData() or OnMarketDepth(). If you're accessing these values from there, then they will be current.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      so, lets say I create an indicator with a variable b and an override of OnMarketData like this:

      double b;

      public void OnMarketData(object s, MarketDataEventArgs e){
      if (e.Type==MarketDataType.Bid) b=e.Price;
      }

      if I create the chart for ES 12-10 and, as said before, in the properties of the chart I set the Session Begin at 8:30, and I am conected to my data feed and with the indicator added to that chart before 8:30. Can I be completely sure that in the first tick of the first bar of the sesion for my chart I will have in b the actual bid for ES 12-10?

      Comment


        #4
        Yes, you can setup a similar test now to confirm.

        Define a session template that ends prior to the current time. (12:00 PM Eastern Friday, for example)

        Add print statements to your OMD event.

        Apply your script to a chart with this session template applied.

        You should receive values updating as new prices arrive, even though the chart is outside the defined session boundry.

        It should work the same if you are getting OMD updates before the chart starts as well. If you test this sometime next week and it's not working the way you expect, please let us know.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          ok, thank you for your quick answer

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          344 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          557 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X