Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

RSI divergence Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
yourchef51
Posted : Thursday, February 19, 2009 11:02:37 PM
Registered User
Joined: 7/1/2007
Posts: 9
At the Denver Class this past weekend, Julia went over the macd divergence chart in real code.  I thought she said she was going to include it in the notes but I didn't see it.  I was hoping to get it and then apply it to RSI Thanks.
Julia_O
Posted : Friday, February 20, 2009 11:41:55 AM


Worden Trainer

Joined: 4/26/2007
Posts: 508
yourchef51,

Glad you plan to use it!  Over what time period do you hope to see the divergence occur - a month, a week, a day on an hourly chart, etc.  I'll write and pass along with that info.

Best,
Julia
yourchef51
Posted : Friday, February 20, 2009 5:18:19 PM
Registered User
Joined: 7/1/2007
Posts: 9
I would be looking at it on a daily chart looking for the divergence over a month or two.  Thanks.
Julia_O
Posted : Monday, February 23, 2009 10:20:15 AM


Worden Trainer

Joined: 4/26/2007
Posts: 508
yourchef51,

I've created a Layout that includes the requested scan.  Use the envelope icon on the main menu to navigate to the Browse Other Users Shared Items folder (aka the Share Library).  Within the Layouts tab, search for 'Divergent Price and RSI'.  Open the Layout; the orange rule is the divergence rule requested.  You can view its code, and implement in any of the ways we discussed in class.

I hope this helps.  Let me know if you need anything else.

Best,
Julia
dulakovic
Posted : Monday, April 13, 2009 10:21:24 PM
Registered User
Joined: 11/29/2006
Posts: 181

Hi,

I watched the video on MACD, RSI and TSV divergences with Julia and Michael T.  I went to Michael T's blog and tried to save the layouts, but would not allow me, I suspect because I am Blocks user, not Stockfinder. 

Is there a chance that you can post the same layouts for Blocks or , alternatively,  the real code used in conditions.

Tx

Darko

Julia_O
Posted : Tuesday, April 14, 2009 9:30:15 PM


Worden Trainer

Joined: 4/26/2007
Posts: 508
dulakovic,

Code for the conditions follows.  Make sure you create variables for each necessary indicator before inserting the code.

Positive RSI Divergence:
'# Period = userinput.integer = 50
If price.Close = price.MinClose(period) And price.Close < price.MinClose(period, period) * 1.01 AndAlso _
 rsi.value = rsi.minlow(period) and rsi.value<30 and rsi.minlow(period) > rsi.MinLow(period, period) Then pass


Positive MACD Histogram Divergence:
'# Period = userinput.integer = 50
If price.Close = price.MinClose(period) And price.Close < price.MinClose(period, period) AndAlso _
 mh.value = mh.minlow(period) And mh.minlow(period) > mh.MinLow(period, period) + .5 Then pass


Positive MACD Divergence:
'# Period = userinput.integer = 50
If price.Close = price.MinClose(period) And price.Close < price.MinClose(period, period) * 1.01 AndAlso _
 macd.value = macd.minlow(period) and macd.minlow(period) > macd.MinLow(period, period) + .5 Then pass

Negative MACD Divergence:
'# Period = userinput.integer = 50
If price.Close = price.maxClose(period) And price.Close > price.maxClose(period, period) * .99 AndAlso _
 macd.value = macd.maxhigh(period) And macd.maxhigh(period) < macd.maxhigh(period, period) Then pass


Try copying and pasting the code above so that all characters (including spaces) stay in tact.  

Please let us know if you have any issues.

Best,
Julia
dulakovic
Posted : Tuesday, April 14, 2009 10:52:43 PM
Registered User
Joined: 11/29/2006
Posts: 181

I must be doing something wrong because it gives me a signal at wrong places.

I opened the real code and dragged the MACD indicator from the pane into the real code. I got the following copied into the real code: '# MACD = indicator.MACD.5
Than I just copied and pasted above code into the real code. The whole code looks like this:

'# MACD = indicator.MACD.5
'*********************************************
'* if Price.Close > Price.Close(1) then Pass *
'*********************************************

'# Period = userinput.integer = 50
If price.Close = price.MinClose(period) And price.Close < price.MinClose(period, period) * 1.01 AndAlso _  macd.value = macd.minlow(period) And macd.minlow(period) > macd.MinLow(period, period) + .5 Then pass


I am geting the signals, they are just not at the location of the divergences. I am wondering what is wrong. I am using simple MACD 12,26.

I did not understand what you meant with "creating variables for each necessary indicator before inserting the code", maybe that is wrong. 

I appologize for probably trivial questions, I am completely new with the real code editor.

Julia_O
Posted : Wednesday, April 15, 2009 2:20:03 PM


Worden Trainer

Joined: 4/26/2007
Posts: 508
dulakovic,

This is not a trivial question at all!  This rule will identify any stock with a divergence based on the math included in the code.  As we discussed in the webinar, this means that some of the stocks that are marked will not qualify as divergences you like, because the divergence marked won't spot two nice ruley bottoms in price or macd.  This rule does provide a nice basic screener, though, and you should be able to easily look through the resulting stocks to find those divergences that do look like the ones we're in search of.

That said, the default period used here was 50, and I found that changing the period to something between 15 and 20 yeilded nice divergences within the current and recent market.

Hope that helps-
Julia
dulakovic
Posted : Wednesday, April 15, 2009 11:51:17 PM
Registered User
Joined: 11/29/2006
Posts: 181
Hi Julia,

Thank you for the explanation.

I do understand that the quality of the signal is a factor of the period selected and that we don't  always get a quality signal. You  explained that well in the video and in your answer. Having said that, I still think that I have done something wrong (or there is a different kind of problem) because the problem still exists -  I am getting the signals at completely wrong places. I tried to change periods, but signals created were not making any sense to me.

To be sure, I tried to re-create exactly the same signals for positive MACD divergence you had in the video for JPM, UPS, GS without success (you were using period 50). I did get some signals, but not the ones you did (mine were also in places without divergence). Something is wrong and I can not figure it out. The code  I am using is the same as I indicated in the previous post.

I am not sure where to go from here, I would appreciate any help. Please note I am Blocks user.

Thank you for your patience.

Darko
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.