Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
28.536%
Drawdown
12.300%
Expectancy
0
Net Profit
29.423%
Sharpe Ratio
1.641
Probabilistic Sharpe Ratio
69.907%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.243
Beta
-0.053
Annual Standard Deviation
0.147
Annual Variance
0.022
Information Ratio
0.628
Tracking Error
0.329
Treynor Ratio
-4.504
Total Fees
$0.00
class CalibratedUncoupledRadiator(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.quandlCode = "LBMA/GOLD"
        ## Optional argument - personal token necessary for restricted dataset
        # Quandl.SetAuthCode("your-quandl-token")
        self.SetStartDate(2019,4,1)                                 #Set Start Date
        self.SetEndDate(datetime.today() - timedelta(1))            #Set End Date
        self.SetCash(25000)                                         #Set Strategy Cash
        self.AddData(QuandlCustomColumns, self.quandlCode, Resolution.Daily, TimeZones.NewYork)
        self.sma = self.SMA(self.quandlCode, 14)

    def OnData(self, data):
        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''
        if not self.Portfolio.HoldStock:
            self.SetHoldings(self.quandlCode, 1)
            self.Debug("Purchased {0} >> {1}".format(self.quandlCode, self.Time))

        self.Plot(self.quandlCode, "PriceSMA", self.sma.Current.Value)
        
# Quandl often doesn't use close columns so need to tell LEAN which is the "value" column.
class QuandlCustomColumns(PythonQuandl):
    '''Custom quandl data type for setting customized value column name. Value column is used for the primary trading calculations and charting.'''
    def __init__(self):
        # Define ValueColumnName: cannot be None, Empty or non-existant column name
        self.ValueColumnName = "USD (PM)"