Candlestick Pattern

Tasuki Gap

Introduction

Create a new Tasuki Gap 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 TasukiGap constructor.

TasukiGap()1/2

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

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

TasukiGap()2/2

            TasukiGap QuantConnect.Indicators.CandlestickPatterns.TasukiGap (
   )
        

Initializes a new instance of the TasukiGap 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 TasukiGap _tasukigap;

// In Initialize()
_tasukigap = new TasukiGap(name);
_tasukigap.Updated += IndicatorUpdateMethod;

RegisterIndicator(symbol, _tasukigap, Resolution.Daily);

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

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

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

// In Initialize()
_tasukigap = new TasukiGap();
symbol = AddEquity("SPY").Symbol;

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

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

Get Indicator Values

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

private TasukiGap _tasukigap;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_tasukigap = TasukiGap(symbol);

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

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

Visualization

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

private TasukiGap _tasukigap;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_tasukigap = TasukiGap(symbol);

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

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