Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
442.092%
Drawdown
36.100%
Expectancy
0
Net Profit
2563.743%
Sharpe Ratio
2.311
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.091
Beta
0.928
Annual Standard Deviation
0.577
Annual Variance
0.333
Information Ratio
-0.024
Tracking Error
0.218
Treynor Ratio
1.437
Total Fees
$24.94
import clr
clr.AddReference("System")
clr.AddReference("QuantConnect.Algorithm")
clr.AddReference("QuantConnect.Indicators")
clr.AddReference("QuantConnect.Common")

from System import *
import numpy as np
from QuantConnect import *
from QuantConnect.Algorithm import *
from QuantConnect.Indicators import *
import decimal as d

### <summary>
### A reproduction of setBenchmark not working for BTCUSD.
### </summary>
### <meta name="tag" content="crypto bitcoin GDAX benchmark bug" />
class MovingAverageCrossAlgorithm(QCAlgorithm):

    def Initialize(self):
        
        self.SetStartDate(2016, 01, 01)  #Set Start Date
        self.SetCash(10000)             #Set Strategy Cash
        self.SetBrokerageModel(BrokerageName.GDAX)
        self.AddCrypto("BTCUSD", Resolution.Daily)
        
        self.SetBenchmark(SecurityType.Crypto, "BTCUSD")


    def OnData(self, data):
        
        if self.Portfolio["BTCUSD"].Quantity <= 0:
            self.SetHoldings("BTCUSD", 1.0)