Indicator angle of tangent line

Created at 04 Mar 2014, 20:14
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
OL

Old Account

Joined 14.10.2013

Indicator angle of tangent line
04 Mar 2014, 20:14


Hi

I'm trying to find out how to get the angel of the SMA slope, but my problem is that it's hard to find what the x-coordinate should be because they don't have a pip value like the y-coordinate does . Any suggestions on how I can do this 

 

Her is the code i have tried:

     protected override void OnStart()
        {

            double y = 1;//SMA LastValue difference to last bar.
            double x = 1;// Don't know :/
            var rad = Math.Atan(y / x);
            var deg = rad * 180 / Math.PI;

            Print(deg);
        }

 


@Old Account