Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modify Prior Day OHLC Indicator

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

    Modify Prior Day OHLC Indicator

    Hi All, I would like to modify the Prior Day OHLC to plot OHLC from 2 days ago. I tried replacing the [0]s in the ninjascript for the original indicator with [1]s or [-1]s but it didn't work. Anyone have any ideas on how to achieve this?

    Thank you,
    tf

    #2
    Hi tf001, thanks for posting. The indicator can be changed to use the prior days without the need for the session iterator and just add a 1 day series. I attached an example.

    Kind regards,
    -ChrisL
    Attached Files
    Last edited by NinjaTrader_ChrisL; 06-16-2022, 09:05 AM.

    Comment


      #3
      Thank you Chris for your response and example. I am new to ninjatrader and not well well versed with ninjascript. I tried your example indicator and see that the calculations are not as expected ( the 2 day ago OHLC on todays chart should line up with PriorDayOHLC on yesterdays chart, but they don't).
      Would you know why that's happening?

      Comment


        #4
        Hi tf001, I had the indexing wrong and I also added a BarsInProgress check:

        Comment


          #5
          Thank you Chris, that fixed it. This indicator only gets plotted on the current day chart, is it possible to have it plotted on the previous days as well (like the original indicator)?

          Comment


            #6
            Hi tf001, just add more days to the primary data series. It should populate the rest of the chart once there are more days.

            Kind regards,
            -ChrisL

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            647 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X