Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
-1.598%
Drawdown
5.200%
Expectancy
0
Net Profit
-0.798%
Sharpe Ratio
-0.286
Probabilistic Sharpe Ratio
18.243%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.03
Beta
0.048
Annual Standard Deviation
0.053
Annual Variance
0.003
Information Ratio
-2.28
Tracking Error
0.139
Treynor Ratio
-0.316
Total Fees
$4.22
Estimated Strategy Capacity
$650000.00
Lowest Capacity Asset
IEF SGNKIKYGE9NP
### Note: I've already repeated this with SPY and QQQ
### please check notebook for comparison after completing backtests
### make sure all backtest must be in the same project, 
### otherwise you cannot retrieve ObjectStore data from other projects

import pandas as pd

class UpgradedLightBrownHippopotamus(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 1, 21)
        self.SetCash(100000) 
        self.AddEquity("IEF", Resolution.Minute)
        
        # set up a series to hold daily portfolio value
        self.dailyValue = pd.Series([self.Portfolio.TotalPortfolioValue], index=[self.Time])

    def OnData(self, data):
        if not self.Portfolio.Invested:
           self.SetHoldings("IEF", 1)
           
    def OnEndOfDay(self, symbol):
        # record on end of day by adding into series as last item
        value = pd.Series([self.Portfolio.TotalPortfolioValue], index=[self.Time])
        self.dailyValue = self.dailyValue.append(value)
        
    def OnEndOfAlgorithm(self):
        # save to objectstore on end of backtest
        jsonString = self.dailyValue.to_json(orient="columns")
        # it is a string object
        self.ObjectStore.Save("IEF backtest daily return", jsonString)
        
        self.Log(jsonString)