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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          666 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          377 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          575 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X