Candlestick Pattern

Gap Side By Side White

Introduction

Create a new Up/Down-gap side-by-side white lines 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 GapSideBySideWhite constructor.

GapSideBySideWhite()1/2

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

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

GapSideBySideWhite()2/2

            GapSideBySideWhite QuantConnect.Indicators.CandlestickPatterns.GapSideBySideWhite (
   )
        

Initializes a new instance of the GapSideBySideWhite 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 GapSideBySideWhite _gapsidebysidewhite;

// In Initialize()
_gapsidebysidewhite = new GapSideBySideWhite(name);
_gapsidebysidewhite.Updated += IndicatorUpdateMethod;

RegisterIndicator(symbol, _gapsidebysidewhite, Resolution.Daily);

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

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

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

// In Initialize()
_gapsidebysidewhite = new GapSideBySideWhite();
symbol = AddEquity("SPY").Symbol;

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

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

Get Indicator Values

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

private GapSideBySideWhite _gapsidebysidewhite;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_gapsidebysidewhite = GapSideBySideWhite(symbol);

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

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

Visualization

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

private GapSideBySideWhite _gapsidebysidewhite;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_gapsidebysidewhite = GapSideBySideWhite(symbol);

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

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