Skip to main content Skip to footer

To create a new candlestick pattern a developer should create a new class and inherit it from BulkowskiCandlestickPatternBase class. Then a developer must implement the following things:

  • bool function IsPattern which defines rules of candlestick pattern detection;
  • property ResultSignalType which defines type the pattern signal;
  • property  NumberOfCandleLines which defines how many candles need for pattern detection;
  • property TrendDirection which defines leading trend direction; 
public class TestCandlestickPattern : BulkowskiCandlestickPatternBase
{
        public override SignalType ResultSignalType => SignalType.BullishReversal;
        public override int NumberOfCandleLines => 3;
        public override TrendDirection LeadingTrend => TrendDirection.Down;

        #region Overrides of BulkowskiCandlestickPatternBase

        /// <inheritdoc />
        protected override bool IsPattern(BarSeriesBackwardIndexer input)
        {
            //write your code here
            return true;
        }

        #endregion
}

Provided example shows how to create a candlestick pattern wich will consist of 3 candles and define bullish reversal when general trend is down. 

BarSeriesBackwardIndexer is a class that allows to use backward indexing working with bar series.

There is an object in the BulkowskiCandlestickPatternBase class, that can be helpful in candlestick pattern development. This object is Context that have type of BulkowskiCandlePatternCalculationContext.

Cookies Notice

We use cookies to improve your experience, personalize content, and analyze our traffic. By clicking "Accept All Cookies," you agree to the storing of cookies on your device. You can manage your cookie preferences at any time by visiting our Cookie Settings.