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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          67 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          36 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          60 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          62 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X