In a down trend, as far as I know the divergence between MACD and price trough generates the trade signal with high probability in the Elliot wave 3. Since Elliot wave is subject, I try to use OpenCloseIndicator to replace the condition of Elliot wave 3. OCI equals to sum(open)-sum(close).
To detect the divergence, I uses TroughDivergence in community.components. However, the divergence can not be showed properly as I expected.
I want to upload attachments to get your help, how can I do that please? And, is there any other functions better than troughdivergence? Thanks.
Size:
Color:
No attachments currently but if that's an image, you could post the image link obtained from any image hoster out there.
Size:
Color:
Size:
Color:
Hi Eugene,
You've been very helpful. I will look through the link you provided above.
The problem I have, is the strategy generates trading signals much more than my expectation. What I expect is, the trough divergence between MACD and price (PlotTroughDivergence==-1), oci is less than -100, both conditions trigger buying signals. In my understanding, on the chart, the trade signals are the places where exist divergence line(MACDPane and Price Pane) and oci is below -100. But there are two many signals showed on the chart. Here is the link:
http://imageshack.us/f/838/picgt.jpg/
From the chart, it is supposed to signal three times. But you can see many signals on this chart.
Here is the code.
CODE:
Please log in to see this code.
I guess it is because of the condition of BuyAtMarket, but I don't know what is wrong. Thanks for your help again.
Size:
Color:
Size:
Color:
QUOTE:
What I expect is, the trough divergence between MACD and price (PlotTroughDivergence==-1), oci is less than -100,
But your code, in contrast to your expectations, takes trades in the "either Divergence or OCI" manner:
CODE:
Please log in to see this code.
The "and" operator in C# is & (or &&):
CODE:
Please log in to see this code.
Size:
Color:
Thank you so much. You are great!
But after I changed it the trading signals are less than my expectation. Here is the picture: http://imageshack.us/f/832/pic2wn.jpg/
I have two questions if you look at this chart. There are two divergences, I call them A and B. For Divergence B, there is no trading signal with oci < -100. For Divergence A, in my understanding, on price pane, the lowest green bar is supposed to be the end of the Divergence A, so the buy signal should be triggered at the next day rather than two days later. Is there anything wrong here?
To help you to clarify what is the problem. Here is the index data I used.
https://docs.google.com/open?id=0B3nvPJ30rJORMmNlMWMwOWQtZDk2MC00NmY3LTgwNjgtMDIyMTk3NDUzNDU0Thanks again for your help.
Size:
Color:
QUOTE:
For Divergence B, there is no trading signal
Double check your position sizing. Make sure you've read the User Guide chapter on 100% sizing too.
Size:
Color:
I checked Position zing. It is Raw Profit Mode, fixed dollar 100000. Margin Factor 1 to 1.
I looked at the divergence B again. I am wondering, which bar is the end of the divergence? The end of divergence B on price pane is Oct 28 2008. However, it sounds, the end of divergence B on MACD Pane is Nov 5, where oci >-100. Is it? Which bar is the end of divergence please? I guess it is the key.
Size:
Color:
QUOTE:
the lowest green bar is supposed to be the end of the Divergence A, so the buy signal should be triggered at the next day rather than two days later. Is there anything wrong here?
Absolutely nothing. Internally the technique is built on
Peak/
Trough, so you're welcome to learn more on their Wiki help pages (namely "Calculation" section).
QUOTE:
I checked Position zing. It is Raw Profit Mode. Margin Factor 1 to 1.
Then the indicator on the bar preceding the signal was not below -100. Insert a PrintDebug call on top of BuyAtMarket with the bar number and indicator value and the concern will naturally be solved.
Size:
Color:
I will look at the Peak/Trough wiki help pages.
About the PrintDebug, do you have any example? I know my question is very simple. :)
I opened Data Window. The divergence B doesn't generate TroughDivergence -1. That means this function has some bug. Can I say that?
Thanks again.
Size:
Color:
In the QuickRef, of course.
Size:
Color:
Gocha! :) Thanks.
Size:
Color: