English

## How to calculate the absolute angle of the 'Line' Chart both in real time and for previous points and ranges in the chart ?

 256 DougRH4x 2009.10.31 19:54   Hi, The subject line pretty well covers it: I am trying to figure out how to calculate the absolute Angle/Slope of the actual 'Line' of Line Charts as opposed to the CandleSticks or Bar charts: both in real time on every tick as well as being able to specify the number of ticks or to calculate the slope between the trade closing prices in the various time frames Likewise to provide the absolute angle for any given prior point or range of the charts. I need it to be 'absolute' at all times as opposed to the slope being changed by the scaling of the chart or the aspect ratio of the monitor. I wonder if there is actually a data feed for this variable directly from the broker as it is one of the 3 standard currency pair indicators that are on all (MQ) charts? . . (8 >) Thanks to all who are able to assist me with this (< 8) . PS: If anyone knows how to calculate the exact angle of the Line in the line charts ahead of the current moment in time, well then .. . LoL similar
 256 DougRH4x 2009.11.01 20:22 #   CloudBreaker: Trend Slope Retracement is what I think you are looking for. . Likewise thanks for the info on the ‘Trend Slope Retracement’ I’ll look into it. I assume that this is a MQL4 function. Do you know if it is ‘absolute’ in the sense that it will return the actual slope accurately regardless of the scaling of the chart or the aspect ratio of the monitor? If not, then I would need to know that info and recalculate the absolute correct angle from it. This would significantly increase the load on the computer which I already have concerns about without having to compensate for these ‘error inducing factors’. Though I suppose I would only have to calculate it once for each chart and then use this factor to correct it. The downfall of this approach is that I would think that the ‘scaling’ of charts changes dynamically to suit the current existing conditions. I’m not concerned about the slope appearing correctly in a chart, but want the correct value to utilize in further calculations, functions, operations and conclusions. One thought I had on this was that if I was unable to find a function to do this was to use a moving average indicator with a time period of 1 with no offset and utilizing a simple curve with the closing value. This exactly follows the ‘line’ in the ‘Line’ chart mode. But this approach would also suffer from the error inducing factors of chart scaling and monitor aspect ratio. Though I would like to use the ‘tick by tick’ time frame this approach may put too much of a load on the computer and bog it down to the point where it is useless, especially as I want to use it on 15 or 20 charts simultaneously. CB: Thought I'd seen a post from DougRH4x regarding FXigor, but may be losing the plot. In my search of MQL4 on this subject, I found one where either Phy I believe it was, who has over 1200 postings so trying to find it again by that route is a formidable task; or tt might have been NakedBear, but I don’t think it was him. I hope he has grown at least some fur for winter (< 8) Whoever it was they posted a short bit of code in response to a similar question but I am unable to find it again. As I said in my initial posting on this subject that I strongly suspect that as it is one of three possibilities for chart illustration, that there must be a constant streaming data flow from the brokers, which is then calculated by MT to write to the chart in the mode that the user selects. Thus this functionality must be part of the MT4 client code. The question is what that streaming data flow is and how to access it as directly as possible and utilize it. similar
 256 DougRH4x 2009.11.02 18:15 #   Hi CloudBreaker, I found the articles on the wWw about ‘Trend Slope Retracement’ by FxIgor and I agree with you that is probably what the reference to TSR (https://forum.mql4.com/27156) was that I found in my search for ‘How to calculate the absolute angle of the 'Line' Chart both in real time and for previous points and ranges in the chart ? == https://forum.mql4.com/27152 . I erroneously made that assumption that the info you gave me on TSR was for the calculation of the absolute angle. . Ah communication at its finest LoL I’m guilty of making that incorrect assumption, and I’m sure you know the clique about making assumptions. Well I got caught out by it. . But that still leaves me with the qundry about how to find the Abolute angle of the 'Line' in Line Charts. . Thanks for the info and TTFN (TaTa for Now (< 8) similar
 256 DougRH4x 2009.11.04 17:22 #   So no help on this one ?
 1936 BarrowBoy 2009.11.04 17:52 #   D You can always derive the angle quite simply, but for it to be 'absolute' requires a fixed baseline, probably using minutes The calculation is thus time (as a constant number of minutes) as the base of a triangle, the 'opposite' (i.e. vertical) side of the triangle calculated as price-change (up or down) in that time You now have opposite/adjacent giving you the tangent ratio and hence the angle (if you really want it) On similar posts I have often said that the tangent ratio alone may be enough FWIW -BB- similar
 1332 jjc 2009.11.04 21:18 #   BarrowBoy: D You can always derive the angle quite simply, but for it to be 'absolute' requires a fixed baseline, probably using minutes On similar posts I have often said that the tangent ratio alone may be enough I've previously described angles as arbitrary, and I'll have another go at explaining why. Let's boil it down to the simplest possible terms, and say that you have two data points - the closes on two consecutive days - and you want to find the angle of the line connecting them. And you decide to do this manually, on paper. (It's no different in principle to having a computer do it for you.) Your data points are 1.4328 on November 2nd, and 1.4562 on November 3rd. Your first decision is how far apart to draw the days on the x axis of your manual chart. 10cm apart? 20cm? 5cm? Once you've made that decision, you now need to choose a scale for the y axis. How far apart are 1.4328 and 1.4562 going to be? 10cm? 20cm? A metre? Each of these decisions affects the angle of the line you end up drawing between the two points. Unless you have a reason for choosing the scale of each axis - i.e. some particular significance attached to choosing 5cm or 20cm - then the angle of the line between the points is arbitrary. And meaningless, except in relative terms compared with other angles drawn using the same scale - at which point all you have is a cumbersome way of comparing growth over a period. And, even if you do have a rationale for selecting a scale, you've then got the additional problem that scales in pixels can vary in their visual representation from one computer monitor to another... similar