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