Where in your code to you convert slope to percent?
Slope is: m=ΔPrice÷ΔTime.
Percent would be: 100 × m ÷ Price.
Where in your code to you convert slope to percent?
Slope is: m=ΔPrice÷ΔTime.
Percent would be: 100 × m ÷ Price.
I messed up, sorry.
You are right, i there is no part, where the decimal number is converted to percent.
i didnt meant percent, but the angle in degree.
Still any ideas ?

There is no angle from 2 anchor points. An angle requires distance divided by distance; a unitless number. A chart has price and time. What is the angle of going 30 miles in 45 minutes? Meaningless!

You can get the slope from a trendline: m=ΔPrice÷ΔTime. Changing the price scale, bar width, or window size, changes the apparent angle, the slope is constant. Angle is meaningless.

You can create an 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 programming forum  Page 2
Hey,
im trying to get the Slope of an iMA in percent.
I have read multiple posts here but non of them seem to work or im missing out on something (probably last option)
I think it doesnt have to do with my code structure, but my math.
Heres my code in the OnTick function:
Thanks in advance.
I believe mathematically you cannot have percentage in slope unless you know what your 100% is, or you want to check the increase or decrease of slope. This means, you must have a reference slope. But now the slope of iMA is the the difference between two values of the same iMA, ie. ima50[n1] and ima50[n2]. There in no need to divide iMA by count as slope is a price already divided by time which is int ma_period. If you want a slope of 6 bars then multiply your current int ma_period by 6.
This is just my understanding.
I messed up, sorry.
You are right, i there is no part, where the decimal number is converted to percent.
i didnt meant percent, but the angle in degree.
Still any ideas ?
 Free trading apps
 Over 8,000 signals for copying
 Economic news for exploring financial markets
You agree to website policy and terms of use
Hey,
im trying to get the Slope of an iMA in percent.
I have read multiple posts here but non of them seem to work or im missing out on something (probably last option)
I think it doesnt have to do with my code structure, but my math.
Heres my code in the OnTick function:
Thanks in advance.