Overall Statistics |
Total Trades 492 Average Win 0.35% Average Loss -0.31% Compounding Annual Return -18.125% Drawdown 24.000% Expectancy -0.282 Net Profit -23.459% Sharpe Ratio -1.923 Loss Rate 66% Win Rate 34% Profit-Loss Ratio 1.13 Alpha -0.135 Beta -0.025 Annual Standard Deviation 0.07 Annual Variance 0.005 Information Ratio -1.028 Tracking Error 0.151 Treynor Ratio 5.336 Total Fees $1143.93 |
using System; using System.Collections.Generic; using NodaTime; using QuantConnect.Data; using QuantConnect.Data.Custom; namespace QuantConnect.Algorithm.CSharp { /// <summary> /// Daily Fx demonstration to call on and use the FXCM Calendar API /// </summary> public class DailyFxAlgorithm : QCAlgorithm { /// <summary> /// Add the Daily FX type to our algorithm and use its events. /// </summary> public override void Initialize() { SetStartDate(2015, 01, 26); //Set Start Date SetEndDate(2016, 05, 27); //Set End Date SetCash(100000); //Set Strategy Cash AddData<DailyFx>("DFX", Resolution.Minute, DateTimeZone.Utc); AddSecurity(SecurityType.Forex, "EURUSD", Resolution.Minute); } public override void OnData(Slice slice) { // } /// <summary> /// Trigger an event on a complete calendar event which has an actual value. /// </summary> public void OnData(DailyFx calendar) { if(calendar.Importance != FxDailyImportance.High) return; if(calendar.Meaning == FxDailyMeaning.Better) { SetHoldings("EURUSD", 1); } else if(calendar.Meaning == FxDailyMeaning.Worse) { SetHoldings("EURUSD", -1); } else { Liquidate("EURUSD"); } } } }