Candlestick Pattern
Three Stars In South
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 ThreeStarsInSouth
constructor.
ThreeStarsInSouth()1/2
ThreeStarsInSouth QuantConnect.Indicators.CandlestickPatterns.ThreeStarsInSouth (
string
name
)
Initializes a new instance of the ThreeStarsInSouth
class using the specified name.
ThreeStarsInSouth()2/2
ThreeStarsInSouth QuantConnect.Indicators.CandlestickPatterns.ThreeStarsInSouth ( )
Initializes a new instance of the ThreeStarsInSouth
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 ThreeStarsInSouth _threestarsinsouth; // In Initialize() _threestarsinsouth = new ThreeStarsInSouth(name); _threestarsinsouth.Updated += IndicatorUpdateMethod; RegisterIndicator(symbol, _threestarsinsouth, Resolution.Daily); // In IndicatorUpdateMethod() if (_threestarsinsouth.IsReady) { var indicatorValue = _threestarsinsouth.Current.Value; }
from QuantConnect.Indicators.CandlestickPatterns import ThreeStarsInSouth # In Initialize() self.threestarsinsouth = ThreeStarsInSouth(name) self.threestarsinsouth.Updated += self.IndicatorUpdateMethod self.RegisterIndicator(symbol, self.threestarsinsouth, Resolution.Daily) # In IndicatorUpdateMethod() if self.threestarsinsouth.IsReady: indicator_value = self.threestarsinsouth.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 ThreeStarsInSouth _threestarsinsouth; private Symbol symbol; // In Initialize() _threestarsinsouth = new ThreeStarsInSouth(); symbol = AddEquity("SPY").Symbol; // In OnData() if (data.Bars.ContainsKey(_symbol)) { _threestarsinsouth.Update(data.Bars[symbol]); } if (_threestarsinsouth.IsReady) { var indicatorValue = _threestarsinsouth.Current.Value; }
from QuantConnect.Indicators.CandlestickPatterns import ThreeStarsInSouth # In Initialize() self.threestarsinsouth = ThreeStarsInSouth() self.symbol = self.AddEquity("SPY").Symbol # In OnData() if data.Bars.ContainsKey(self.symbol): self.threestarsinsouth.Update(data.Bars[self.symbol]) if self.threestarsinsouth.IsReady: indicator_value = self.threestarsinsouth.Current.Value
Get Indicator Values
To get the value of the indicator, use its Current.Value
attribute.
private ThreeStarsInSouth _threestarsinsouth; // In Initialize() var symbol = AddEquity("SPY").Symbol; _threestarsinsouth = ThreeStarsInSouth(symbol); // In OnData() if (_threestarsinsouth.IsReady) { var current = _threestarsinsouth.Current.Value; }
# In Initialize() symbol = self.AddEquity("SPY").Symbol self.threestarsinsouth = self.ThreeStarsInSouth(symbol) # In OnData() if self.threestarsinsouth.IsReady: current = self.threestarsinsouth.Current.Value