Overall Statistics
Total Trades
2
Average Win
0%
Average Loss
-0.94%
Compounding Annual Return
-6.306%
Drawdown
21.200%
Expectancy
-1
Net Profit
-1.042%
Sharpe Ratio
0.024
Loss Rate
100%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
1.133
Beta
-57.584
Annual Standard Deviation
0.383
Annual Variance
0.147
Information Ratio
-0.027
Tracking Error
0.383
Treynor Ratio
0
Total Fees
$4.75
import numpy as np

### <summary>
### Basic template algorithm simply initializes the date range and cash. This is a skeleton
### framework you can use for designing an algorithm.
### </summary>
class BasicTemplateAlgorithm(QCAlgorithm):
    '''Basic template algorithm simply initializes the date range and cash'''

    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.SetStartDate(2018,1, 2)  #Set Start Date
        self.SetEndDate(2018,3,1)    #Set End Date
        self.SetCash(100000)           #Set Strategy Cash
        self.Portfolio.MarginModel = MarginCallModel.Null
        
        # Find more symbols here: http://quantconnect.com/data
        self.AddEquity("SPY", Resolution.Second)
        

    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.Portfolio.Invested:
            self.SetHoldings("SPY", 5)