Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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.
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
Guest-1 |