Back to Community
Gradient of MA

Hello,
I would like to know how I can "caculate" the gradient of a moving average, just a simple approximation of the (daily) current value minus the previous value (of the day before), if so could you please show me, an example:

# The code should look like something like this:  
#ma - Moving average  
ma( close price until day1) - ma (close price until day1+1) / 1 day (or fixed interval of time) 

Thanks