Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
-54.163%
Drawdown
13.300%
Expectancy
0
Net Profit
-6.344%
Sharpe Ratio
-1.642
Probabilistic Sharpe Ratio
16.628%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.05
Beta
0.919
Annual Standard Deviation
0.308
Annual Variance
0.095
Information Ratio
0.385
Tracking Error
0.256
Treynor Ratio
-0.55
Total Fees
$14.78
namespace QuantConnect
{
    public class BuyOneSecurity : QCAlgorithm
    {
        string _ticker = "maa";
        private Symbol _symbol;
        private Identity _price;

        public override void Initialize()
        {
            SetStartDate(2008, 6, 1);
            SetEndDate(2008, 7, 1);
            
            SetCash(100000);

            _symbol = AddEquity(_ticker, Resolution.Minute, Market.USA).Symbol;
            _price = Identity(_symbol);
            PlotIndicator($"{_symbol.Value} Price", _price);
        }

        public override void OnData(Slice data)
        {
            if (!Portfolio.Invested)
            {
                SetHoldings(_symbol, 1);
                Log($"Purchased Security {_symbol.ID}");
            }
        }
        
        public override void OnEndOfAlgorithm()
        {
            Liquidate();
        }
    }
}