PDA

View Full Version : Issue with CalculateOnBarClose and SwingHighBar method


sbgtrading
03-28-2010, 03:22 PM
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.
http://screencast.com/t/M2VmZjIw

Let me know if you have any questions!

NinjaTrader_Bertrand
03-29-2010, 05:18 AM
Thanks sbgtrading - we're taking a look into.

NinjaTrader_Bertrand
03-29-2010, 05:26 AM
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

sbgtrading
03-29-2010, 08:01 AM
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?

NinjaTrader_Bertrand
03-29-2010, 08:07 AM
Ben, yes thanks for spotting this one - I forwarded it to to fix the Swing indicator by removing COBC.