Trying to 'reverse' a formula....

I am trying work out a formula based on the information below that will help me to answer the question... "What PRICE is required today that will make the difference between two exponential moving averages the same value as yesterday?" I can work out the formula 'forwards' as I've shown below with my calculations, but I am trying to create a formula where TODAYS PRICE is the unknown variable. Any help would be most appreciated, Thank you.

YP = Yesterday price (=4.29)

YEMA1 = yesterdays 3 day exponential moving average (=4.28)

YEMA2 = yesterdays 5 day exponential moving average (=4.20)

YDiff = YEMA1/YEMA2 (=1.01905)

TP = Todays price (=4.29)

TEMA1 = Today's 3 day exponential moving average =2/4*(TP-YEMA1)+YEMA1 (=4.285)

TEMA2 = Today's 5 day exponential moving average =2/6*(TP-YEMA2)+YEMA2 (=4.23)

TDiff = TEMA1/TEMA2 (=1.013002)

So, just to clarify, I am trying to find out what 'TP' should be that will make 'Tdiff' equal 'Ydiff'.

Re: Trying to 'reverse' a formula....

For simplicity I'm going to call YEMEA1 = Y_1, YEMEA2=Y_2, Ydif = Yd, TEMA1 = T_1, TEMA2 = T_2, Tdiff = Td

The formula for T1 that you have can be simplified to , and .

If , then

Multiply numerator and denominator of the the left hand side by 6, and rearrange:

Note that Yd times Y_2 = Y_1, so:

Using your numbers above, where Y_1 = 4.28 and Y_d = 1.01905, you get Tp = 4.4495, T1 = 4.364752, T2 = 4.283168, and Td = 1.019048 (same as Yd).

Re: Trying to 'reverse' a formula....

Excellent! Thank you very much.. you've made my day.. I'd already spent quite some time trying to figure this out!

Re: Trying to 'reverse' a formula....

I've just been trying to test myself to make sure I understand how you derived at the formula... and so I have decided to use a different example using a 5 day EMA and an 8 day EMA.... (and applying a multiplier of 40 ).. but where I am really stuck is the process you went through to rearrange the formula after multiplying the numerator and denominator... could you break it down into smaller steps.. or point me in the direction of somewhere to go where I can learn how to do this? Thanks again.

Re: Trying to 'reverse' a formula....

OK. Staruing from:

Multiply through by :

Now multiply through by the denominator on the right hand side:

Regroup to bring the T_p terms to the left hand side and everything else on the right:

Sub :

Divide both sides by p :

Multiply right hand side by :

Hope this helps.

Re: Trying to 'reverse' a formula....

There is an error in my previous post but i am unable to edit it.

Quote:

Originally Posted by

**ebaines** OK. Staruing from:

Multiply through by

:

Should be:

Starting from:

Multiply through by :

The remainder of the post is OK as is.

Re: Trying to 'reverse' a formula....

Ah that's great - just what I needed - thank you!