Contents
Candlestick Pattern
Concealed Baby Swallow
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 ConcealedBabySwallow
constructor.
ConcealedBabySwallow()1/2
ConcealedBabySwallow QuantConnect.Indicators.CandlestickPatterns.ConcealedBabySwallow (
string
name
)
Initializes a new instance of the ConcealedBabySwallow
class using the specified name.
ConcealedBabySwallow()2/2
ConcealedBabySwallow QuantConnect.Indicators.CandlestickPatterns.ConcealedBabySwallow ( )
Initializes a new instance of the ConcealedBabySwallow
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 ConcealedBabySwallow _concealedbabyswallow; // In Initialize() _concealedbabyswallow = new ConcealedBabySwallow(name); _concealedbabyswallow.Updated += IndicatorUpdateMethod; RegisterIndicator(symbol, _concealedbabyswallow, Resolution.Daily); // In IndicatorUpdateMethod() if (_concealedbabyswallow.IsReady) { var indicatorValue = _concealedbabyswallow.Current.Value; }
from QuantConnect.Indicators.CandlestickPatterns import ConcealedBabySwallow # In Initialize() self.concealedbabyswallow = ConcealedBabySwallow(name) self.concealedbabyswallow.Updated += self.IndicatorUpdateMethod self.RegisterIndicator(symbol, self.concealedbabyswallow, Resolution.Daily) # In IndicatorUpdateMethod() if self.concealedbabyswallow.IsReady: indicator_value = self.concealedbabyswallow.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 ConcealedBabySwallow _concealedbabyswallow; private Symbol symbol; // In Initialize() _concealedbabyswallow = new ConcealedBabySwallow(); symbol = AddEquity("SPY").Symbol; // In OnData() if (data.Bars.ContainsKey(_symbol)) { _concealedbabyswallow.Update(data.Bars[symbol]); } if (_concealedbabyswallow.IsReady) { var indicatorValue = _concealedbabyswallow.Current.Value; }
from QuantConnect.Indicators.CandlestickPatterns import ConcealedBabySwallow # In Initialize() self.concealedbabyswallow = ConcealedBabySwallow() self.symbol = self.AddEquity("SPY").Symbol # In OnData() if data.Bars.ContainsKey(self.symbol): self.concealedbabyswallow.Update(data.Bars[self.symbol]) if self.concealedbabyswallow.IsReady: indicator_value = self.concealedbabyswallow.Current.Value
Get Indicator Values
To get the value of the indicator, use its Current.Value
attribute.
private ConcealedBabySwallow _concealedbabyswallow; // In Initialize() var symbol = AddEquity("SPY").Symbol; _concealedbabyswallow = ConcealedBabySwallow(symbol); // In OnData() if (_concealedbabyswallow.IsReady) { var current = _concealedbabyswallow.Current.Value; }
# In Initialize() symbol = self.AddEquity("SPY").Symbol self.concealedbabyswallow = self.ConcealedBabySwallow(symbol) # In OnData() if self.concealedbabyswallow.IsReady: current = self.concealedbabyswallow.Current.Value
Visualization
To plot indicator values, in the OnData
event handler, call the Plot
method.
private ConcealedBabySwallow _concealedbabyswallow; // In Initialize() var symbol = AddEquity("SPY").Symbol; _concealedbabyswallow = ConcealedBabySwallow(symbol); // In OnData() if (_concealedbabyswallow.IsReady) { Plot("My Indicators", "concealedbabyswallow", _concealedbabyswallow.Current); }
# In Initialize() symbol = self.AddEquity("SPY").Symbol self.concealedbabyswallow = self.ConcealedBabySwallow(symbol) # In OnData() if self.concealedbabyswallow.IsReady: self.Plot("My Indicators", "concealedbabyswallow", self.concealedbabyswallow.Current)
For more information about plotting indicators, see Plotting Indicators.