Hi All,
Just a short note to help potential QuantConnectors š.
When you read the documentation on candlestick patterns, it refers to SetCandleSettings without giving too much detail. So here it is. It refers to global settings used FOR ALL candlestick patterns and stored in a private dictionary. You can change those settings by calling:
CandleSettings.Set(CandleSettingType type, CandleSetting setting)
Set() here is a static method so you do not create an object first. You call it right like in the above.
The types are here:
BodyLong
Real body is long when it's longer than the average of the 10 previous candles' real body
BodyVeryLong
Real body is very long when it's longer than 3 times the average of the 10 previous candles' real body
BodyShort
Real body is short when it's shorter than the average of the 10 previous candles' real bodies
BodyDoji
Real body is like doji's body when it's shorter than 10% the average of the 10 previous candles' high-low range
ShadowLong
Shadow is long when it's longer than the real body
ShadowVeryLong
Shadow is very long when it's longer than 2 times the real body
ShadowShort
Shadow is short when it's shorter than half the average of the 10 previous candles' sum of shadows
ShadowVeryShort
Shadow is very short when it's shorter than 10% the average of the 10 previous candles' high-low range
Near
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"
Far
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"
Equal
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"
To specify each of those types, you do:
CandleSettingType.BodyLong
for instance.
Finally, a CandleSetting is created like this:
CandleSetting(CandleRangeType rangeType, int averagePeriod, decimal factor)
CandleRangeType can have the following values:
RealBody
The part of the candle between open and close
HighLow
The complete range of the candle
Shadows
The shadows (or tails) of the candle
Again, specified like this:
CandleRangeType.RealBody
for instance.
averagePeriod is āThe number of previous candles to averageā and factor is āA multiplier to calculate candle rangesā.
Note that the default values right now for CandleSettings are:
{ CandleSettingType.BodyLong, new CandleSetting(CandleRangeType.RealBody, 10, 1m) },
{ CandleSettingType.BodyVeryLong, new CandleSetting(CandleRangeType.RealBody, 10, 3m) },
{ CandleSettingType.BodyShort, new CandleSetting(CandleRangeType.RealBody, 10, 1m) },
{ CandleSettingType.BodyDoji, new CandleSetting(CandleRangeType.HighLow, 10, 0.1m) },
{ CandleSettingType.ShadowLong, new CandleSetting(CandleRangeType.RealBody, 0, 1m) },
{ CandleSettingType.ShadowVeryLong, new CandleSetting(CandleRangeType.RealBody, 0, 2m) },
{ CandleSettingType.ShadowShort, new CandleSetting(CandleRangeType.Shadows, 10, 1m) },
{ CandleSettingType.ShadowVeryShort, new CandleSetting(CandleRangeType.HighLow, 10, 0.1m) },
{ CandleSettingType.Near, new CandleSetting(CandleRangeType.HighLow, 5, 0.2m) },
{ CandleSettingType.Far, new CandleSetting(CandleRangeType.HighLow, 5, 0.6m) },
{ CandleSettingType.Equal, new CandleSetting(CandleRangeType.HighLow, 5, 0.05m) }
Fred
Fred Painchaud
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!