Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plots previous day's open instead of current open

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

    Plots previous day's open instead of current open

    Hello. Please see attached multi time frame indicator--the intent is to plot a "+" across the entire session
    to indicate the developing daily bar's open; however, it is plotting the previous day's open (or previous session open) despite calculateonbarclose being set to false from within the code and from the parameters window.

    Thank you in advance for taking the time the look at the code.
    Attached Files

    #2
    Hello shipolito,

    Thanks for your post.

    In a multiseries script this is expected behavior when looking at historical data. The indicator does not process the historical data on a tick by tick basis, all it knows are the Open, High, Low and Close of the bar and thus historical data is processed as if CalculateOnBarClose=true. With that in mind then as your indicator loads, the only data it has is the open of the day before. It is only when the indicator connects with realtime data that it can then operate in the CalculateOnbarClose = false mode and at that point you should expect to see the "+" shift to the current days open. See attached example.

    The bar references in multiseries scripts are well explained in the helpguide here: http://www.ninjatrader.com/support/h...nstruments.htm specifically the section: How Bar Data is Referenced

    As an alternative, you can use the standard indicator CurrentDayOHL. You can selectively show which of the 3 lines (Open, High, Low) to plot.
    Attached Files

    Comment


      #3
      Ah! Thank you very, very much!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      83 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      45 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      65 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      57 views
      0 likes
      Last Post CarlTrading  
      Working...
      X