HI !
I would add multiple Future Symbol with foreach its own signal parameter. For that I try to apply the same logic of AddAlpha file like :
https://github.com/QuantConnect/Lean/blob/master/Algorithm.CSharp/AddAlphaModelAlgorithm.cs
But I dont want to use Insight, the reason is Insight doesn't match with my Signal model, and depreciate my result.
So my question is, by what have I to replace <Insight> in :
public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data) in the files AlphaModel and IAlphaModel.
Thanks !
Gmamuze Cht
Hi !
I succeed to use AddAlpha, it permit to me to split my project in several files.
I need some help to make OCO's modul, sharing by Levitikon, compatible with this strucuture.
Orders are well send, but logic in method OnOrderEvent and class OneCancelOtherTicketSet, don't take infos about orders correctly to apply STP, TP, and FILLPrice. I tryed many things but no succeed, I present the issue bellow in a proper backtest project.
Any help are welcome !
Gmamuze Cht
Hi !
I tryed to implement class AlphaModel, interface IAlphaModel and class AlphaModelPythonWrapper.
The backtest is without AddAlpha modul in Initialize to be able to post it.
If you clone the backtest and try to add AddAlpha like it in Initialize :
AddAlpha(new Algorithm_ES(_ES));
AddAlpha(new Algorithm_YM(_YM));
I Get this message :
Cannot convert Algorithm_ES to Python.Runtime.Object
I think i have correctly modified AlphaModelPythonWrapper adding OrderEvent and other files but cannot find other things to modify or implement.
Alexandre Catarino
Hi Gmamuze Cht ,
Thank you for the interesting suggestion.
We think that placing orders in the Alpha Model goes against the separation of concerns that we want to enforce.
On the other hand, your solution shows that our Execution Model interface should have an OnOrderEvent method to deal with OCO orders. We have created a GitHub issue to implement it:
Adds OnOrderEvent Method to Execution Models #3834
Basically, the Alpha Model that you created should just emit insights to sign the direction of a contract from each future. The Portfolio Construction Model would create the targets that would generate the market, stop and take profit order in the Execution Model that would be managed by ExecutionModel.OnOrderEvent(QCAlgorithm, OrderEvent).
Alexandre Catarino
Hi Gmamuze Cht ,
There are further changes that need to be implemented at the engine level to enable IExecutionModel.OnOrderEvent.
Perhaps, you could follow another approach: implement OCO at QCAlgorithm.OnOrderEvent. Once the market orders placed by the ImmediateExecutionModel are filled, the algorithm can create the other orders in QCAlgorithm.OnOrderEvent.
Gmamuze Cht
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!