Three White Soldiers


Function Name: three_white_soldiers

Tags: Three Bar Pattern

Category: Candlestick, Pattern

A bullish candlestick pattern that is used to predict the reversal of the current downtrend. This pattern consists of three consecutive long-bodied candlesticks that have closed higher than the previous day, with each session's open occurring within the body of the previous candle. These long-bodied candlesticks are a sign of the change in investor sentiment and are used by traders to confirm a shift in momentum. This pattern may form after a period of consolidation, which is still a valid sign of a move higher, but it is not as desirable as it would be if it were found at the end of a prolonged downtrend

Recognition Criteria:

1. Market is characterized by downtrend.

2. We see three consecutive long white candlesticks.

3. Each candlestick closes at a new high.


4. The opening of each candlestick is within the body of the previous day.


5. Each consecutive day closes near or at its highs.


The study averages AvgBodyHeightPeriod number of bars and uses that value as a baseline for body height. That baseline is multiplied with BodyHeightRelativeThresh and then compared with the height of the three bars. If each of the three bars' bodies is longer than the calculated value, then those bars are eligible.



AvgBodyHeightPeriod: How many body heights are averaged to formg the body length baseline.

LongBodyRelativeThresh: Baseline multiple used to form the threshold for "long body".

UpperShadowRelativeSize: Lower shadow relative to body size.

UseTrendCondition: If false, then first recognition criterion is not tested.

FirstCandleClosesNearHigh: If false, then first candle is not required to close near or at its high.

ShowTraderMark, ShowTraderBar: Display control flags







Default Value: 14  |  Minimum: 1  |  Maximum: 999


Type: Numeric



Default Value: 0.59999999999999998  |  Minimum: 0  |  Maximum: 100


Type: Numeric



Default Value: 0.40000000000000002  |  Minimum: 0  |  Maximum: 1


Type: Numeric



Default Value: -1


Type: Boolean



Default Value: -1


Type: Boolean



Default Value: -1


Type: Boolean



Default Value: -1


Type: Boolean