Files
quantconnect--lean/Common/Orders/OptionExercise/IOptionExerciseModel.cs
quant1729 c416df6241 Refactored option assignment/exercise:
1. Made sure we treat properly option expiration dates before Feb 2015 and after. Added tests.
2. Refactored expiration delisting, assignments/option exercise to happen in the end of the date, not MOC orders in the beginning of the day. Regression test.
3. Refactored option exercise model to generate proper fills on assignments/option. Those fills are reflected correctly in margins, in stats and correspond to IB model. Still need to run IB real-life live tests.
4. Refactored option symbol related functions into separate module (OptionSymbol.cs)
5. Made sure OnAssignmentEvent arrived to the user algo in regression test. Do we need OnExercise event? Not sure.
6. Tested end-to-end Ray's current code (covered call strat) to see short option legs expire worthless, and stats updated.
2017-02-02 19:35:37 +08:00

38 lines
1.4 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 QuantConnect.Securities;
using QuantConnect.Securities.Option;
using System.Collections.Generic;
namespace QuantConnect.Orders.OptionExercise
{
/// <summary>
/// Represents a model that simulates option exercise and lapse events
/// </summary>
public interface IOptionExerciseModel
{
/// <summary>
/// Model the option exercise
/// </summary>
/// <param name="option">Option we're trading this order</param>
/// <param name="order">Order to update</param>
/// <returns>Order fill information detailing the average price and quantity filled.</returns>
IEnumerable<OrderEvent> OptionExercise(Option option, OptionExerciseOrder order);
}
}