Are 'Slope' and the 'Angle on charts the same thing / quantity?

 
If a chart is locked at a 1 to 1 ratio, is the angle of the line between the closing of 2 adjacent bars, isn't the 'slope' the same thing as the angle of it?
 

Depends on what definition of slope u r using... There's a lot of info on the angle/slope subject in the forums. See the following:

https://www.mql5.com/en/forum/118563

https://www.mql5.com/en/forum/121563

https://www.mql5.com/en/forum/122852

 
gordon wrote >>

Depends on what definition of slope u r using... There's a lot of info on the angle/slope subject in the forums. See the following:

Hi gordon,

I'm aware there are a number of factors that influence this, which is why I specified that the chart is locked at a 1:1 ratio and the line in question is drawn from the closing price of two adjacent bars. With the slope and angle measurement both being of this exact same line.

I guess what I am really asking is a question of mathematics: Is taking the difference in closing prices and dividing them by the difference in time the same as then using this same information to calculate the angle with trigonometry?

Then the question becomes which one is more suited for usage in MQL4 EAs, Included or Library files?

 
FourX:
If a chart is locked at a 1 to 1 ratio, is the angle of the line between the closing of 2 adjacent bars, isn't the 'slope' the same thing as the angle of it?

Hi FourX


Mathematically, angle has no meaning on a graph where the axes have different units, in this case price and time. If you want meaningful values use slope.

If you are interested in the visual angle then you have to think of it in terms of the angle whose tangent is vertical pixels / horizontal pixels. Of couse, this is useless for trading.

I'm not sure how technical to be, but angles are unit-less quantities and can only be calculated using variables that have the same units. For example, 5 ft forwards followed by 5 ft left is the same as 7.07 ft at an angle of 45 degrees - makes sense. However, 5 ft forwards then 5 minutes left means what?

In this case, slope has units of price/time (or points/time) and it stays the same regardless of scale of the axes. If you have a line with a of slope 10 points per bar then drag the scale, the visible angle changes but the value of the slope stays the same, i.e. 10 points / bar.

If you want to calculate anything from it, use the slope. An added benefit is that trigonometry is then not required. ;-)


Cheers

Jellybean
 

Jellybean wrote >>

However, 5 ft forwards then 5 minutes left means what?

... bending space-time ;-)

 
FourX:

Hi gordon,

I'm aware there are a number of factors that influence this, which is why I specified that the chart is locked at a 1:1 ratio and the line in question is drawn from the closing price of two adjacent bars. With the slope and angle measurement both being of this exact same line.

I guess what I am really asking is a question of mathematics: Is taking the difference in closing prices and dividing them by the difference in time the same as then using this same information to calculate the angle with trigonometry?

Then the question becomes which one is more suited for usage in MQL4 EAs, Included or Library files?

The classic definition is


Where delta y and x are changes in the coordinates. So this definition gives u a way to calculate the angle. Problem is you are talking about measuring the angle from a graph, but this graph can be drawn in many ways... It does not help that u would have it on a 1:1 scale. It would look differently even on different monitors. But again - you can simply calculate the angle and then use it if you feel like it. But attempting any kind of measurement will lead to disaster.

 
Jellybean wrote >>

Mathematically, angle has no meaning on a graph where the axes have different units, in this case price and time. If you want meaningful values use slope.

Hmm JB & others

I can't say that I agree with the specific statment quoted above. Though I suppose one could have the same type of data on the different axis. in most cases this would be useless and meaningless. Charts almost always have different information of different axis, unless one is talking about a 1 dimensional axis. The power of charts is that it gives a visual representation of the different effects or outcomes of the variations and interrelationship between 2 or even 3 types of data (on a 3 axis chart). An example on a 2 axis where one is comparing price versus quantity where the more you buy of something the cheaper it gets. Lots of conflicting info here. I guess that slope and angel are really just different representation of the same thing on 2 axis where the angle is just the slope converted into an angle.

On the matter of scaling of the charts, this brings up the question if one is using data on a 2 dimensional chart, is the EA going to just use the mathematical data, or take the information from the chart which is obviously going to change unless the X & Y are both changed the same amount, Which is really just zooming in or out on the chart.

If one is using data points, then those are fixed points, so as I said, I guess the real question is going to be are the calculations in an EA going to utilize the pure mathematical points or is it going to take the information from the chart, which IS using the same data points, but if the scale changes from 1:1 to 2:1 and the EA is utilizing that then it is going to change both the slope and angle very significantly.

Again so I guess the real question is for the same data set, if strictly utilizing the data set, it isn’t going to change regardless of the scaling of the chart. But if the EA does take the info from the chart, then the scaling if going to have a very significant difference.

It looks like that this is the really important question: will scaling the chart which is going to cause errors because this is where the EA is taking the info from or is it using the data set which will be accurate regardless of the represnatation on the chart due to scaling.

So which is MQL4 going to use for calculations? The data or the chart ?

 
Jellybean wrote >>

Hi FourX

Mathematically, angle has no meaning on a graph where the axes have different units, in this case price and time. If you want meaningful values use slope.

Correcting myself here. Rereading your posting, you are talking about the different units of measurement and not using the same sat on both axis. Obviously what one picks for the increments on each axis is going to change the slope and the angle significantly. This becomes relevant especially if one wants to compare different charts of the same type of data. Unless all of the charts utilize the same scales and increments, trying to compare them would be erroneous and meaningless.

Like I said what really seems to be the crucial question is what will an EA use for calculations: the data points or take the info from the chart which makes scaling very significant?

?
 

FourX

mmm... I am starting to see that people say angle when they mean slope. I'll just have to let this go, I think.

Anyway, the EA and the chart both use the same data. The chart is just a presentation of the data to help us poor humans see what's going on. The chart scaling has no effect on any EA.

Cheers

Jellybean

 
Jellybean wrote >>

FourX

mmm... I am starting to see that people say angle when they mean slope. I'll just have to let this go, I think.

Anyway, the EA and the chart both use the same data. The chart is just a presentation of the data to help us poor humans see what's going on. The chart scaling has no effect on any EA.

Cheers

Jellybean

Hi JellyBean,

I agree that slope and angle are really just a different way of expressing the same thing. As you say, charts give us a visual representation that allows us to see and understand the implications of the data sets and what it means.

How confident are you that the EA is going to use the data set and not take the info from the chart instead ?

 
Using angle or slope is interchangeable since there is a simple and well defined conversion method between the two... The important thing is to be consistent in the units or scale used in the chart/data when calculating the slope (or angle). As long as u r consistent then either angle or slope can be used as representing the rate of change in the graph (or in the data).
Reason: