Candlestick Pattern

Three Black Crows

Introduction

Create a new Three Black Crows candlestick pattern to indicate the pattern's presence.

Create Manual Indicators

A candlestick pattern indicator requires manual creation and update with a TradeBar object. Manual indicators let you update their values with any data you choose. The following reference table describes the ThreeBlackCrows constructor.

ThreeBlackCrows()1/2

            ThreeBlackCrows QuantConnect.Indicators.CandlestickPatterns.ThreeBlackCrows (
     string  name
   )
        

Initializes a new instance of the ThreeBlackCrows class using the specified name.

ThreeBlackCrows()2/2

            ThreeBlackCrows QuantConnect.Indicators.CandlestickPatterns.ThreeBlackCrows (
   )
        

Initializes a new instance of the ThreeBlackCrows class.

Update Manual Indicators

You can update the indicator automatically or manually.

Automatic Update

To register a manual indicator for automatic updates with the security data, call the RegisterIndicator method.

using QuantConnect.Indicators.CandlestickPatterns;

private ThreeBlackCrows _threeblackcrows;

// In Initialize()
_threeblackcrows = new ThreeBlackCrows(name);
_threeblackcrows.Updated += IndicatorUpdateMethod;

RegisterIndicator(symbol, _threeblackcrows, Resolution.Daily);

// In IndicatorUpdateMethod()
if (_threeblackcrows.IsReady)
{
    var indicatorValue = _threeblackcrows.Current.Value;
}
from QuantConnect.Indicators.CandlestickPatterns import ThreeBlackCrows
    
# In Initialize()
self.threeblackcrows = ThreeBlackCrows(name)
self.threeblackcrows.Updated += self.IndicatorUpdateMethod

self.RegisterIndicator(symbol, self.threeblackcrows, Resolution.Daily)

# In IndicatorUpdateMethod()
if self.threeblackcrows.IsReady:
    indicator_value = self.threeblackcrows.Current.Value

To customize the data that automatically updates the indicator, see Custom Indicator Periods and Custom Indicator Values.

Manual Update

Updating your indicator manually enables you to control when the indicator is updated and what data you use to update it. To manually update the indicator, call the Update method with a TradeBar. The indicator will only be ready after you prime it with enough data.

using QuantConnect.Indicators.CandlestickPatterns;
    
private ThreeBlackCrows _threeblackcrows;
private Symbol symbol;

// In Initialize()
_threeblackcrows = new ThreeBlackCrows();
symbol = AddEquity("SPY").Symbol;

// In OnData()
if (data.Bars.ContainsKey(_symbol))
{
    _threeblackcrows.Update(data.Bars[symbol]);
}
if (_threeblackcrows.IsReady)
{
    var indicatorValue = _threeblackcrows.Current.Value;
}
from QuantConnect.Indicators.CandlestickPatterns import ThreeBlackCrows
    
# In Initialize()
self.threeblackcrows = ThreeBlackCrows()
self.symbol = self.AddEquity("SPY").Symbol

# In OnData()
if data.Bars.ContainsKey(self.symbol):
    self.threeblackcrows.Update(data.Bars[self.symbol])
if self.threeblackcrows.IsReady:
    indicator_value = self.threeblackcrows.Current.Value

Get Indicator Values

To get the value of the indicator, use its Current.Value attribute.

private ThreeBlackCrows _threeblackcrows;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_threeblackcrows = ThreeBlackCrows(symbol);

// In OnData()
if (_threeblackcrows.IsReady)
{
    var current = _threeblackcrows.Current.Value;
}
# In Initialize()
symbol = self.AddEquity("SPY").Symbol
self.threeblackcrows = self.ThreeBlackCrows(symbol)

# In OnData()
if self.threeblackcrows.IsReady:
    current = self.threeblackcrows.Current.Value

Visualization

To plot indicator values, in the OnData event handler, call the Plot method.

private ThreeBlackCrows _threeblackcrows;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_threeblackcrows = ThreeBlackCrows(symbol);

// In OnData()
if (_threeblackcrows.IsReady)
{
    Plot("My Indicators", "threeblackcrows", _threeblackcrows.Current);
}
# In Initialize()
symbol = self.AddEquity("SPY").Symbol
self.threeblackcrows = self.ThreeBlackCrows(symbol)

# In OnData()
if self.threeblackcrows.IsReady:
    self.Plot("My Indicators", "threeblackcrows", self.threeblackcrows.Current)

For more information about plotting indicators, see Plotting Indicators.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: