Overall Statistics Total Trades1Average Win0%Average Loss0%Compounding Annual Return3053.437%Drawdown3.000%Expectancy0Net Profit1.908%Sharpe Ratio12.298Loss Rate0%Win Rate0%Profit-Loss Ratio0Alpha0.559Beta113.013Annual Standard Deviation0.13Annual Variance0.017Information Ratio12.247Tracking Error0.13Treynor Ratio0.014Total Fees\$298.35
```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,6,1)  #Set Start Date
self.SetEndDate(2018,6,2)    #Set End Date
self.SetCash(100000)           #Set Strategy Cash

self.SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash)

self.period = 20

self.SetWarmUp(2000)

# ...other initialization...
consolidator.DataConsolidated += self.OnDataConsolidated

self._atr = AverageTrueRange("BTCUSD", self.period)
self.RegisterIndicator("BTCUSD", self._atr, consolidator)

self.PlotIndicator("ATR", self._atr)

def OnDataConsolidated(self, sender, bar):
self.Debug(str(self.Time) + " > New Bar!")
self.Debug(str(bar.High))
self.Debug(str(bar.Low))
self.Debug(str(bar.Open))
self.Debug(str(bar.Close))

if not self.Portfolio.Invested:
self.SetHoldings("BTCUSD", 1)

def OnData(self, data):
pass