Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with CalculateOnBarClose and SwingHighBar method

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

    Issue with CalculateOnBarClose and SwingHighBar method

    Hello,

    I'm running beta version 12 of NT 7, and I found a problem with the SwingHighBar and SwingLowBar methods of the Swing indicator.

    I'm testing those methods with a simple indicator (see attached) called "TestSwingHighBar". It draws a down arrow at the relative bar returned by a call to SwingHighBar.

    The problem occurs when I change the test indicator from CalculateOnBarClose from True to False...it prints a double arrow showing that SwingHighBar is returning erroneous values.

    I've found the solution to this problem would be to change the Swing indicator by removing the explicit initialization of "CalculateOnBarClose = true" statement. If you take that statement out, then the problem goes away.

    Here's a short screencapture video which illustrates the situation.
    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    Let me know if you have any questions!
    Attached Files

    #2
    Thanks sbgtrading - we're taking a look into.

    Comment


      #3
      Please try this - save a copy of the Swing indicator you reference and comment out COBC statement from it's Initialize(), then reference this modded Swing indicator in your test indicator and also comment out it's COBC line. Then only set this via the UI as you apply it, does it work as you would expect now?

      Thanks

      Comment


        #4
        Yes...that is how I arrived at my suggestion for fixing the situation. I created a test copy of the Swing indicator and removed the explicit initialization of CalculateOnBarClose. This fixed the problem.

        So wouldn't Ninja want to consider fixing the Swing indicator in the same manner?

        Comment


          #5
          Ben, yes thanks for spotting this one - I forwarded it to to fix the Swing indicator by removing COBC.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          626 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          359 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          562 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          567 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X