Hello,
I would like to make an indicator that essentially returns the # of candlepattern matches over N bars in the past. Im having trouble with getting it going.. Right now i would use something like the following on each bar to execute and get if there IS a candlepattern that matches.
CODE:
Please log in to see this code.
If i go to visual studio, i can create indicators, but what I am stuck on, first of all, is that I pass "this" to the Candle function, which is the wealthscript... What would "this" be in the custom indicator?
2. I would like to make all the candle functions once in a helper method, and then basically my psuedo code would be.. for each bar, getNumberOfBearishCandles(bar);
this would return an int, which i would set as the OHLC values for this indicators bar.
CODE:
Please log in to see this code.
Size:
Color:
Hello,
1 - CandlePattern requires an instance of WealthScript which is not available in an Indicator. As a workaround, you could re-code the candle pattern from scratch in your indicator.
Size:
Color:
OK, thanks Eugene, just wanted to verify that the CandlePattern code is currently not open source correct?
Size:
Color:
The Wealth Lab rules class contains CandlePattern methods. If I am not mistaken, every static candlepattern method has an array parameter passed by reference that indicates how many times the pattern shows up during the length of the bars object. So, just examine this array and count the number of times the pattern occurs.
QUOTE:
I would like to make an indicator that essentially returns the # of candlepattern matches over N bars in the past.
Why not just count the number times it occurs in the array? Am I missing something?
Size:
Color:
QUOTE:
OK, thanks Eugene, just wanted to verify that the CandlePattern code is currently not open source correct?
Sorry, it's closed source.
Size:
Color:
Hi Eugene,
Understand that it is closed source, but am I able to read the default settings of each pattern? Settings such as 65% would be classified as a long tail, 10% body would be called a doji, etc. Checked the manual, not mentioned there.
And if there is a place to read these default settings, is there a place in the CandlePattern rule to input customized parameters? thanks!
cheers,
Stanley Wang
Size:
Color:
Hi Stanley,
Unfortunately, the answer to both questions is no.
Size:
Color:
No matter what percentages you use, patterns are subjective. Even the Candlestick pattern "bible" (Beyond Candlesticks by Nisson) isn't precise in defining relationships between bodies, shadows, etc. As Eugene pointed out, there is currently no easy way to change these relationships (they are hard-coded based on a library build for Wealth-Lab 4 more than a decade ago). Nonetheless, I don't see a good reason to keep the code for this particular module a secret, so we'll discuss that internally.
For now, if the Candlestick.Rules don't detect the patterns that you're interested in, I'd recommended building your own rules in a script for those specific patterns.
Size:
Color: