maxbasily 57 posts msg #53084 - Ignore maxbasily |
7/13/2007 6:38:44 PM
if I have yesterday´s MA (5), and yesterday´s close - how do I calculate at what price the price is going to touch the MA (5) THE NEXT DAY??
|
TheRumpledOne 6,411 posts msg #53086 - Ignore TheRumpledOne |
7/13/2007 8:38:36 PM
First you fire up your crystal ball...LOL!
Serioiusly, the price affects the ma so until you know one you can't say, unless... you are asking what must the price be tomorrow for it to cross/touch tomorrow's ma.
|
maxbasily 57 posts msg #53090 - Ignore maxbasily |
7/13/2007 8:56:40 PM
yep, that´ s what I´m asking..
|
Dan-o 19 posts msg #53092 - Ignore Dan-o |
7/13/2007 10:16:53 PM
O.K., I think I've got it...For an exact cross-over between close and MA(5) let's try this:
CL4 = Close 4 days ago
CL3 = Close 3 days ago
CL2 = Close 2 days ago
CL1 = Close 1 day ago
CL = Today's close
CL = [CL4 + CL3 + CL2 + CL1 + CL] / 5 ---> Today's close equals MA(5)
5(CL) = CL4 + CL3 + CL2 + CL1 + CL ---> Multiply through by 5
4(CL) = CL4 + CL3 + CL2 + CL1 ---> Subtract CL from each side
CL = [CL4 + CL3 + CL2 + CL1] / 4 ---> Divide both sides by 4
Let's try it out:
CL4 = 16.25
CL3 = 16.72
CL2 = 17.01
CL1 = 16.81
CL = Unknown
Today's close needs to be [16.25 + 16.72 + 17.01 + 16.81] / 4 equals 16.6975
MA(5) = [16.25 + 16.72 + 17.01 + 16.81 + 16.6975] / 5 equals 16.6975
I think it works, good luck
Dan-o
|
guru_trader 485 posts msg #53097 - Ignore guru_trader |
7/14/2007 3:32:28 AM
Hhmmm,
|
maxbasily 57 posts msg #53101 - Ignore maxbasily |
7/14/2007 5:37:14 AM
Guys....Thanks! I´m so excited I haven´t even tried it out yet. now I test it rigorously and let you know if I find bugs
|
maxbasily 57 posts msg #53102 - Ignore maxbasily |
7/14/2007 6:49:59 AM
damn, I´m not sure it works.take a look at JUN15, 2007 e.g.
ONYX : price crossed MA (5)at 30.08(says SF) - the filter says differently..
BIIB: """"""""" 51.31 """""" - """""""""""""""""".
hmm
|
Dan-o 19 posts msg #53204 - Ignore Dan-o |
7/17/2007 9:27:16 PM
One thing to remember is that tomorrow's closing price you are generating is a minimum value that will generate a cross-over signal if exactly met or exceeded. If tomorrow's close spikes way up, you'll still get a cross-over signal and the calculation will look all goofy.
|
maxbasily 57 posts msg #53224 - Ignore maxbasily |
7/18/2007 11:52:40 AM
yea that´s the problem...so what do we do? what about a calculation on an intraday hourly close basis? possible?
|
Dan-o 19 posts msg #53227 - Ignore Dan-o |
7/18/2007 1:05:55 PM
My suggestion would be to run the filter intraday and show stocks where price has crossed above CL from below, or something to that nature. You could also set up a variable to measure how far below/above the CL value your stocks currently are, as a percentage. PctAway = (CL - current price)/CL * 100. You could then run your filter and show stocks where PctAway is between -2 and 2 (two percent above or below CL). Sky's the limit, basically; it comes down to how you want to view your results.
Dan-o
|