Calculating a price from ma crossovers

Discussion in 'Technical Analysis' started by gms, May 22, 2003.

  1. gms


    What would be a way to calculate what today's price would have to be to make the 10-day and 15-day simple moving averages cross today?
  2. gms


  3. amg

    amg Guest

    I started to provide an answer, but there were some difficulties.

    Let's break it down:

    (1) You are looking for a x-over of 10d-15d.

    (2) You need either the 10d or the 15d to move enough to make that cross over.

    (3) Most x-overs take a position on the short MA crossing the long MA

    (4) Therefore, the Q is what price TODAY would make the 10d ma = 15d ma TODAY

    Mind you, this must pre-suppose that the 15d MA is moving in the direction you want to trade.

    OK, having said all that, here's the calculation:
    (1) 10d MA = 10d=(d1+d2+d3+d4+d5+d6+d7+d8+d9+d10)/10, where d1 through d10 are prices from 10 days ago, starting yesterday

    (2) 10d MA = a (known)

    (3) 15d MA = b (known)

    (4) 10d MA(x-over) = b (ie, = 15ma) = (d2+d3+d4+d5+d6+d7+d8+d9+d10+d11)/10, where d11 is TODAY'S DESIRED PRICE.

    To get todays desired price (d11), notice we dropped d1 and added in the yet unknown d11. You know the last 9 days prices.

    You need to solve for d11 (The PRICE TODAY to make 10d=15d):

    d11 = [(15d MA) times 10 ] / (d2+d3+d4+d5+d6+d7+d8+d9+d10)

    Sorry if it sounds simpleton (or too complex, lol)... amg
  4. write out both ma's.

    equate them.

    the last entry on each MA is todays close.

    you know all other values. Enter them.

    solve for today's close.
  5. Use a recurrence formula for MAs and equates them that should be simple or use excel solver and it will find you the value in 1 second :).

  6. gms


    Thank you all for your help. Peering into your collective guidance, I've deduced this as the formula:

    Today's Price = (Today's SMA(15)*10 ) -

    Very good work. Thank you again.
  7. The analytic math expression is rather complicated. Do you really need it ?? Is there any application ??
    10min before the end, you may know and buy [sell] at close...
  8. gms


    Very usually, I ask questions because the answer is complicated. Were it not, I'd soon figure out the answer. So, I think I may need it. I think there may be an application for it. But I won't know for certain until I do it.
    Yes, I've already considered that the price print may be better for that near EOD in any event, but I could always backtest and see.

    (BTW, I do see a mistake in my calculation in my previous post).
  9. There are some mistakes indeed.
    But, it is not the case.
    I may write an exact formula, if neccessary.
    as for the backtesting, just ask [for the past] the cross(MA(C,15),MA(C,10)) condition. All values are already known for the past, and I hope we agree !!
  10. amg

    amg Guest

    Yes... minor:

    You wrote:

    Today's Price = (Today's SMA(15)*10 ) -

    Should be:

    Today's Price = (Today's SMA(15)*10 ) ÷( Day10+Day9+Day8+Day7+Day6+Day5+Day4+Day3+Day2)

    Where Day 10 is yesterday.

    Good luck! Ana Maria
    #10     May 24, 2003