Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Finding previous closing price

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

    Finding previous closing price

    I would like to find the prior closing price at the end of the business day (4:15 PM EST) for the ES (or any instrument based on its business day closing time.) I am using a 24 hour session so the PriorDay OHLC will not work.

    I then want to draw a line from that bars close tick through to the opening of the next day as a reference point.

    I believe I can use the DrawLine function to draw the line and the Closes function to get the closing price. I am not sure how to accurately go back in time to the right time bar to get the price.

    Can you recommend something?

    Thank you,

    MiamiTom

    #2
    Hello,

    I assume you do know want a programming answer. There is not setting out-right for doing this. However you could produce something like this in the Strategy Wizard which will program it for you:


    Or you could temporarily change the session times, look at the proper price, then change your sessions back and draw the line.
    DenNinjaTrader Customer Service

    Comment


      #3
      Hello,

      Yes I am looking to build a simple indicator to plot this line.

      Tom

      Comment


        #4
        Hello MiamiTom,

        Yes – you can program this in NinjaScript. NinjaScript is NinjaTrader's extension to the powerful Microsoft C# language. In addition to the core functionality of C# and the Microsoft .NET framework we have added features designed for the rapid implementation of custom indicators, automated trading systems and custom drawing.

        This link will take you to the NinjaScript section of our Help Guide:


        If you’re not a programmer & your indicators &/or strategies become more complex, you can check out this link for a list of NinjaScript consultants.


        We also encourage you to search our Free NinjaScript File Sharing Section. There is a large community of programmers & traders that you can share ideas with & ask questions. Just follow this link:


        Please let me know if I can answer any additional questions.
        ChipNinjaTrader Customer Service

        Comment


          #5
          Chip,

          This should be a simple indicator to develop without having to go through the NinjaScript.

          How can I get the closing price at an earlier time without counting back the bars? Is there a search function to the DataTime series function? Or is there a for loop function that will iterate me back checking for the time I want and then use the Closes function to get the price?

          Thank you,

          Tom

          Comment


            #6
            Hello MiamiTom,

            All indicators are developed with NinjaScript. The only indicator we have that works closely to what you want is the PriorDayOHLC indicator. You may consider supplementing your feed with provider that offers daily historical data. The "close" price of this feed will then typically be the settlement close you're looking for. See below for a list of our providers and the level of data supported.
            Click here to view more information on Historical Data

            For a programming solution you can use GetBar() to return the number of bars since the specified DateTime.

            A reference sample illustrating the use of this is available at the link below.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Today, 06:40 PM
            0 responses
            9 views
            0 likes
            Last Post algospoke  
            Started by maybeimnotrader, Today, 05:46 PM
            0 responses
            7 views
            0 likes
            Last Post maybeimnotrader  
            Started by quantismo, Today, 05:13 PM
            0 responses
            7 views
            0 likes
            Last Post quantismo  
            Started by AttiM, 02-14-2024, 05:20 PM
            8 responses
            168 views
            0 likes
            Last Post jeronymite  
            Started by cre8able, Today, 04:22 PM
            0 responses
            10 views
            0 likes
            Last Post cre8able  
            Working...
            X