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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          168 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          322 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          246 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          350 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          179 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X