/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using System; using System.Collections.Generic; using System.Linq; using QuantConnect.Data; using QuantConnect.Interfaces; using QuantConnect.Orders; using QuantConnect.Securities; using QuantConnect.Securities.Future; namespace QuantConnect.Algorithm.CSharp { /// /// This example demonstrates how to add futures with daily resolution and extended market hours. /// /// /// /// public class BasicTemplateFuturesWithExtendedMarketDailyAlgorithm : BasicTemplateFuturesDailyAlgorithm { protected override bool ExtendedMarketHours => true; /// /// This is used by the regression test system to indicate which languages this algorithm is written in. /// public override Language[] Languages { get; } = { Language.CSharp, Language.Python }; /// /// Data Points count of all timeslices of algorithm /// public override long DataPoints => 17431; /// /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm /// public override Dictionary ExpectedStatistics => new Dictionary { {"Total Trades", "152"}, {"Average Win", "0.09%"}, {"Average Loss", "-0.01%"}, {"Compounding Annual Return", "-0.644%"}, {"Drawdown", "0.600%"}, {"Expectancy", "-0.872"}, {"Net Profit", "-0.649%"}, {"Sharpe Ratio", "-2.343"}, {"Probabilistic Sharpe Ratio", "0%"}, {"Loss Rate", "99%"}, {"Win Rate", "1%"}, {"Profit-Loss Ratio", "8.76"}, {"Alpha", "-0.004"}, {"Beta", "-0.001"}, {"Annual Standard Deviation", "0.002"}, {"Annual Variance", "0"}, {"Information Ratio", "-1.409"}, {"Tracking Error", "0.089"}, {"Treynor Ratio", "3.618"}, {"Total Fees", "$338.96"}, {"Estimated Strategy Capacity", "$1000.00"}, {"Lowest Capacity Asset", "ES VRJST036ZY0X"}, {"Fitness Score", "0.013"}, {"Kelly Criterion Estimate", "0"}, {"Kelly Criterion Probability Value", "0"}, {"Sortino Ratio", "-1.464"}, {"Return Over Maximum Drawdown", "-0.992"}, {"Portfolio Turnover", "0.04"}, {"Total Insights Generated", "0"}, {"Total Insights Closed", "0"}, {"Total Insights Analysis Completed", "0"}, {"Long Insight Count", "0"}, {"Short Insight Count", "0"}, {"Long/Short Ratio", "100%"}, {"Estimated Monthly Alpha Value", "$0"}, {"Total Accumulated Estimated Alpha Value", "$0"}, {"Mean Population Estimated Insight Value", "$0"}, {"Mean Population Direction", "0%"}, {"Mean Population Magnitude", "0%"}, {"Rolling Averaged Population Direction", "0%"}, {"Rolling Averaged Population Magnitude", "0%"}, {"OrderListHash", "48bfc4d255420cb589e00cf582554e0a"} }; } }