| Overall Statistics |
|
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 6.200% Drawdown 18.100% Expectancy 0 Net Profit 71.901% Sharpe Ratio 0.507 Probabilistic Sharpe Ratio 6.689% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.09 Beta -0.249 Annual Standard Deviation 0.134 Annual Variance 0.018 Information Ratio -0.071 Tracking Error 0.287 Treynor Ratio -0.274 Total Fees $2657.90 |
using QuantConnect.Algorithm;
using QuantConnect.Data;
using QuantConnect.Indicators;
namespace QuantConnect
{
public class BuyOneSecurity : QCAlgorithm
{
string _ticker = "tlo";
private Symbol _symbol;
private Identity _price;
public override void Initialize()
{
SetStartDate(2008, 01, 01);
SetEndDate(2017, 01, 01);
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}");
}
}
}
}