How get angle or slope of trendline?
gouki1001:
How get angle or slope of trendline?
How get angle or slope of trendline?
Is there a way to use time stamps like points or integers so I can use them in simple math calculations?
gouki1001:
How get angle or slope of trendline?
How get angle or slope of trendline?
the slope is in point per Bar
- Angle can't be done.
gouki1001: How get angle or slope of trendline?
-
There is no angle from 2 anchor
points. An angle requires distance divided by distance; a unitless
number. A chart has price/time. What is the angle of going 30 miles in 45
minutes? Meaningless!
-
You can get the slope from a trendline. Delta price / delta time. Changing the
axes scales changes the apparent angle, the slope is constant. Angle is
meaningless.
-
You can create a angled line using one point and setting the angle (Object
Properties - Objects Constants - Standard Constants, Enumerations and
Structures - MQL4 Reference.)
The line is drawn that angle in pixels. Changing the axes scales does NOT change
the angle (and thus is meaningless.)
-
If you insist, take the two price/time coordinates, convert them to pixel
coordinates and then to apparent angle with arctan.
How to get the angle of a trendline and place a text object to it? - Trend Indicators - MQL4 and MetaTrader 4 - MQL4 programming forum - Page 2
-
There is no angle from 2 anchor
points. An angle requires distance divided by distance; a unitless
number. A chart has price/time. What is the angle of going 30 miles in 45
minutes? Meaningless!
- gouki1001: Is there a way to use time stamps like points or integers so I can use them in simple math calculations?iBarShift
William Roeder:
- Angle can't be done.
-
There is no angle from 2 anchor
points. An angle requires distance divided by distance; a unitless
number. A chart has price/time. What is the angle of going 30 miles in 45
minutes? Meaningless!
-
You can get the slope from a trendline. Delta price / delta time. Changing the
axes scales changes the apparent angle, the slope is constant. Angle is
meaningless.
-
You can create a angled line using one point and setting the angle (Object
Properties - Objects Constants - Standard Constants, Enumerations and
Structures - MQL4 Reference.)
The line is drawn that angle in pixels. Changing the axes scales does NOT change
the angle (and thus is meaningless.)
-
If you insist, take the two price/time coordinates, convert them to pixel
coordinates and then to apparent angle with arctan.
How to get the angle of a trendline and place a text object to it? - Trend Indicators - MQL4 and MetaTrader 4 - MQL4 programming forum - Page 2
-
There is no angle from 2 anchor
points. An angle requires distance divided by distance; a unitless
number. A chart has price/time. What is the angle of going 30 miles in 45
minutes? Meaningless!
- iBarShift
I have get my values from Y axis values like this Low[L1] /(Low[L2]/High[H1] /High[H2]
llhypl = MathSqrt(MathPow((iBarShift(NULL,0,Time[Low[L1]])- ( iBarShift(NULL, 0, Time[Low[L2]]))),2)+ MathPow(((Low[L1]-Low[L2])*100000),2));
So i get an error when I try to get values into the iBarShift function.
gouki1001:
Time[Low[L1]] iBarShift(NULL, 0, Time[Low[L2]]
- Babel. If L1 is an index, Low[L1] is a price of bar L1. What is the time of a price? Meaningless.
- If you meant Time[L2], the shift of Time[L2] is L2. Babel.
- When you post code please use the CODE button (Alt-S)!
(For large amounts of code, attach it.)
Please edit
your (original) post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register