Add OnWarmupFinished method to QCAlgorithm

This method is being added to allow algorithms to complete initialization tasks that cannot be executed during Initialize, such as cancelling existing open orders in live trading.
This method will be called only once, when the warmup task is complete.

Closes #1043
This commit is contained in:
Stefano Raggi
2018-01-15 13:46:30 +01:00
parent d01ac3b980
commit 89a59351cd
13 changed files with 140 additions and 95 deletions
@@ -918,6 +918,17 @@ namespace QuantConnect.AlgorithmFactory.Python.Wrappers
_baseAlgorithm.PostInitialize();
}
/// <summary>
/// Called when the algorithm has completed initialization and warm up.
/// </summary>
public void OnWarmupFinished()
{
using (Py.GIL())
{
_algorithm.OnWarmupFinished();
}
}
/// <summary>
/// Removes the security with the specified symbol. This will cancel all
/// open orders and then liquidate any existing holdings