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

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
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Ah! Thank you very, very much!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Rapine Heihei, Today, 08:19 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Rapine Heihei, Today, 08:25 PM
      0 responses
      5 views
      0 likes
      Last Post Rapine Heihei  
      Started by f.saeidi, Today, 08:01 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Rapine Heihei, Today, 07:51 PM
      0 responses
      6 views
      0 likes
      Last Post Rapine Heihei  
      Started by frslvr, 04-11-2024, 07:26 AM
      5 responses
      97 views
      1 like
      Last Post caryc123  
      Working...
      X