BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Divergence
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Divergence

 Post Reply Post Reply
Author
Message / View First Unread Post
brentjedi View Drop Down
Regular
Regular
Avatar

Joined: 13 Dec 2007
Posts: 34
Post Options Post Options   Quote brentjedi Quote  Post ReplyReply Direct Link To This Post Topic: Divergence
    Posted: 06 Feb 2009 at 6:17pm
Hi Forum

I am back into trading and need to get some help in coding BC scan to look for divergence of ROC or any other indicator that sits in a new pane under price bars.

In divergence its about opposite troughs and peaks to what price action is doing.

It is a very good setup if you can find them.

Thus BC scan to find them is needed. The default stochastic divergence scan seem not to do the trick.

Any Ideas

brentjedi

Trading is art of self
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 08 Feb 2009 at 2:08am
Welcome back brentjedi and hope you've had a nice holiday.
 
There's many ways of displaying and working out divergence(s).
I generally look for the simplest solution, this may be it.
 
I converted this metastock code, which displays points of diverg
signals.   This site has 100's more indicators that anyone can
Setting up a scan should be easy enough for single signals, though
multiple signals would have a higher probability.   There's also one
that uses zigzag + RSI divergence, that may be a better one.
 
The converted code:
 

{ Divergence Signal (RSI) }

expr := expression("Expression");

nrsi := input("RSI Time periods",14,1);

rsival := rsi(expr, nrsi);

[color = blue]

If(C = LLV(C,20),1,0) * If(rsival > LLV(rsival,20),50,0)+If(C = HHV(C,20),1,0) * If(rsival < HHV(rsival,20),-50,0)+50;

[Color = Red]

rsival;

 
Back to Top
peter1 View Drop Down
Regular
Regular


Joined: 27 Aug 2008
Location: Sydney
Posts: 56
Post Options Post Options   Quote peter1 Quote  Post ReplyReply Direct Link To This Post Posted: 08 Feb 2009 at 1:23pm
That is the same site that I found some code to help me Maximo. 
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 08 Feb 2009 at 7:04pm
Yes it's a great site.  I found a lot of useful idea's and indicators there too including the full source to indicators like ADX, Aroon and CCI.    Important if you want to understand how they work or program them for other trading platforms.   Useful for anyones trading ideas.
 
Cheers!


Edited by maximo - 08 Feb 2009 at 7:09pm
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 08 Feb 2009 at 11:33pm

Here's some information on Divergences if anyone is interested.  http://www.tradeology.com/hidden-divergence-a.html

These guys call Divergence continuation patterns, "Hidden Divergence" and Divergence 'reversal patterns', "Bullish Divergence" or "Bearish Divergence".    Well the increase in terminology among trading educators certainly does not help one's trading..  In truth Divergence is really just the contraction of 2 averages of different periods, meaning that the trend is just slowing on 2 different time frames.   Like that traders saying: If its not going down then its looking to go up.. and vica versa.   Definitely not a sure thing.. but any probability > 50/50 is an advantage.


Edited by maximo - 09 Feb 2009 at 12:07am
Back to Top
brentjedi View Drop Down
Regular
Regular
Avatar

Joined: 13 Dec 2007
Posts: 34
Post Options Post Options   Quote brentjedi Quote  Post ReplyReply Direct Link To This Post Posted: 09 Feb 2009 at 1:15pm
Maximo

Glad to be back and even more joy that people are on the forum.

Thanks for the formula, however I am wanting to use it on a indicator I put together instead of the RSI. I tried to change the names but it didn't work.

The indicator is, H - REF( C, -10) of course MACD or ROC or anything else works to the problem to get BC to do the looking and find them. Could you help with the code?.

Cheers

Brentjedi


Trading is art of self
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 10 Feb 2009 at 12:37am
Yeah it's a bit more involved than that.  The indicator needs to be re-scaled so that it matches the size of the signals being displayed.   RSI ranges from 0 to 100 so that one's okay, but other indicators also need to be in that range.  Alternatively you can adjust the signal range from +/- 50 to say +/- 10 or within the range of the indicator being used. 
 
To scan for it or any indicator, click on New scan, select 'is an indicator'.
Find the indicator you want to scan for in the drop down list and then
select your required scan parameters.
 
The indicator is doing it's job, though the signals reliability could be improved by filtering for peak divergences instead of just willy nilly indicator is going in the opposite direction to price.  Hmm maybe green for a long signal and red for a short signal would make things clearer as to the direction and have the indicator in blue.

{ Divergence Signal C-10 }

Lookback := input("LookBack period",-10);

cval := (H-ref(C,Lookback))/C*100+50;

[color = blue]

sig:=If(C = LLV(C,20),1,0) * If(cval > LLV(cval,20),50,0)+If(C = HHV(C,20),1,0) * If(cval < HHV(cval,20),-50,0)+50;

sig;

[Color = Red]

cval;



Edited by maximo - 10 Feb 2009 at 6:44pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz