Any help would be appreciated.
-charliev
-charliev
ObjectSet("test", OBJPROP_RAY, 1); ObjectsRedraw(); double angle=ObjectGet("test", OBJPROP_ANGLE);
ObjectSet("test", OBJPROP_RAY, 1); ObjectsRedraw(); double angle=ObjectGet("test", OBJPROP_ANGLE);
Slawa,
I added ObjectsRedraw() to my example, and it still only returns 0.
I'm on build 195.
Any thoughts?
-charliev
ObjectSet("test", OBJPROP_RAY, 1); ObjectsRedraw(); double angle=ObjectGet("test", OBJPROP_ANGLE);
Slawa,
I added ObjectsRedraw() to my example, and it still only returns 0.
I'm on build 195.
Any thoughts?
-charliev
Try
DoubleToStr(angle,8)
to see if it is somewhere less then 1
Try
DoubleToStr(angle,8)
to see if it is somewhere less then 1
Slawa,
The result after trying DoubleToStr(angle,8) is:
"0.00000000"
This angle is a good 30 degrees... Still 0.
Is this working for you?
-charliev
See sample script "MQL4: Rotating text"
BTW I don't see in your sample angle set. By default its value is 0
BTW I don't see in your sample angle set. By default its value is 0
See sample script "MQL4: Rotating text"
BTW I don't see in your sample angle set. By default its value is 0
BTW I don't see in your sample angle set. By default its value is 0
I'm not setting the angle... just creating 2 points to draw the trendline, THEN I'd like to know what angle it its. If I can't read the angle of the newly created line (except by setting it), can you provide a code example on how to get the angle of the trendline in degrees?
Thanks,
-charliev
Sorry for my mistake. There is limited version.
See rotate_text.mq4 in your experts\scripts directory
See rotate_text.mq4 in your experts\scripts directory
I'm not setting the angle... just creating 2 points to draw the trendline, THEN I'd like to know what angle it its. If I can't read the angle of the newly created line (except by setting it), can you provide a code example on how to get the angle of the trendline in degrees?
Thanks,
-charliev
Thanks,
-charliev
The principle is :
angle in radians = MathArcTan((P2-P1) / (T2-T1));
angle in degree = 180 * angle in radians / MathArccos(-1.0);
but there is a prolbem with the unities, according to the timeframe, the zoom, and so. So, I think it should be better if you can work with the tangeante of the angle; the real angle in degree is not meaningfull.
Hope this help.
Slawa and MichelB thank you for your input.
Slawa, maybe this could be put on the "wish list"... drawing a trendline, and having the angle returned. Just a thought.
-charliev
Slawa, maybe this could be put on the "wish list"... drawing a trendline, and having the angle returned. Just a thought.
-charliev
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
Am I doing this correct? I drew a Trendline (test) and I want to return the Angle...
Draws the Trendline, but just returns 0 for the angle.
Any thoughts?
-charlie