Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 22.516% Drawdown 0.300% Expectancy 0 Net Profit 0% Sharpe Ratio 4.37 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.001 Beta 0.156 Annual Standard Deviation 0.03 Annual Variance 0.001 Information Ratio -4.409 Tracking Error 0.163 Treynor Ratio 0.843 Total Fees $1.00 |
namespace QuantConnect { public class BasicMarketOnCloseOrderAlgorithm : QCAlgorithm { private bool _send = true; private Symbol _spy = QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA); public override void Initialize() { SetStartDate(2013, 10, 07); //Set Start Date SetEndDate(2013, 10, 11); //Set End Date SetCash(100000); //Set Strategy Cash // Find more symbols here: http://quantconnect.com/data AddEquity("SPY", Resolution.Second); } public override void OnData(Slice data) { if (_send) { MarketOnCloseOrder(_spy, 100); Debug("Order sent at " + Time); _send = false; } } public override void OnOrderEvent(OrderEvent orderEvent) { if (!orderEvent.Status.IsFill()) return; Debug("Order filled at " + Time); } } }