Chart aspect ratio / calculating angles #726
-
Hello, I'm trying to calculate the angles of the EMA50 / EMA20 etc. Just using the deltax and deltay as shown below. That kind of works, but i'm running into troubles because of the (aspect)ratio of crypto charts. A lot is depending on a proper alignment of the x-axis (date) and y-axis (price). In tradingview it is possible to propertly "lock" (not sure if that is the right word) the aspect ratio for use of the "Gan Fan"). Any idea's how to calculate the aspect ratio or how such can be done (or how tradingview calculates it?)? Thanks, //(0,0) -> (10,10) //(0,0) -> (10,5) double resultDiff = angle1 - angle2; |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You can explore Slope. This uses a Linear Regression best-fit line approach (could be over 2 periods). If you recall the formula, |
Beta Was this translation helpful? Give feedback.
-
I’m looking at Gan Fan and am confused by it. It seems to be irrational since it bases it’s thinking on one unit up and one unit over is 45* angle, but fails to define one unit up in any consistent way. $1 up is very different between a $5 price and a $500 price and 1% isn’t any better. For this to make sense, both x and y axis would need to be using the same units. |
Beta Was this translation helpful? Give feedback.
I’m looking at Gan Fan and am confused by it. It seems to be irrational since it bases it’s thinking on one unit up and one unit over is 45* angle, but fails to define one unit up in any consistent way. $1 up is very different between a $5 price and a $500 price and 1% isn’t any better. For this to make sense, both x and y axis would need to be using the same units.