StockFetcher Forums · General Discussion · Filter writing help<< >>Post Follow-up
Fat Dragon
8 posts
msg #106103
Ignore Fat Dragon
5/4/2012 11:45:57 AM

I am trying to normalize an oscillator indicator. I am trying to do this by first choosing the oscillator. Lets say RSI(21). Then I would like to put Bollinger Bands(20,2) on top of the RSI. Then I would like to put %b of that Bollinger Band on top of that and display it in a column. This would give me a % placement of the RSI based not on the 70 & 30 lines but on the more relative B Bands.

I tried a line like: add column RSI(21) filtered with Bollinger Band(20,2) and filtered with %b

I did not get a syntax error but the numbers were not accurate. Any ideas how to do this or something similar?



Thanks,
Fat Dragon

Kevin_in_GA
4,599 posts
msg #106113
Ignore Kevin_in_GA
5/5/2012 2:51:25 PM

Try this:

Fetcher[

/*FIRST SET THE RSI(21) AS A USER-DEFINED VARIABLE*/
SET{RSI21, RSI(21)}

/*NOW GET THE MA(20) OF THIS VARIABLE*/
SET{MA20, CMA(RSI21,20)}

/*NOW CALCULATE THE STDEV TO DETERMINE BOLLINGER BANDS*/
SET{STD20, CSTDDEV(RSI21,20)}
SET{DIFF, RSI21 - MA20}
SET{ZSCORE, DIFF / STD20}
SET{THRESHOLD, STD20 * 2}

SET{UPPERBAND, MA20 + THRESHOLD}
SET{LOWERBAND, MA20 - THRESHOLD}

DRAW LOWERBAND ON PLOT RSI21
DRAW UPPERBAND ON PLOT RSI21

ADD COLUMN ZSCORE {Z-score}

DRAW ZSCORE LINE AT 2
DRAW ZSCORE LINE AT -2
DRAW ZSCORE LINE AT 0

]



Fat Dragon
8 posts
msg #106119
Ignore Fat Dragon
5/6/2012 8:00:47 AM

Kevin:
Thank you, I don't want to be lazy but that would have taken me a year to figure out.

Much Appreciated,
Fat Dragon

Kevin_in_GA
4,599 posts
msg #106120
Ignore Kevin_in_GA
5/6/2012 9:20:51 AM

No problem. This is a good piece of code to remember in that it lets you put BB's on any indicator. I use this as part of another filter, so it was really just a cut/paste/edit quickly thing for me.

tango1
1 posts
msg #106121
Ignore tango1
5/6/2012 2:08:21 PM

Kevin; good morning
Trying to figure out a simple filter with no more than 4 indicators that can give us " some" indication of a stock break out dormit for a while
RSi 10 above 30 klast 3 days
Ma crossing 30 and below 50;
volume above 500k last 5 days

any thoughts?


StockFetcher Forums · General Discussion · Filter writing help<< >>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.