Hi,
Please, anyone could help how we define in coding the previous local high, and local low?
I’d like to code to exit a long trade when price exceeds the previous local high (we do not exactly know, how many bars we’ve had since then), and
stop, when price goes below the previous local low
Thank you!
George
You must define your local high/low better. Is it maybe the highest/lowest of the last X bars? That for example is easy to code.