Hi, I hope that this is possible. What I want to do is basically finding the slope of the difference of the MVAs occuring after either an uprcross or downcross, except much more simple than that.
For example, say on a HOURLY chart, the 10 period MVA has just crossed up from the 20 period MVA generating a buy signal. Following the upcross, the MVA of 10 periods has value =[7 5 3 1] for the next four hours, and an MVA of 20 periods has value = [6 3 2 -2]. Thus their difference would be = [1 2 1 3]. As you can see, the difference goes from 1 to 2 to 1 then to 3, although as I will soon explain the 3 will be irrelevant.
Basically what I want to do, is to have a downcross/upcross generate a sell/buy signal. Then, when the differences between the MVAs becomes negative (in this case when it went from 2 to 1), to liquidate the position, then wait for the next downcross/upcross to open a new position. So in my example, the upcross generates the buy signal, then once it sees that the difference has gone from 2 to 1 , it liquidates my position then waits for the next cross to open a new one. Hopefully this was clear, and if not I hope I will be able to clear it up. Thank you very much!