Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 inanazsocial, Today, 01:15 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by rocketman7, Today, 02:12 AM
          0 responses
          10 views
          0 likes
          Last Post rocketman7  
          Started by dustydbayer, Today, 01:59 AM
          0 responses
          1 view
          0 likes
          Last Post dustydbayer  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          5 responses
          23 views
          0 likes
          Last Post trilliantrader  
          Started by Davidtowleii, Today, 12:15 AM
          0 responses
          3 views
          0 likes
          Last Post Davidtowleii  
          Working...
          X