Overall Statistics |
Total Trades 35 Average Win 2.69% Average Loss -3.07% Compounding Annual Return -7.945% Drawdown 36.200% Expectancy -0.173 Net Profit -21.307% Sharpe Ratio -0.597 Loss Rate 56% Win Rate 44% Profit-Loss Ratio 0.88 Alpha -0.063 Beta -0.085 Annual Standard Deviation 0.124 Annual Variance 0.015 Information Ratio -1.13 Tracking Error 0.185 Treynor Ratio 0.875 Total Fees $49.98 |
namespace QuantConnect { public class MonthlyEventAlgorithm : QCAlgorithm { public override void Initialize() { SetStartDate(2013, 1, 1); SetEndDate(DateTime.Now.Date.AddDays(-1)); SetCash(25000); AddSecurity(SecurityType.Equity, "SPY", Resolution.Minute); var holdings = Portfolio["SPY"]; Schedule.Event().MonthStart("SPY").At(TimeSpan.FromHours(10)).Run(() => { if (!holdings.Invested) SetHoldings("SPY", 1); else if (holdings.IsLong) SetHoldings("SPY", -1); else if (holdings.IsShort) SetHoldings("SPY", 1); }); } public void OnData(TradeBars data) { } } }