Overall Statistics |
Total Trades 7200 Average Win 0.73% Average Loss -0.70% Compounding Annual Return 10.424% Drawdown 42.400% Expectancy 0.039 Net Profit 114.014% Sharpe Ratio 0.437 Loss Rate 49% Win Rate 51% Profit-Loss Ratio 1.05 Alpha 0.092 Beta -1.365 Annual Standard Deviation 0.261 Annual Variance 0.068 Information Ratio 0.417 Tracking Error 0.311 Treynor Ratio -0.083 Total Fees $0.00 |
using NodaTime; namespace QuantConnect { public class DateTimeEffectAlgo : QCAlgorithm { /* +-------------------------------------------------+ * |Algorithm Control Panel | * +-------------------------------------------------+*/ private readonly string[] _pairs = {"EURGBP", "EURUSD", "AUDUSD"}; private readonly decimal _leverage = 10m; private readonly decimal _exposure = 0.8m; /* +-------------------------------------------------+*/ private decimal _shareByPair; private readonly List<Symbol> _symbols = new List<Symbol>(); public override void Initialize() { SetStartDate(year: 2010, month: 01, day: 01); //Set Start Date SetEndDate(year: 2017, month: 09, day: 01); //Set End Date SetCash(startingCash: 25000); //Set Strategy Cash SetBrokerageModel(BrokerageName.OandaBrokerage); _shareByPair = (_leverage *_exposure ) / _pairs.Length; // Find more symbols here: http://quantconnect.com/data foreach (var pair in _pairs) { _symbols.Add(AddForex(pair, Resolution.Minute, "OANDA", leverage: _leverage).Symbol); if (pair == "EURUSD") { SetBenchmark(_symbols.Last()); } } Schedule.On(DateRules.Every(DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday), TimeRules.At(hour: 9, minute: 15, timeZone: DateTimeZone.Utc), () => { foreach (var symbol in _symbols) { SetHoldings(symbol, -_shareByPair); } }); Schedule.On(DateRules.EveryDay(), TimeRules.At(14, 15, DateTimeZone.Utc), () => { foreach (var symbol in _symbols) { if (Portfolio[symbol].IsShort) { Liquidate(symbol); } } }); } } }