Overall Statistics
Total Trades
387
Average Win
0.01%
Average Loss
0.00%
Compounding Annual Return
0.120%
Drawdown
0.100%
Expectancy
0.132
Net Profit
0.127%
Sharpe Ratio
-4.132
Sortino Ratio
-7.872
Probabilistic Sharpe Ratio
39.196%
Loss Rate
60%
Win Rate
40%
Profit-Loss Ratio
1.80
Alpha
-0.009
Beta
0.001
Annual Standard Deviation
0.002
Annual Variance
0
Information Ratio
-2.769
Tracking Error
0.75
Treynor Ratio
-6.121
Total Fees
$330.40
Estimated Strategy Capacity
$71000.00
Lowest Capacity Asset
BTCUSD 2XR
Portfolio Turnover
0.28%
using QuantConnect.Data;
using QuantConnect.Brokerages;
using QuantConnect.Securities.Crypto;

namespace QuantConnect.Algorithm.CSharp
{
    public class CoinbaseCryptoYearMarketTradingRegressionAlgorithm : QCAlgorithm
    {
        /// <summary>
        /// Flag prevents same order <see cref="Orders.OrderDirection"/>
        /// </summary>
        private bool _isBuy;

        /// <summary>
        /// Trading security
        /// </summary>
        private Crypto _BTCUSD;

        public override void Initialize()
        {
            SetStartDate(2015, 01, 13);
            SetEndDate(2016, 02, 03);

            SetCash(100000);

            // Setup brokerage for current algorithm
            SetBrokerageModel(BrokerageName.Coinbase, AccountType.Cash);

            _BTCUSD = AddCrypto("BTCUSD", Resolution.Daily, Market.Coinbase);

        }

        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
        /// Slice object keyed by symbol containing the stock data
        public override void OnData(Slice data)
        {
            if (!_isBuy)
            {
                MarketOrder(_BTCUSD, 1);
                _isBuy = true;
            }
            else
            {
                Liquidate();
                _isBuy = false;
            }
        }

    }
}