| Overall Statistics |
|
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return -1.321% Drawdown 9.200% Expectancy 0 Net Profit -1.321% Sharpe Ratio -0.122 Probabilistic Sharpe Ratio 10.803% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.016 Beta 0.03 Annual Standard Deviation 0.069 Annual Variance 0.005 Information Ratio -2.043 Tracking Error 0.13 Treynor Ratio -0.285 Total Fees $8.31 |
namespace QuantConnect
{
public class BuyOneSecurity : QCAlgorithm
{
string _ticker = "NVCN";
private Symbol _symbol;
private Identity _price;
public override void Initialize()
{
SetStartDate(2019, 01, 01);
SetEndDate(2019, 12, 31);
SetCash(100000);
_symbol = AddEquity(_ticker, Resolution.Daily, Market.USA).Symbol;
_price = Identity(_symbol);
PlotIndicator($"{_symbol.Value} Price", _price);
}
public override void OnData(Slice data)
{
if (!Portfolio.Invested)
{
SetHoldings(_symbol, 0.1);
Log($"Purchased Security {_symbol.ID}");
}
}
public override void OnSecuritiesChanged(SecurityChanges changes)
{
foreach (var securityChange in changes.RemovedSecurities)
{
Log(securityChange.Symbol.ID.ToString() + " - Delisted");
}
}
public override void OnEndOfAlgorithm()
{
Liquidate();
}
}
}