Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
31.770%
Drawdown
81.900%
Expectancy
0
Net Profit
37019.815%
Sharpe Ratio
0.868
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.026
Beta
19.833
Annual Standard Deviation
0.428
Annual Variance
0.183
Information Ratio
0.822
Tracking Error
0.428
Treynor Ratio
0.019
Total Fees
$488.63
using System.Collections.Generic;
using QuantConnect.Data;
using QuantConnect.Interfaces;

namespace QuantConnect.Algorithm.CSharp
{
    /// <summary>
    /// Basic template algorithm simply initializes the date range and cash. This is a skeleton
    /// framework you can use for designing an algorithm.
    /// </summary>
    /// <meta name="tag" content="using data" />
    /// <meta name="tag" content="using quantconnect" />
    /// <meta name="tag" content="trading and orders" />
    public class BasicTemplateAlgorithm : QCAlgorithm
    {
        private Symbol _symbol = QuantConnect.Symbol.Create("AAPL", SecurityType.Equity, Market.USA);

        /// <summary>
        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
        /// </summary>
        public override void Initialize()
        {
            SetStartDate(1998, 1, 1);  //Set Start Date
            // SetEndDate(2019, 6, 1);    //Set End Date
            SetCash(100000);             //Set Strategy Cash

            AddEquity("AAPL", Resolution.Daily);
        }

        /// <summary>
        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
        /// </summary>
        /// <param name="data">Slice object keyed by symbol containing the stock data</param>
        public override void OnData(Slice data)
        {
            if (!Portfolio.Invested)
                SetHoldings(_symbol, 1);
        }
    }
}