Hello everyone,
When trading manually, we can easily visually identify the breakout/breakdown of a consolidation. This consolidation may last n bars, never the same period.
However, for Automated Trading, I was not able to code properly the upper and lower limits of a range, where by definition the period “n” is a variable. Intuitively, I’m suspecting Arrays would be helpful but I failed to write a code which works.
The idea is to identify the upper and low limits of the range (in the boxes in the screenshot). If anyone can please help writing this code or if you can direct me to a link where this code is available on this forum.
Many thanks