Overall Statistics |
Total Trades 2 Average Win 0% Average Loss -0.90% Compounding Annual Return -22.347% Drawdown 0.900% Expectancy -1 Net Profit -0.897% Sharpe Ratio -6.086 Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.314 Beta 4.871 Annual Standard Deviation 0.037 Annual Variance 0.001 Information Ratio -6.586 Tracking Error 0.037 Treynor Ratio -0.046 Total Fees $20.89 |
using QuantConnect.Indicators; namespace QuantConnect { public class BasicTemplateAlgorithm : QCAlgorithm { string _ticker = "UPRO"; private Symbol _symbol; private Identity _price; public override void Initialize() { SetStartDate(2018, 05, 20); //Set Start Date SetEndDate(2018, 06, 01); //Set End Date SetCash(100000); //Set Strategy Cash _symbol = AddEquity(_ticker, Resolution.Daily).Symbol; _price = Identity(_symbol.Value); PlotIndicator($"{_symbol.Value} Price", _price); } public override void OnData(Slice data) { if (Time.Date == new DateTime(2018, 05, 24).Date) { SetHoldings(_symbol, 1); } if (Time.Date == new DateTime(2018, 05, 25).Date) { Liquidate(); } Log($"{Time} Price identity: {data.Bars[_symbol].Close.ToString()}"); } public override void OnOrderEvent(OrderEvent orderEvent) { Log(orderEvent.ToString()); } } }