Hello everybody,
Does the Liquidate(); function will liquidate all positions for the day? so trading will resume next trading day?
Regards,
Benton
QUANTCONNECT COMMUNITY
Hello everybody,
Does the Liquidate(); function will liquidate all positions for the day? so trading will resume next trading day?
Regards,
Benton
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.
Alexandre Catarino
Liquidate() closes all positions in your Portfolio.
Trading will resume in the next trading day if we place new orders.
Jared Broad
Trading will resume the next time step. its feasible to call the following two methods in OnData():
Liquidate();
Buy("AAPL", 100);
You will be left with 100 AAPL shares in the same minute.
If using daily data your orders will be sent as market on open orders.
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.
Benton Pena
I need a simple routine:
10 minutes before close market time, if there's an order with 1% profit. Close it and do not trade until next day.
Regards,
Benton
Alexandre Catarino
You can use Scheduled Events to schedule a method that checks for 1% profit, liquidate if met and set a boolean to prevent trades after that call. Then, you can set the boolean back to allow trades in OnEndOfDay method or in a scheduled event that happens when the market open.
Benton Pena
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!