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

Partial Calculate On Bar Close

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

    Partial Calculate On Bar Close

    I've developed an indicator that has several plots. For the most part I want the indicator plots to update real-time (Claculate on Bar Close = False). But there are certain aspects of the plot that I want updated only on the close of the bar.

    Tradestation's EL does this by determining if the incoming tick is occuring WITHIN the bar or on the CLOSE of the bar. Is NinjaScript capable of determining such conditions? If so, how would I set this up as an if/then condition?

    Thank you in advance.

    Bob

    #2
    Bob,

    The closing of a bar is the same event as the opening of a new bar. You can check for this by doing if (FirstTickOfBar). When you are receiving the first tick of a bar, the previous tick was the last tick of the prior bar and that means accessing Open[1], Close[1], etc. would be for the just closed bar.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by TrendTracker View Post
      I've developed an indicator that has several plots. For the most part I want the indicator plots to update real-time (Claculate on Bar Close = False). But there are certain aspects of the plot that I want updated only on the close of the bar.

      Tradestation's EL does this by determining if the incoming tick is occuring WITHIN the bar or on the CLOSE of the bar. Is NinjaScript capable of determining such conditions? If so, how would I set this up as an if/then condition?

      Thank you in advance.

      Bob
      Bob,

      If you want some lines updated continously and other lines updated at bar close, place two instances of the same indicator in the same panel.

      Make one calculate on bar close to false, the other to true.

      Change color to invisible what you dont want to see on each instance.

      If you want to do this in a strategy, you need to build seperate unique versions of the indicator.

      If this configuration is what you are looking for, be sure to save it as a template so you don't have to rebuild it every time.

      Good Luck,

      RJay
      Last edited by RJay; 06-04-2009, 07:39 AM.
      RJay
      NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by gravdigaz6, Today, 11:40 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by MarianApalaghiei, Today, 10:49 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by XXtrader, Today, 11:30 PM
      0 responses
      4 views
      0 likes
      Last Post XXtrader  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      9 views
      0 likes
      Last Post funk10101  
      Working...
      X