Login Page - Create Account

Support Board


Date/Time: Fri, 04 Jul 2025 22:11:18 +0000



Post From: Found a bug in an included study

[2020-08-01 04:32:17]
ruiyt - Posts: 11
In the "Swing High And Low" study, with the option "Extend Swings Until Future Intersection" enabled. When a new candle is still forming and a swing low or swing high condition is temporarily met, a "line until future intersection" will be drawn. However, when that same candle makes a move that no longer satify the swing high or swing low condition, the lines are still left behind. If you observe the behaviour of the arrows, which indicate a swing high or swing low, the behaviour is correct in that the arrows will disappear when the condition changes.

I looked at the source code of the study and determined that there is a simple fix for the problem. You just need to add the following code to delete the line upon every evaluation like so

  sc.DeleteLineUntilFutureIntersection(indexToEvaluate, 1);
  sc.DeleteLineUntilFutureIntersection(indexToEvaluate, 2);
and put this code block right below

  Subgraph_SwingHigh[IndexToEvaluate] = 0;
  Subgraph_SwingLow[IndexToEvaluate] = 0;
which resets the arrows every time.

You are welcome.