WealthLab.Rules.Candlesticks Q&A
Author: hlh
Creation Date: 12/17/2010 3:21 AM
profile picture

hlh

#1
Hi

1) Can CandlePattern be used after SetScaleDaily() on intrady data? I get a runtime error: Index was outside the bounds.

1.1) Adding Synchronize( xy ) after RestoreScale() gives me error CS1502 and 1503. Seems xy (=the select candle pattern) is not a DataSeries?


2)Is there a source code for WealthLab.Rules.Candlesticks to see how the patterns are coded?

3) Is there some kind of Intellisense when using/typing CandlePattern.? Or where, besides help, can I find what candle patterns are included (if not under 2) above)?

4) If WealthLab.Rules.Candlesticks cannot be used on different intervals what would be the best approach?

Thanks!

profile picture

Cone

#2
1) They're designed to operate on this, i.e., the WealthScript instance, so the answer is no I'm afraid.

2) Of course there is source code, but it's not open source. If there's a particular rule that isn't described well enough, then we can answer that question.

3) It's a shame intellisense doesn't work with all components. Specifically, I think they're the components loaded via Reflection that don't, like Rules.Candlesticks. Anyway, all the Rules are in the Strategy Builder as well as in the Programming Guide, where you'll also find the syntax.

4) It would take an enhancement to work with multi-timeframes from within the component. At this point, it's probably easiest use Rules.Candlesticks for the base time frame and program the patterns that you're interested in specifically for the Daily scale - get the Daily Bars, detect your patterns by putting them in a DataSeries, RestoreScale(), and synch it back to the intraday scale.
profile picture

hlh

#3
Thank you for the information!

2) and 4)

I will have to program the patterns by myself (but even if I would use the integrated ones it would be nice to know): Having the definitions for certain patterns (like what percentage of body length, and compared to what average (period), ...) would be extremly helpful.

If this cannot be disclosed publicly for whatever reason I would appreciate a PM or maybe some code from good old WL4 where I might find the definitions for some candle patterns?

Thanks!
profile picture

Cone

#4
Sure, if you have WL4, the Rules were transcribed from there (although they were optimized and refactored significantly). Just create a script with the rule that you're interested in and all the details will be right there in your Editor.

There have been some corrections to a few of the patterns. The one main one that comes to mind is to use 2*ATR to determine if a candle is "Long". I think it was only 1 ATR in 4x.
profile picture

hlh

#5
Where can I find it/what script is it? Is it Candle Tags v2.0 dated 7/14/2003?
profile picture

Cone

#6
Published 4x code is still at wl4.wealth-lab.com. Candle Tags v2.0 does not use our Candlestick Rules. In this case, it's a plus for you since all the code is right there for you to see.
profile picture

gchudublin

#7
Cone, above link for Candle Tags v2.0 not working, would you please relink it?
profile picture

Eugene

#8
Sorry, it cannot be relinked. The old wl4 website is gone for good.
profile picture

rtink

#9
For BearishHangingMan

CODE:
Please log in to see this code.




If I run it on the daily chart for TQQQ - it doesn't see 9/2/2020 as a Bearish Hanging man - why not? Seems like it should be

Thanks

Randy
profile picture

Cone

#10
Hi Randy,
The thing about programmed candlestick patterns, there is no subjectivity. Sure, that could be a Bearish Hanging man, but the way it's programmed, it's not because the body is considered a doji, and so this pattern actually turns out to be a "Reversal Dragonfly Doji" (in the Candlesticks Other group).

In our Candlestick rules, a doji is determined like this (pseudo code):

CODE:
Please log in to see this code.
... which basically identifies a Doji if the real body is less than 10% of the bar's range.

If that doji condition were reduced to 5% (0.05), then the TQQQ bar in question would not be a doji and would have been identified as a bearish hanging man. Anyway, add the Reversal Dragonfly Doji condition with an OR divider and you'll be sure to get both.
profile picture

rtink

#11
Got it thanks - just trying to understand the logic behind the candlestick patterns.

This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).