| 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.462 Tracking Error 0.119 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset |
from AlgorithmImports import *
class NasdaqImporterAlgorithm(QCAlgorithm):
def Initialize(self):
'''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''
self.nasdaqCode = "FRED/NAPM"
## Optional argument - personal token necessary for restricted dataset
# NasdaqDataLink.SetAuthCode(self.GetParameter("nasdaq-data-link-api-key"))
self.SetStartDate(2014,4,1) #Set Start Date
self.SetEndDate(2016,4,1) #Set End Date
self.SetCash(25000) #Set Strategy Cash
self.AddData(NasdaqCustomColumns, self.nasdaqCode, Resolution.Daily, TimeZones.NewYork)
def OnData(self, data):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''
if data.ContainsKey(self.nasdaqCode):
self.Plot("Data Chart", "NAPM", self.Securities[self.nasdaqCode].Price)
# NasdaqDataLink often doesn't use close columns so need to tell LEAN which is the "value" column.
class NasdaqCustomColumns(NasdaqDataLink):
'''Custom nasdaq data type for setting customized value column name. Value column is used for the primary trading calculations and charting.'''
def __init__(self):
self.ValueColumnName = "NAPM"