Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjascript - retrieve yesterday's settlement price

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

    Ninjascript - retrieve yesterday's settlement price

    In an intraday chart indicator, I need to retrieve yesterday's settlement price.

    The Pivots indicator has the ability to do this, and rather than reinvent the wheel I wondered if there is a way by calling this indicator programatically, or by some other exposed value elsewhere, that I can retrieve the value I'm looking for.

    #2
    Josh,

    There are not any exposed methods for doing so from the Pivots indicator.

    You could use the Add() method to get the Daily series input and then use Closes[1][1] to access this value from IQFeed.

    If you would rather not use the Add() method, you would have to duplicate the DailyBars logic in the pivot indicator, create a copy of the Pivots and expose the values you are after.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Matthew View Post
      Josh,

      There are not any exposed methods for doing so from the Pivots indicator.

      You could use the Add() method to get the Daily series input and then use Closes[1][1] to access this value from IQFeed.

      If you would rather not use the Add() method, you would have to duplicate the DailyBars logic in the pivot indicator, create a copy of the Pivots and expose the values you are after.
      Thanks Matthew, I did use the Add() method and it was quite easy, compared with other messy logic, as long as it does as I expect

      Comment


        #4
        The Add() method has two restrictions when applied to daily bars:

        -> it does not insert the daily bars correclty, if you use a session template with subsessions
        -> you cannot load daily data from the period prior to the first day for which chart data is loaded

        Both can be achieved with the approach shown for the Pivots indicator. However, the pivot indicator can not be called from a strategy or another indicator, when set to daily bars and when connected to a datafeed.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        563 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        329 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
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X