Hello, so i was wondering if this has been done before, and i need some help coding it.
I made a picture showing what im thinking about.
The idea is to find support and resistance using the highest high and lowest low, calculate the angle and draw a support/resistance line.
To find the angle i was thinking you first need 2 data points for higher high and lower low, then calculate the angle of the support/resistance line between those two points and just extend that “into the future”. Edit: Maybe you dont need to calculate the angle, easier to maybe just draw a line between them and extend that line?
The lookback period i think would be interesting to experiment with. For this spesific picture, if i was to curvefit for it, i think it would look like this: highest[2000](high[1400]) and highest[900](high[300]) and obviously should be possible to change the lookback periods.
The goal is to make money from either reverting the trend or buying a breakout.