Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Premarket GetCurrentBid() GetCurrentAsk()

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

    Premarket GetCurrentBid() GetCurrentAsk()

    [IMG]file:///C:/DOCUME%7E1/Benutzer/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG]I have a problem with the Bid/Ask prices in the premarket phase.

    I try to scan for gappers during the premarket phase. if you look at the attachment you can see, that in the marketAnalyzer is a valid Bid/AskPrice.

    If I want to get access of the bid/askPrice in an Indicator the GetCurrentBid() and GetCurrentAsk() are delivering another value like the MarketAnalyzer.

    Then I found out, that there exists a MarketData-member, where the prices are correct. But when the the indicator is used in the MarketAnalyzer the MarketData-member is null ... and the GetCurrentBid() and GetCurrentAsk() are delivering again the wrong values

    does anybody know how I could get access to the right Bid/Ask values in the MarketAnalyzer during the premarket phase?

    Many thanks for you help in advance.


    #2
    Please provide the line of code you are using for your print statement and in which method it was placed in. Thank you.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh

      Thank you for your quick reply ... here is the code line.

      This problem only occures in the premarket phase - if you try it during market hours the values are correct

      if ( MarketData != null )
      Print ( Instrument.MasterInstrument.Name + "; GetCurrentAsk(): " + GetCurrentAsk() + "; GetCurrentBid(): " + GetCurrentBid()
      + "; MarketData.Bid.Price: " + MarketData.Bid.Price + "; MarketData.Ask.Price: " + MarketData.Ask.Price
      + "; " + Time[0].Year + "." + Time[0].Month + "." + Time[0].Day );

      Comment


        #4
        oops .. this call happens in the OnBarUpdate()-event

        Comment


          #5
          Can you please try this inside OnMarketData and use the MarketDataEventArgs?
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            OK - thank you for this hint - since the market is running now I will try it tomorow

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            576 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            553 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X