Hello,
I'm not sure why this algorithm is sending so many 1, -1, and other small orders. Do you now how I can stop those small orders from trickling through?
Thanks!
Sean
Don't have an account? Join QuantConnect Today
QuantConnect Community Discussions
QUANTCONNECT COMMUNITY
LEAN is the open-source algorithmic trading engine powering QuantConnect. Founded in 2012 LEAN has been built by a global community of 180+ engineers and powers more than 300+ hedge funds today.
Join QuantConnect's Discord server for real-time support, where a vibrant community of traders and developers awaits to help you with any of your QuantConnect needs.
The Open-Quant League is a quarterly competition between universities and investment clubs for the best-performing strategy. The previous quarter's code is open-sourced, and competitors must adapt to survive.
Algorithm selling in small pieces, seeking advice to stop small orders.
Continue ReadingRefer to our Research Guidelines for high quality research posts.
Create an account on QuantConnect for the latest community delivered to your inbox.
Sign Up Today
|
|
|||||||
|
|
||||||||
|
AccumulativeInsightPortfolioConstructionModel piecemeal selling
S O'Keeffe | June 2020
Hello,
I'm not sure why this algorithm is sending so many 1, -1, and other small orders. Do you now how I can stop those small orders from trickling through?
Thanks!
Sean
QuantConnectâ„¢ 2025. All Rights Reserved
Yuxin Guan
Hello Sean
The order quantity depends on the cash in hand, the unit price for target securities, and the number of securities in the basket. To increase cash in hand, we could change
self.SetCash(100000)
toself.SetCash(1000000)
. In order to choose securities with lower unit prices, we can add conditions to screen out securities with a price of less than $100. We could also limit the number of target securities from 100 to 50. These two goals can be achieved by updating code inself.CoarseSelectionFunction
:sortedByDollarVolume = sorted(coarse, key=lambda x: x.DollarVolume, reverse=False) filtered = [ x.Symbol for x in sortedByDollarVolume x.Price < 100] return filtered[:50]
Please check this page for more variation about universe selection.
I attached a backtest updating the code provided for the demonstration. Hope this could help.
Best,
Yuxin Guan
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.
S O'Keeffe
Hi Yuxin,
Thank you for your response! I'm OK with the SetCash and the price of the securities being traded. The question I was actually wondering about is why I'm seeing so many orders like these in the above backtest:
2020-05-18T13:59:23ZCCL14.43-4MarketFilled-57.722020-05-18T13:59:23ZUAL22.71-1MarketFilled-22.71From what I understand, 3% is the default portfolio percent allocated to each insight or order with the "AccumulativeInsightPortfolioConstructionModel." But the total value of each of these trades is $57 or $22, very very far below that 3% default portfolio percent. Do you know why the algorithm is sending orders so far below that 3% default?
Thanks,
Sean
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.
S O'Keeffe
Hi Yuxin,
Sorry those two example orders didn't come through correctly! The two example orders that you can see if you clone the above algorithm are these:
Time Symbol Price Quantity Type Status Value
2020-05-18T13:59:23Z CCL 14.43 -4 Market Filled -57.72
2020-05-18T13:59:23Z UAL 22.71 -1 Market Filled -22.71
Thanks,
Sean
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.
S O'Keeffe
Hi Derek,
Ah OK I missed the fact that this PCM also rebalanced every time a new insight is generated. Thank you so much as always!
Thank you,
Sean
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!