I’m working on a function to detect untested swing highs and lows in my EA. So far, I’ve written two functions that find recent swing points by identifying highs and lows over a set number of bars:
Note that
xBars variable is x number of bars to the left.
barsN variable is the number of bars to the left and right of the swing.
While these functions are able to detect swing points, they don’t account for whether these levels have been retested by the price after their formation. I want to refine this logic so that it only identifies untested swing highs and lows.
Any suggestions on how to approach this or improve the detection of untested levels?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I’m working on a function to detect untested swing highs and lows in my EA. So far, I’ve written two functions that find recent swing points by identifying highs and lows over a set number of bars:
While these functions are able to detect swing points, they don’t account for whether these levels have been retested by the price after their formation. I want to refine this logic so that it only identifies untested swing highs and lows.
Any suggestions on how to approach this or improve the detection of untested levels?