Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 9/3/2008 Posts: 12
|
Hello,
I am trying to plot the divergences using realcode and need some help. Here is what I have
top pane
price
bollinger band (20/2)
mov ang price (20)
bottom pane
moneystream
bollinger band (20/2)
mov avg ms (20)
I am able to plot the divergences between price and ms using references to top/middle/bottom bands but not able to plot divergences in between the bands. Is there a way this can be accomplished using
realcode. Thanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'm not sure if you are looking for divergences between the Bollinger Bands themselves or are still looking for divergences between Price and MoneyStream.
In either case, I would need to have an unambiguous objective definition of what you see as a divergence.
I would also be interested in seeing what you are using to identify divergences between Price and MoneyStream if we are going to expand upon what you already have.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 9/3/2008 Posts: 12
|
Bruce,
I am looking for divergence between price and ms in regards to the position in the bollinger bands.
This is what I have
p-price
bbmb -middle band
bbtb - top band
bbbb- bottom band
m-ms
mbbmb -middle band
mbbtb - top band
mbbbb- bottom band
- positive divergence
(price.last < bbmb AndAlso ms.last > mbbmb) orElse (price.last < bbbb AndAlso ms.last > mbbbb.last) Then Pass
- negative divergence
(price.last > bbmb AndAlso ms.last < mbbmb) orElse (price.last > bbtb AndAlso ms.last < mbbtb.last) Then Pass
I have 1day moving average for the top and bottom bands and a 20 day mov avg for the midlle band for both price and ms.
Thanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I think I understand enough of what you mean when you say "in regards to the position in the bollinger bands" to give you an idea that might work to do what you want.
You can get a more refined picture of where Price is within the Bollinger Bands by using Bollinger %b. You can add this Indicator by selecting Add Indicator | Select... | Bollinger b | OK.
The Bollinger b Indicator in the Web Library is not designed as a Child Indicator however so you will need to add another copy and modify the Block Diagram manually to use it on MoneyStream instead.
If you right-click on the second Bollinger %b Indicator and select Block Diagram you will see that the Prices Block goes into three other Blocks (Bar Close (Last), Moving Average Simple and Standard Deviation). We need to connect these three Blocks to MoneyStream instead. To do so, left-click and drag on the inputs to each of the these Blocks and select Link From Another Tool | MoneyStream. Once this is done, you should be able to right-click on the Prices Block and Remove it from the Block Diagram.
If you Drag and Drop one of the Bollinger %b Indicators onto the other, you can select Create Indicator | Difference to create a Plot of the difference in the relative positions of Price and MoneyStream within their Bollinger Bands. You can right-click on the Indicator and select Create Rule find out if it is above or below zero (the point at which they are in the same location relative to their Bollinger Bands) or set other Values for the difference to above or below if you are attempting to have a minimum separation between their relative positions.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 9/3/2008 Posts: 12
|
Bruce,
I will give it a try. Appreciate your quick response.
Thanks
Subbu
|
|
Registered User Joined: 9/3/2008 Posts: 12
|
Bruce,
Works great.
Thanks
Subbu
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |