| Overall Statistics |
|
Total Trades 27 Average Win 0% Average Loss -19.20% Compounding Annual Return -69.408% Drawdown 100.000% Expectancy -1 Net Profit -100.000% Sharpe Ratio -0.764 Probabilistic Sharpe Ratio 0.000% Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.105 Beta -4.285 Annual Standard Deviation 0.963 Annual Variance 0.928 Information Ratio -0.813 Tracking Error 1.086 Treynor Ratio 0.172 Total Fees $27.00 |
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}");
}
}
}
}