| Overall Statistics |
|
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 1.057% Drawdown 2.000% Expectancy 0 Net Profit 8.749% Sharpe Ratio 0.5 Probabilistic Sharpe Ratio 7.944% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.015 Beta -0.029 Annual Standard Deviation 0.021 Annual Variance 0 Information Ratio -0.979 Tracking Error 0.133 Treynor Ratio -0.364 Total Fees $1806.65 |
using QuantConnect.Algorithm;
using QuantConnect.Data;
using QuantConnect.Indicators;
namespace QuantConnect
{
public class BuyOneSecurity : QCAlgorithm
{
string _ticker = "spts";
private Symbol _symbol;
private Identity _price;
public override void Initialize()
{
SetStartDate(2011, 12, 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}");
}
}
}
}