Overall Statistics
using QuantConnect.Algorithm;
using QuantConnect.Data;
using QuantConnect.Indicators;

namespace QuantConnect
{
    public class BuyOneSecurity : QCAlgorithm
    {
        string _ticker = "vxx.1";
        private Symbol _symbol;
        private Identity _price;

        public override void Initialize()
        {
            SetStartDate(2009, 01, 01);
            SetEndDate(2019, 11, 20);

            SetCash(10000000);

            _symbol = AddEquity(_ticker, Resolution.Daily).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}");
            }
        }
    }
}