Candlestick Pattern

High Wave Candle

Introduction

Create a new High-Wave Candle candlestick pattern indicator 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 HighWaveCandle constructor.

HighWaveCandle()1/2

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

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

HighWaveCandle()2/2

            HighWaveCandle QuantConnect.Indicators.CandlestickPatterns.HighWaveCandle (
   )
        

Initializes a new instance of the HighWaveCandle 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 HighWaveCandle _highwavecandle;

// In Initialize()
_highwavecandle = new HighWaveCandle(name);
_highwavecandle.Updated += IndicatorUpdateMethod;

RegisterIndicator(symbol, _highwavecandle, Resolution.Daily);

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

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

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

// In Initialize()
_highwavecandle = new HighWaveCandle();
symbol = AddEquity("SPY").Symbol;

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

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

Get Indicator Values

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

private HighWaveCandle _highwavecandle;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_highwavecandle = HighWaveCandle(symbol);

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

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

Visualization

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

private HighWaveCandle _highwavecandle;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_highwavecandle = HighWaveCandle(symbol);

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

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