StockFetcher Forums · General Discussion · EMA of highs and lows<< >>Post Follow-up
xraywiz
22 posts
msg #33745
Ignore xraywiz
10/29/2004 8:22:34 PM

Hi everyone,
I have two questions.

1- How would I write the SF code for the 15 day EMA of the >>highs<< or >>lows<< of a given stock, rather than just the bare EMA(15)?

2- I would also like to specify this process: that one indicator, such as "Slow stochastics crossing the fast stochatics..." occurred before another indicator (i.e., anytime before, not a specific number of days), for example: EMA(15) crossing the EMA(50).

In other words, I would like to specify a chronological order to two independent events without specifying the actual time between them.

I would really appreciate your help in this.
xraywiz


yepher
353 posts
msg #33752
Ignore yepher
10/30/2004 1:10:08 PM

xraywiz,


For question 1 have a look at "custom exponential moving averages (CEMA/CWMA)". You would want "high" or "low" as the indicator part of the command. I posted a filter some time ago that did something similar before the "cema" command was available. The title of the post was: "My Newest favorite filter".

For question 2 "count" command will get you the information you want. I know Cegis and others have posted many useful messages about it's use.

If you need a resource to find the commands easily have a look here:
http://yepher.com/~yepher/stockfetcher/command.html

If you give it a try and post what you have there are lots really helpful people here who I am sure will be more than willing to help you get exactly what you want.

Another post that may interest you is: "Combining filters as unions and intersections of results..." but maybe it bit much to digest if you are not too familar with SF syntax.

Good luck and let me know if you need more help.






xraywiz
22 posts
msg #33759
Ignore xraywiz
10/30/2004 5:40:22 PM

Thanks a lot yepher for your helpful and detailed suggestions. I'll give them a try and let you know soon.
MMF


xraywiz
22 posts
msg #33760
Ignore xraywiz
10/30/2004 6:37:13 PM

Help with syntax please!
The following filter is just a test of the indicator crossing concept. The problem is that if you remove the words "from below" from this filter you get fewer hits! A lot fewer! 15 versus 51 or so.
Any ideas why?
Also seems there is a slight difference (15 vs 16 today)) if I use the word "above" instead of "more than" in the first line:


stock price is more than 10
and cema(close,7) crossed cema(close,20)from below and volume is more than 500000.

MMF


xraywiz
22 posts
msg #33762
Ignore xraywiz
10/30/2004 8:00:52 PM

I think I have the answer, but why??!!
The words "from above" are what SF understands if they are not spelled out! If you want "from below" you need to say so. But when you leave them out SF apparently assumes that you mean from above. That's the difference between 15 and 51 hits today.
Regarding the second comment, 15 vs 16, I can't duplicate it. I don't know what it was that caused it, but it isn't there anymore!
MMF


yepher
353 posts
msg #33765
Ignore yepher
10/30/2004 11:50:42 PM

Looks like you are well on your way to having the filter you wanted.

One thing I noticed and may cause problems for you is your "crossed" syntax should be "crossed above" or "crossed below". The crossed will find only stocks where the two measure have crossed in the direction you indicate. You could also try "crossed above/below within the last N days" to get a few more results out of the filter.

Although I think your filter was working the way it was written I modified it a little so it would graph the CEMA line on a separate plot and fixed the crossed syntax.

Fetcher[
/* A */
set{fastClose, cema(close, 7)}
set{slowClose, cema(close, 20)}
and draw fastClose
and draw slowClose on plot fastClose

/* B */
and stock price is more than 10
and cema(close, 7) crossed above cema(close, 20)
and volume is more than 500000
]



Section A is just to get the CEMA lines to be graphed in sepearate graphs when you view your results.

Section B is basically what you had written except I added "crossed above".

One other note. If you would like your filter to be clickable when you post it just add:
"Fetcher[" then your filter and end with another "]"




xraywiz
22 posts
msg #33768
Ignore xraywiz
10/31/2004 2:43:29 PM

Thanks yepher, especially the last note re clickable filters, as well as the mod on the filter to separate the plots. I am learning a great deal from you.
I am still trying to figure out how to use the command for the chronological occurrence of two events.
One question: I had trouble specifying cema(high,50) and cema(low,50). It's as if it can't accept 50 as a valid number?
MMF


yepher
353 posts
msg #33770
Ignore yepher
10/31/2004 5:32:23 PM

xraywiz,

I am glad to hear that this information has been useful to you.

For the chronological occurrence of two events I think you could use a combination of "days()" and "set{}" commands to get the data you want. Below is an example that that I hope will get you on the right path.

This is intentionally a less than useful filter. It is only meant to demonstrate how to figure out how many days ago a particular event occurred.

Fetcher[
set{myInd1, days(Stochastic %K(15,5,3) crossed above the Stochastic %D(15,5,3), 200)}
and price between 1 and 10

and add column myInd1 desc
and sort column 5 descending
and draw myInd1
]




As for the 50 in the cema I am not aware of any limits that would prevent you from using such a number.




StockFetcher Forums · General Discussion · EMA of highs and lows<< >>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 2016 - 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