Registered User Joined: 10/5/2009 Posts: 66
|
Hi,
I tried seaching for a SF 5.0 formula (I can adjust for below or above the B) that would provide the following-but was unable to find one-can you help me out?
BB 20, StdDev 2.00
Todays price low (high) was "X" % or more below (above) the lower (upper) BB
Closed in bottom "X" % of the day's range
Thanks, Burls
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You can use a 1-Period Stochastic to check for where the close is relative to the range of the bar as a percentage. 0 would be all the way at the bottom and 100 would be all the way at the top. So checking for the value of a 1-Period Stochastic being at or below X would check for the close being in the bottom X% of the day's range.
Bollinger b (or %B) is the indicator which is normally used to determine where price is relative to the range of the Bollinger Bands. It is 0 when at the bottom of the bands and 100 when at the top of the bands. So if Bollinger b is 110, then it is 10% of the width of the Bollinger Bands above the Top Bollinger Band and if Bollinger b is -20, then it is 20% of the width of the Bollinger Bands below the Bottom Bollinger Band.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 10/5/2009 Posts: 66
|
I'm not sure this will give me what I'm looking for..."So if Bollinger b is 110, then it is 10% of the width of the Bollinger Bands above the Top Bollinger Band"
As an example the SPY on Nov 8/12 closed at $138.04.....Lower band = $138.67......and %b = -8.22...but the SPY was not 8.22% below the lower band...
I would not want to get the SPY on my list until it was 10% below $138.67
Perhaps I'm missing something?
Thanks, Burls
|
Registered User Joined: 10/5/2009 Posts: 66
|
I'm not sure this will give me what I'm looking for..."So if Bollinger b is 110, then it is 10% of the width of the Bollinger Bands above the Top Bollinger Band"
As an example the SPY on Nov 8/12 closed at $138.04.....Lower band = $138.67......and %b = -8.22...but the SPY was not 8.22% below the lower band...
I would not want to get the SPY on my list until it was 10% below $138.67
Perhaps I'm missing something?
Thanks, Burls
|
Registered User Joined: 10/5/2009 Posts: 66
|
Sorry re-posted the my 1st reply...(Thanks for the formula on that one) but was looking to add this question..
I set the stoch. to 1 period....as an example-I checked AMZN on Oct. 25/12...the low of the day was $222.92 and it closed at $222.92...but stoch. was at 24.34.....
I selected from the Indicator choices "Stochastics"...and changed the default setting of 12 period to 1
I must be missing something...
Thanks again, Burls
|
Registered User Joined: 10/5/2009 Posts: 66
|
Hi Bruce,
When I pasted the formula you supplied-no problem-those at greater than 10% were identified....but when I put in # Percent = UserInput.Integer = 2....nothing was identified....
'# BBTop = chart.BollingerBands.0
'# BBBottom = chart.BollingerBands.1
'# Percent = UserInput.Integer = 2
If Price.Last >= (1 + Percent / 100) * BBTop.Value OrElse _
Price.Last <= (1 - Percent / 100) * BBBottom.Value Then Pass
Thanks, Burls......
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It is probably still using 10 as the value for Percent.
The UserInput line in the RealCode creates a User Input which can be used to adjust the setting, but changing the assigned value in the UserInput line after it has been created and compiled will not change the actual value of the Percent variable.
You need to Edit the condition and change the Percent setting in the User Input that was created by the RealCode.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 10/5/2009 Posts: 66
|
Hi Bruce,
Two things I'm not sure about.....
-You said I need to Edit the condition and Change the Percent setting...so problem changing the Percent setting but not sure what to Edit in the indicator as the BB indicator is set to what I want....
-Second part is I set the stoch. to 1 period....as an example-I checked AMZN on Oct. 25/12...the low of the day was $222.92 and it closed at $222.92...but stoch. was at 24.34.....
I selected from the Indicator choices "Stochastics"...and changed the default setting of 12 period to 1
I must be missing something...
Thanks again, Burls
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If the Bollinger Band is set up how you want, there shouldn't be anything to change in the Condition besides the Percent setting. You would adjust the Bollinger Band indicator to adjust the Bollinger Band settings used by the Condition.
You could theoretically delete the Bollinger Band indicator from the chart and then those settings would be bottled into the Condition. There would then be a tab available when editing the Condition to adjust the Bollinger Band settings being used for the calculations.
The value of a 1-Period Stochastic for AMZN on October 25, 2012 is 0, not 24.34. It reads like you might not have changed both the Period and %K settings in the Stochastic to 1. The %K is a moving average of the raw Stochastic and the %D is a moving average of the %K. If the %K is set to 3 for example, it will be taking a 3-Period moving average of the Stochastic instead of displaying the Stochastic itself.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 10/5/2009 Posts: 66
|
I'm not sure I understand.....Perhaps I missed something so I'll walk thru what I did
1. I opened up New RealCode Condition....
2. Saved the code which you had sent (which had Percent = UserInput.Integer = 10) and used the "Show True Markers" no problem...conditions that were true were marked
3. I then Changed the Percent = UserInput.Integer from 10 to 2....applied and nothing was marked via the true markers
4. I let you know it didn't work and you said "You need to Edit the condition and change the Percent setting in the User Input that was created by the RealCode."
5. I then mentioned that the indicator was set correctly.
6. You then said "If the Bollinger Band is set up how you want, there shouldn't be anything to change in the Condition besides the Percent setting".....But in #3 above I had only changed the Percent setting...but nothing was marked...
So not sure what to do as the indicator is set correctly....and only want to change the user input integer from 10 to 2....
Appreciate your patience,
Burls
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Let's start by changing the RealCode Condition somewhat so we can use more precise percentages than integer values (if whole number values work for you, then you can leave it as is):
'# BBTop = chart.BollingerBands.0
'# BBBottom = chart.BollingerBands.1
'# Percent = UserInput.Single = 10
If Price.Last >= (1 + Percent / 100) * BBTop.Value OrElse _
Price.Last <= (1 - Percent / 100) * BBBottom.Value Then Pass
I suspect the issue is that you are just looking at symbols where price is not closing outside the bollinger bands by at least 2%, but let's go through changing the percent setting step-by-step.
Left-click on the Condition (or right-click and select Edit) to edit the Condition. There should be Percent, Passing and of the Last settings. Leave the Passing and of the Last settings alone and adjust the Percent setting to 2.0000.
Now we need to find a symbol where the close is at least 2% of the Top Bollinger Band above the Top Bollinger Band or 2% of the Bottom Bollinger Band below the Bottom Bollinger Band.
Assuming your Bollinger Bands are as described in your original post (Period 20, Std Dev 2.00), then there are quite a few symbols where this would currently be true on a Daily chart. If we look at just Optionable Items for example, we get BRCM, UEPS, SWKS, CLSN, DEPO, BGCP, CACI, CADX, ATHX, TIVO, HFC, RTN, FIO, CXS, TAOM, KEX, CRME, LQDT, GD, RSH, MJN, CBD, CLB, RDEN, OSIR, SNSS, ALGN, ORCC, KEM, SEIC, IIIN, AN, SMFG, AVB, PFMT, RTIX, HHS, MANT, CPRT, ALIM, KTOS, IVC, WHR, STZ, HNP, GNK, PBI, NAVB, RNDY, CBT, SGI, WMS, CNQR, HAR, TWC, KIRK, TSCO, ERIC, TWER, FTNT, MGAM, EVR, VELT, ENDP, INAP, AVG, GIB, CPNO, FSL, HA, ACO, PBR, CODE, RMTI, CEVA, ENVI, MERU, ANX, UIS, NTGR, OXF, VMW, WMAR, IBCP, KERX, SWIR, CMCO and ZN. That said, there are a lot of symbols where you need to zoom out quite far to see any markers on the chart.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|