Marubozu
Marubozu is a single-bar candlestick pattern that has no wicks, representing consistent directional movement. [Discuss] 💬
// C# usage syntax
IReadOnlyList<CandleResult> results =
bars.ToMarubozu(minBodyPercent);Create a buffer list and add each bar as it arrives:
MarubozuList marubozuList = new(minBodyPercent);
// call from your WebSocket or SSE message handler
void OnBarReceived(IBar bar) => marubozuList.Add(bar);
// the list itself holds the results; fills as the handler runs
IReadOnlyList<CandleResult> results = marubozuList;See Buffer lists for the full usage guide.
Subscribe to a BarHub and add each bar as it arrives:
BarHub barHub = new();
MarubozuHub observer = barHub.ToMarubozuHub(minBodyPercent);
// call from your WebSocket or SSE message handler
void OnBarReceived(IBar bar) => barHub.Add(bar);
// results fill as the handler runs
IReadOnlyList<CandleResult> results = observer.Results;See Stream hubs for the full usage guide.
Parameters
| param | description |
|---|---|
minBodyPercentdouble | Optional. Minimum body size as a percent of total candle size. Example: 85% would be entered as 85 (not 0.85). Must be between 80 and 100, if specified. Default is 95. |
Historical price bars requirements
You must have at least one historical bar; however, more is typically provided since this is a chartable candlestick pattern.
bars is a collection of generic TBar historical price bars. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.
Response
IReadOnlyList<CandleResult>- This method returns a time series of all available indicator values for the
barsprovided. - It always returns the same number of elements as there are in the historical price bars.
- It does not return a single incremental indicator value.
- The candlestick pattern is indicated on dates where
MatchisMatch.BullSignalorMatch.BearSignal. PriceisCloseprice; however, all OHLCV elements are included inCandleProperties.- There is no intrinsic basis or confirmation signal provided for this pattern.
MarubozuList : IReadOnlyList<CandleResult>- The list itself holds the results, one for each bar or value added, in timestamp order.
- It keeps up to 100,000 results by default and drops the oldest beyond that; set
MaxListSizeto keep fewer. - The candlestick pattern is indicated on dates where
MatchisMatch.BullSignalorMatch.BearSignal. PriceisCloseprice; however, all OHLCV elements are included inCandleProperties.- There is no intrinsic basis or confirmation signal provided for this pattern.
IReadOnlyList<CandleResult> results = observer.Results;observer.Resultsholds the results, one for each bar in theBarHubcache, in timestamp order.- Results update as bars arrive, including bars that arrive late or are revised.
- The cache keeps up to 100,000 results by default; set
maxCacheSizeon theBarHubto keep fewer. - The candlestick pattern is indicated on dates where
MatchisMatch.BullSignalorMatch.BearSignal. PriceisCloseprice; however, all OHLCV elements are included inCandleProperties.- There is no intrinsic basis or confirmation signal provided for this pattern.
CandleResult
| property | description |
|---|---|
TimestampDateTime | Date from evaluated TBar |
Pricedecimal? | Price of the most relevant OHLC candle element when a signal is present |
MatchMatch | Indicates a matching signal type for this candlestick pattern |
CandleCandleProperties | Characteristics of the candle body and wicks |
Match
When a candlestick pattern is recognized, it produces a matching signal. In some cases, an intrinsic confirmation is also available after the signal. In cases where previous bars were used to identify a pattern, they are indicated as the basis for the signal. This enum can also be referenced as an int value. Documentation for each candlestick pattern will indicate whether confirmation and/or basis information is produced.
| enum / value | description |
|---|---|
Match.BullConfirmed200 | Confirmation of a prior bull signal |
Match.BullSignal100 | Bullish signal |
Match.BullBasis10 | Bars supporting a bullish signal |
Match.Neutral1 | Signal for non-directional patterns |
Match.None0 | No match |
Match.BearBasis-10 | Bars supporting a bearish signal |
Match.BearSignal-100 | Bearish signal |
Match.BearConfirmed-200 | Confirmation of a prior bear signal |
CandleProperties
The CandleProperties record class extends the basic Bar type with calculated properties.
| property | description |
|---|---|
TimestampDateTime | Close date |
Opendecimal | Open price |
Highdecimal | High price |
Lowdecimal | Low price |
Closedecimal | Close price |
Volumedecimal | Volume |
Sizedecimal? | High-Low |
Bodydecimal? | |Open-Close| |
UpperWickdecimal? | Upper wick size |
LowerWickdecimal? | Lower wick size |
BodyPctdouble? | Body/Size |
UpperWickPctdouble? | UpperWick/Size |
LowerWickPctdouble? | LowerWick/Size |
IsBullishbool | Close>Open direction |
IsBearishbool | Close<Open direction |
Utilities
Call these on the list itself, as in marubozuList.Find(lookupDate). .Condense() returns a new list and leaves marubozuList unchanged.
Warmup removal is left out. Once the list is full it drops its oldest results, so trimming by position would remove valid values.
Call these on observer.Results, as in observer.Results.Find(lookupDate). .Condense() returns a new list and leaves the hub's results unchanged.
Warmup removal is left out. Once the cache is full the hub drops its oldest results, so trimming by position would remove valid values.
See Utilities and helpers for more information.