StockFetcher Forums · Filter Exchange · hot math question...<< 1 2 >>Post Follow-up
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,

Fetcher[
and not otcbb
and close between 1 and 25
and avgvol(90) > 54321

and set{cl4,close 4 days ago}
and set{cl3,close 3 days ago}
and set{cl2,close 2 days ago}
and set{cl1,close 1 days ago}
and set{temp1,cl4 + cl3}
and set{temp2,temp1 + cl2}
and set{temp3,temp2 + cl1}
and set{cl,temp3 / 4}
and add column cl4
and add column cl3
and add column cl2
and add column cl1
and add column cl

and set{temp4,temp3 + cl}
and set{ma5,temp4 / 5}
and add column ma5

and draw cl4
and draw cl3 on plot cl4
and draw cl2 on plot cl4
and draw cl1 on plot cl4
and draw cl on plot cl4
]



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

StockFetcher Forums · Filter Exchange · hot math question...<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.