LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
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.
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.
Gmamuze Cht
14.4k
,
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 !
0
Edited by Gmamuze Cht
Gmamuze Cht
14.4k
,
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.
0
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).
0
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.
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.
Loading...
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!