Tangent to a Moving Average and its Gradient

 
Hello programmers! Can anyone please help me figure out a way of calculating the tangent of a moving average then find its gradient Please?
 

Simple answer: you can't.

Reason: just by zooming in/out separately on your x-axis (time) or y-axis (price) you get a completely different slope / angle / steepness (e.g. if you just move the mouse over the axis with pressed down left mouse button).

What you can do instead for the slope of the most recent segment of the MA: evaluate the change per time, which is (MA[0]-MA[1])/PeriodSeconds(PERIOD_CURRENT)

 
Chris70:

Simple answer: you can't.

Reason: just by zooming in/out separately on your x-axis (time) or y-axis (price) you get a completely different slope / angle / steepness (e.g. if you just move the mouse over the axis with pressed down left mouse button).

What you can do instead for the slope of the most recent segment of the MA: evaluate the change per time, which is (MA[0]-MA[1])/PeriodSeconds(PERIOD_CURRENT)

Thank you
Reason: