Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 8.386% Drawdown 1.600% Expectancy 0 Net Profit 0% Sharpe Ratio 0.942 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.013 Beta 0.229 Annual Standard Deviation 0.062 Annual Variance 0.004 Information Ratio -2.013 Tracking Error 0.069 Treynor Ratio 0.253 Total Fees $2.00 |
namespace QuantConnect { public class TEMAWindow : QCAlgorithm { private RollingWindow<TEMAState> _win; private TripleExponentialMovingAverage _tema; public override void Initialize() { SetStartDate(2017, 1, 1); AddSecurity(SecurityType.Forex,"EURUSD", Resolution.Hour); _win = new RollingWindow<TEMAState>(2); _tema = TEMA("EURUSD", 17); } public void OnData(TradeBars data) { if (_tema.IsReady) _win.Add(new TEMAState(_tema)); if (!_win.IsReady) return; if(!Portfolio.Invested) SetHoldings("EURUSD", 1); Plot("TEMA", "Current", _win[0].Value); Plot("TEMA", "Previous", _win[1].Value); } } public class TEMAState { public readonly decimal Value; public TEMAState(TripleExponentialMovingAverage tema) { Value = tema.Current; } } }