Files
quantconnect--lean/Algorithm.CSharp/IndexOptionCallITMExpiryDailyRegressionAlgorithm.cs
T
Martin-Molinero d4e7f584f6 Daily data time adjustment (#8001)
* Daily data Time & EndTime Improvement

- Adjust daily data Time & EndTime to actually reflect the time of the
  data used, for example US Equity from 9.30 to 4PM. Adding new unit and
  regression tests

* Refactor solution to use enumerator

- Refactor daily strict end times solution to be through enumerator
  usage, so it applies for history providers too

* Minor fixes

* Revert fill forward enumerator change

- Revert FillForward enumerator causing stats changing, enhancing unit
  tests

* Some cleanup

* Improve handling of live trading FF enumerator

- Improve handling of live trading FF enumerator, by adding support for
  bars to arrive with a delay so we can handle auction close/option
  prices or data providers which might have some delay making the data
  available. Adding new unit tests asserting the behavior
2024-05-20 17:28:03 -03:00

78 lines
3.0 KiB
C#

/*
* 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.Collections.Generic;
namespace QuantConnect.Algorithm.CSharp
{
/// <summary>
/// This regression algorithm tests In The Money (ITM) index option expiry for calls using daily resolution.
/// </summary>
public class IndexOptionCallITMExpiryDailyRegressionAlgorithm : IndexOptionCallITMExpiryRegressionAlgorithm
{
protected override Resolution Resolution => Resolution.Daily;
public override void Initialize()
{
Settings.DailyStrictEndTimeEnabled = true;
base.Initialize();
}
/// <summary>
/// This is used by the regression test system to indicate which languages this algorithm is written in.
/// </summary>
public override Language[] Languages { get; } = { Language.CSharp };
/// <summary>
/// Data Points count of all timeslices of algorithm
/// </summary>
public override long DataPoints => 194;
/// <summary>
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
/// </summary>
public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Orders", "2"},
{"Average Win", "0%"},
{"Average Loss", "-49.28%"},
{"Compounding Annual Return", "301.565%"},
{"Drawdown", "0.300%"},
{"Expectancy", "0"},
{"Start Equity", "100000"},
{"End Equity", "110274"},
{"Net Profit", "10.274%"},
{"Sharpe Ratio", "5.291"},
{"Sortino Ratio", "384.846"},
{"Probabilistic Sharpe Ratio", "88.621%"},
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "1.833"},
{"Beta", "-0.228"},
{"Annual Standard Deviation", "0.345"},
{"Annual Variance", "0.119"},
{"Information Ratio", "4.653"},
{"Tracking Error", "0.383"},
{"Treynor Ratio", "-7.99"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Lowest Capacity Asset", "SPX XL80P3GHDZXQ|SPX 31"},
{"Portfolio Turnover", "1.90%"},
{"OrderListHash", "0ed3bb17fee63ef42628f05f0c88c13c"}
};
}
}