I am not sure if you understand my question.
Simply, I want to calculate, for each bar, the difference with the bar which is n-times back. Where n-times is ithe value of the shift variable.
The result would be a series as well.
Could you help me or give an help?
Thanks.

PS.: May the solution be the following?

vars MAdiff = series(MA[0]-MA[shift]);


I need to test it in my laptop this night.

Last edited by gtell; 07/29/16 11:55.