How to calculate degree ? - page 2

 
SDC: You are denying what is right in front of your face.
  1. You are denying reality.
  2. Taking your Wikipedia m = (y-y0)/(x-x0) that is the length (some unit) / length (same unit) the units cancel. Now you can take the arcTan(m), because m is a pure number. arctan(12) ~ 85.2o but the arctan(12 mph) is meaningless.
  3. Taking your chart. Supposed the market rises 50 pips in one hour. On the one hour chart your line is vertical. On the 15 minutes chart the line is 45. On the 1 minute chart the line is almost horizontal. How can the same movement in the same time have different angles? Answer the question.
 

1) You must not have tested the script I posted.

2) The angle is being used in a geometric sense, not in an engineering sense. The data types used to create the chart are not relevent to the math subsequently applied to that chart.

3) Because the charts are different charts constructed using different algorithms so of course they are different.

 
I"s very useful .
 

Angulo=MathArctan((Close[0]-Close[Periodo])/Pipactual/Periodo*unit)*57.29577951;

57.29577951= 180/3.1415  

unit  will be the measure in pips that you think  the "distance" between one candle the other is!!!-

you see what i am saying?---time can not be measure in pips, but you can try....I did it and it serves my purpose.

this is getting very subjective!!!---visually in my chart for 1M, I gave it  unit=5  (pips) = 1Min. 


It will need a different code for a differente timeframe.
 

I found this discussion very enlightening, actually, so thanks for that.

Whilst it may not be strictly "mathematically sound" and either position could be correct, my purpose for needing this snippet of code is to simply create a way to measure the slope degree of a line starting at 0 degrees (much like a standard protractor), with the mid point of the line being the centre of gravity (e.g. a 30-period trend line has a mid point of 15 periods).

I will then use this to gauge the direction and basically the acceleration/decelleration of a trend. i.e. is the trend getting steeper (breakout) or flattening (people losing interest/taking profits), much like an altimeter in an aircraft. I basically only want to know how much a line is pivoting from it's horizon line in degrees, therefore, are we going up or down.

Whilst I agree that different timeframes may show different gradients based on two fixed points in time and that the scale of the chart affects the gradient when using fixed points that move when switching timeframes and zooming in/out, thouh this becomes irrelevant when using a line more as a free-standing altimeter/ROC/ROD type of arrangement to attribute flatness/steepness of a gradient against volume and directionality of trend.

If a line is horizontal, the market is trading side-ways. If it's going from bottom left to top right it's trending up and top left to bottom right, it's downtrending.

Anything that's between 0 and 45 degrees (y=0 degrees) is a steep trend up. 46 to 90 is a gentle trend up, 91 and 135 gentle downtrend, and 136 to 180 degrees the trend is steep decline.

I'm sure most people that went through the GFC or have ridden a big short down whilst in a long position would have liked to have known their "altitude"...

The mathematics is actually perfect as a filter for use with other indicators to simply gauge the "direction" of the market. Used with Bollinger Bands it can be a great way of assisting with finding the bottoms and tops of trends, especially when used with volume. i.e. the trend is coming to an end when the volume has dropped and the gradient line is reaching horizontal, much like a see-saw.

The way I see it is that if you can simply pick the direction of the market with reliability every day (on any timeframe), you will be a successful trader, all the fancy coloured indicators aside.