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.
Been there in this topic: https://www.prorealcode.com/topic/trendline-une-approche-du-trading/
Challenge is to find the best relevant top and bottom with a code, that’s easier with your own eyes 🙂
Thats really interesting Nicolas. How can i call the lines in my buy/sell code?
You can’t, these lines are graphical. You can calculate the affine function between the 2 fractals points (y=ax+b) and check if the line is crossed, et voilà !
Some valuable codes in this topic: https://www.prorealcode.com/topic/pseudo-triangle-trading-system-5-min-using-volume-and-volatity/
I remember have coded somewhere a snippet to check for oblique breakout, must be somewhere … but I can’t find it for now.
EDIT: another example here: https://www.prorealcode.com/topic/how-can-i-code-a-line-x1y1x2y2/#post-87360