Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculate on bar close problems

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

    Calculate on bar close problems

    I am plotting the ZigZag indicator, and I have "calculate on bar close" to false, but it will not update in real time until the close of the current bar. Ideas/help?

    #2
    Hello,

    The ZigZag indicator overrides the default functionality of the Calculate on bar close feature such that it always calculates at the close of the bar.

    Unfortunately you would have to do some custom coding if you wish to modify this.

    If you are familiar with NinjaScript, this can be viewed around line 348 of the indicator. However it will likely require additional changes in the code to ensure it still functions as desired.

    Please let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      I am not familiar with NS at this point. So line 348 states:

      IsValidPlot(Bars.Count - 1 + (CalculateOnBarClose ? -1 : 0)); // make sure indicator is calculated until last (existing) bar

      Can I change anything here without other coding to make it not calculate on bar close?

      Comment


        #4
        Hello,

        Unfortunately this is getting into unsupported territory and I am not familiar with the full functionality and coding of this indicator.

        From my first glance it looks as though removing this code could cause errors in the plot functionality for this indicator.

        You are welcome to create a duplicate indicator and test this out however we would not be able to provide you with debugging support on this process.

        If you have limited time or programming capabilities, you can discuss your requirements with any of our certified NinjaScript consultants.
        Click here for a list of certified NinjaScript Consultants

        There is a also a growing library of user submitted custom indicators (100+) that can be downloaded from our support form. Please look in the NinjaScript File Sharing section of our support forum as you may find what you are looking for there.

        Please let me know if I can be of further assistance.
        LanceNinjaTrader Customer Service

        Comment


          #5
          OK, I made a duplicate indicator to play around with, but how do I load that onto a chart? (the duplicate is not listed under the indicators)

          Comment


            #6
            Hello,

            I attached a duplicate with a different name that you can put into (MY) Documents\NinjaTrader 7\bin\Custom\Indicator

            You once you add this you will be able to edit it and make changes as desired.

            For future reference you will need to ensure all naming within the indicator has been changed to a new name such as MyZigZag.

            Once this has been done compile your indicator by pressing F5 in the editor. Once it properly compiles you will be able to make.


            Please let me know if I can be of further assistance.
            Attached Files
            LanceNinjaTrader Customer Service

            Comment


              #7
              Thanks Lance. I took out that line and error on compiling. I may have to hire someone to tweak it, but thanks for your help!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              71 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              43 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              25 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              28 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              56 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X