| Overall Statistics |
|
Total Trades 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Net Profit 0% Sharpe Ratio 0 Probabilistic Sharpe Ratio 0% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0 Beta 0 Annual Standard Deviation 0 Annual Variance 0 Information Ratio 0 Tracking Error 0 Treynor Ratio 0 Total Fees $0.00 |
class HorizontalTransdimensionalRegulators(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2019, 12, 1)
self.SetEndDate(2019, 12, 3)# Set Start Date
self.SetCash(100000) # Set Strategy Cash
resolution = Resolution.Hour
symbol = 'EURUSD'
self.AddForex(symbol, Resolution.Hour, Market.Oanda)
self.indicators_dict = {}
self.indicators_dict['rsi'] = self.RSI(symbol, 14, resolution)
self.indicators_dict['adx'] = self.ADX(symbol, 14, resolution)
# self.AddEquity("SPY", Resolution.Minute)
def OnData(self, data):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:
data: Slice object keyed by symbol containing the stock data
'''
if not self.indicators_dict['rsi'].IsReady:
return
error_data = 0
try:
rsi_rsi = float(self.indicators_dict['rsi'].Current.Value)
rsi_avegain = float(self.indicators_dict['rsi'].AverageGain.Current.Value)
rsi_aveloss = float(self.indicators_dict['rsi'].AverageLoss.Current.Value)
adx_positive = float(self.indicators_dict['adx'].PositiveDirectionalIndex.Current.Value)
adx_negative = float(self.indicators_dict['adx'].NegativeDirectionalIndex.Current.Value)
adx_ave = float(self.indicators_dict['adx'].Current.Value)
except:
error_data = 1
return
self.Debug('Time: {0}, RSI: {1}, ADX: {2}'.format(self.Time, rsi_rsi, adx_ave))
# if not self.Portfolio.Invested:
# self.SetHoldings("SPY", 1)