Candlestick Pattern

Stalled Pattern

Introduction

Create a new Stalled Pattern 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 StalledPattern constructor.

StalledPattern()1/2

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

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

StalledPattern()2/2

            StalledPattern QuantConnect.Indicators.CandlestickPatterns.StalledPattern (
   )
        

Initializes a new instance of the StalledPattern 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 StalledPattern _stalledpattern;

// In Initialize()
_stalledpattern = new StalledPattern(name);
_stalledpattern.Updated += IndicatorUpdateMethod;

RegisterIndicator(symbol, _stalledpattern, Resolution.Daily);

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

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

# In IndicatorUpdateMethod()
if self.stalledpattern.IsReady:
    indicator_value = self.stalledpattern.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 StalledPattern _stalledpattern;
private Symbol symbol;

// In Initialize()
_stalledpattern = new StalledPattern();
symbol = AddEquity("SPY").Symbol;

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

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

Get Indicator Values

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

private StalledPattern _stalledpattern;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_stalledpattern = StalledPattern(symbol);

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

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

Visualization

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

private StalledPattern _stalledpattern;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_stalledpattern = StalledPattern(symbol);

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

# In OnData()
if self.stalledpattern.IsReady:
    self.Plot("My Indicators", "stalledpattern", self.stalledpattern.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: