Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get Last price on Bid datatype chart

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

    How to get Last price on Bid datatype chart

    Hellow everyone!

    How to get Last price on Bid datatype chart. For bid there is GetCurrentBid(), for ask there is GetCurrentAsk(). And for such a function is not last price.

    I try this:

    Add(instrument, PeriodType.Minute, 1, MarketDataType.Last);
    ...
    price = Closes[1][0]; //--- Try to take last price

    And this dont work.

    Thanks for help!

    #2
    Hello Pirat, you can work with Close[0] in the OnBarUpdate() provided CalculateOnBarClose is set to false for the script.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hello Pirat, you can work with Close[0] in the OnBarUpdate() provided CalculateOnBarClose is set to false for the script.
      On Bid chart? I need this for bid chart.

      Comment


        #4
        Sorry Pirat, here you could either access the price in OnMarketData() - http://www.ninjatrader.com/support/h...marketdata.htm

        or Add() the Last series like you've attempted to already.

        Do you get any errors when the study is then run? You would need to check for those in NT's Log tab (right most tab in the Control Center).

        Also: which instrument do you work on? Does it have a last price then? Or would it be just the bid as usual for FX spot markets?

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Sorry Pirat, here you could either access the price in OnMarketData() - http://www.ninjatrader.com/support/h...marketdata.htm

          or Add() the Last series like you've attempted to already.

          Do you get any errors when the study is then run? You would need to check for those in NT's Log tab (right most tab in the Control Center).

          Also: which instrument do you work on? Does it have a last price then? Or would it be just the bid as usual for FX spot markets?
          Ok, thanks for help. I already fix my problem.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          60 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          145 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          161 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          97 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          283 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X