Candlestick patterns #220
Replies: 9 comments 29 replies
-
Hi, I started exploring Candlestick patterns and it's very useful for trading and it's helpful to identify trading opportunities. For a long shadow, we have a formula of 2/3 or more of the total range but not for the Hammer. I think it will be very useful to have dynamic configurations (with default values) for these thresholds and the user chooses values based on his requirements. I hope again that I'm not out of the box. |
Beta Was this translation helpful? Give feedback.
-
Hi Dave, I take a look at the TA-Lib C++ project and I found this piece of code. And I just wanted to share this with the community, because I was a little surprised. What do you think? const TA_CandleSetting TA_CandleDefaultSettings[] = {
/* real body is long when it's longer than the average of the 10 previous candles' real body */
{ TA_BodyLong, TA_RangeType_RealBody, 10, 1.0 },
/* real body is very long when it's longer than 3 times the average of the 10 previous candles' real body */
{ TA_BodyVeryLong, TA_RangeType_RealBody, 10, 3.0 },
/* real body is short when it's shorter than the average of the 10 previous candles' real bodies */
{ TA_BodyShort, TA_RangeType_RealBody, 10, 1.0 },
/* real body is like doji's body when it's shorter than 10% the average of the 10 previous candles' high-low range */
{ TA_BodyDoji, TA_RangeType_HighLow, 10, 0.1 },
/* shadow is long when it's longer than the real body */
{ TA_ShadowLong, TA_RangeType_RealBody, 0, 1.0 },
/* shadow is very long when it's longer than 2 times the real body */
{ TA_ShadowVeryLong, TA_RangeType_RealBody, 0, 2.0 },
/* shadow is short when it's shorter than half the average of the 10 previous candles' sum of shadows */
{ TA_ShadowShort, TA_RangeType_Shadows, 10, 1.0 },
/* shadow is very short when it's shorter than 10% the average of the 10 previous candles' high-low range */
{ TA_ShadowVeryShort, TA_RangeType_HighLow, 10, 0.1 },
/* when measuring distance between parts of candles or width of gaps */
/* "near" means "<= 20% of the average of the 5 previous candles' high-low range" */
{ TA_Near, TA_RangeType_HighLow, 5, 0.2 },
/* when measuring distance between parts of candles or width of gaps */
/* "far" means ">= 60% of the average of the 5 previous candles' high-low range" */
{ TA_Far, TA_RangeType_HighLow, 5, 0.6 },
/* when measuring distance between parts of candles or width of gaps */
/* "equal" means "<= 5% of the average of the 5 previous candles' high-low range" */
{ TA_Equal, TA_RangeType_HighLow, 5, 0.05 }
}; |
Beta Was this translation helpful? Give feedback.
-
https://csharp.hotexamples.com/examples/-/ATArray/-/php-atarray-class-examples.html With the help of above code I made changes as per my requirement. |
Beta Was this translation helpful? Give feedback.
-
this is what I have in my current system, if you think this is worth please include this in your code.
|
Beta Was this translation helpful? Give feedback.
-
Just as an update, @metathron is working on a baseline set of candlestick patterns. Once we have a baseline approach established, we'll be able to add more incrementally. |
Beta Was this translation helpful? Give feedback.
-
I'm going to incrementally start working on these now. There are quite a few to consider and would love some help on these if anyone is interested in contributing. To start, I'll do a few of these to establish a baseline approach that anyone can follow. I'll also put these in the Backlog in a prioritized manner, starting with the simpler ones. I don't suspect that I'll do the "complex" ones, but will take a look after the easier patterns are implemented. If you want to contribute:
I'm pulling recipes from these publicly available sources:
# Single Candlestick patterns:
Marubozu
Bullish Marubozu
Bearish Marubozu
Doji
Spinning Tops
Paper umbrella
Hammer
Hanging man
Shooting star
# Combination patterns:
Engulfing pattern
Bullish Engulfing
Bearish Engulfing
Harami
Bullish Harami
Bearish Harami
Piercing Pattern
Dark cloud cover
Morning Star
Evening Star
# Complex Reversal patterns:
Double Top Reversal
Double Bottom Reversal
Head and Shoulders Top
Head and Shoulders Bottom
Falling Wedge
Rising Wedge
Rounding Bottom
Triple Top Reversal
Triple Bottom Reversal
Bump and Run Reversal
# Complex Continuation patterns:
Flag, Pennant
Symmetrical Triangle
Ascending Triangle
Descending Triangle
Rectangle
Price Channel
Measured Move - Bullish
Measured Move - Bearish
Cup with Handle
# TA-LIB legacy
CDL2CROWS Two Crows
CDL3BLACKCROWS Three Black Crows
CDL3INSIDE Three Inside Up/Down
CDL3LINESTRIKE Three-Line Strike
CDL3OUTSIDE Three Outside Up/Down
CDL3STARSINSOUTH Three Stars In The South
CDL3WHITESOLDIERS Three Advancing White Soldiers
CDLABANDONEDBABY Abandoned Baby
CDLADVANCEBLOCK Advance Block
CDLBELTHOLD Belt-hold
CDLBREAKAWAY Breakaway
CDLCLOSINGMARUBOZU Closing Marubozu
CDLCONCEALBABYSWALL Concealing Baby Swallow
CDLCOUNTERATTACK Counterattack
CDLDARKCLOUDCOVER Dark Cloud Cover
CDLDOJI Doji
CDLDOJISTAR Doji Star
CDLDRAGONFLYDOJI Dragonfly Doji
CDLENGULFING Engulfing Pattern
CDLEVENINGDOJISTAR Evening Doji Star
CDLEVENINGSTAR Evening Star
CDLGAPSIDESIDEWHITE Up/Down-gap side-by-side white lines
CDLGRAVESTONEDOJI Gravestone Doji
CDLHAMMER Hammer
CDLHANGINGMAN Hanging Man
CDLHARAMI Harami Pattern
CDLHARAMICROSS Harami Cross Pattern
CDLHIGHWAVE High-Wave Candle
CDLHIKKAKE Hikkake Pattern
CDLHIKKAKEMOD Modified Hikkake Pattern
CDLHOMINGPIGEON Homing Pigeon
CDLIDENTICAL3CROWS Identical Three Crows
CDLINNECK In-Neck Pattern
CDLINVERTEDHAMMER Inverted Hammer
CDLKICKING Kicking
CDLKICKINGBYLENGTH Kicking - bull/bear determined by the longer marubozu
CDLLADDERBOTTOM Ladder Bottom
CDLLONGLEGGEDDOJI Long Legged Doji
CDLLONGLINE Long Line Candle
CDLMARUBOZU Marubozu
CDLMATCHINGLOW Matching Low
CDLMATHOLD Mat Hold
CDLMORNINGDOJISTAR Morning Doji Star
CDLMORNINGSTAR Morning Star
CDLONNECK On-Neck Pattern
CDLPIERCING Piercing Pattern
CDLRICKSHAWMAN Rickshaw Man
CDLRISEFALL3METHODS Rising/Falling Three Methods
CDLSEPARATINGLINES Separating Lines
CDLSHOOTINGSTAR Shooting Star
CDLSHORTLINE Short Line Candle
CDLSPINNINGTOP Spinning Top
CDLSTALLEDPATTERN Stalled Pattern
CDLSTICKSANDWICH Stick Sandwich
CDLTAKURI Takuri (Dragonfly Doji with very long lower shadow)
CDLTASUKIGAP Tasuki Gap
CDLTHRUSTING Thrusting Pattern
CDLTRISTAR Tristar Pattern
CDLUNIQUE3RIVER Unique 3 River
CDLUPSIDEGAP2CROWS Upside Gap Two Crows
CDLXSIDEGAP3METHODS Upside/Downside Gap Three Methods |
Beta Was this translation helpful? Give feedback.
-
Hi Dave. regards the TA-LIB and the exisiting Candlestick signal/identification. Would it be REALLY bad form to create a wrapper over TA-LIB and use a Quotes extension method to use both libraries in conjunction?? My thinking here is that the TA-LIB functions could be consumed by the extension methods in the 1st instance and then, as time passes/collaboration, the implementations could be replaced with native Skender functionality. Below is a basic example that I was attempting to use to highlight the approach: CandleSignal class for now purely mimics the TA-LIB properties in name. Obviously, that would be formalised into a Skender coding standard. usage:
TBH - i don't fully understand the TA-LIB implementation as the docs are quite thin, also, my method is of course lacking in lots of defensive checks - but hopefully you get the gist. |
Beta Was this translation helpful? Give feedback.
-
Has anyone taken a look at our implementation of the Marubozu candlestick pattern? Feedback appreciated. I may start looking at implementing these again soon but wanted to make sure we have a good baseline approach before proceeding. @metathron, I've been holding a bunch for you, but it's been a while, so I'll be releasing that hold soon for the sake of progress. |
Beta Was this translation helpful? Give feedback.
-
Candlestick patterns are a unique form of price analysis. I'm opening this discussion to get feedback and to discuss development issues on this category of indicators. We're adding these to v1.x. Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions