Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 helpwanted, Today, 03:06 AM
        1 response
        5 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        7 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X