Hello all,
I'm just trying to build a functioning universe selection algorithm to the point where I understand most of what's happening ‘under the hood’ with the helpers and whatnot. I simply added one of the QC tutorials, changing a couple values, then I added a MomentumPercent constructor to another class which I manually warmup when securities are added to the universe and their symboldata object is created.
The code I have is more for purposes of debugging, so the logis is very basic.. I simply have securities above ten dollars with 10EMA daily over 30EMA daily, sorted by dollar volume Then in my trade logic, it is simply placing orders if the stock has gained dover 2% in 90 minutes. A lot of stocks should fit this, but the algorithm goes for weeks without placing orders.
Am I doing something wrong with my history request, or my updating the indicators?
Victoria Butler
This is the code
Louis Szeto
Hi Victoria
The indentation is a bit off in the CoarseSelection method. Also, in the OnSecuritiesChanged method, you'll need to discard the SelectionData object of the RemovedSecurities.
You're also assuming the order is immediately filled after placed, but if not, self.Portfolio[symbol].Quantity might not be accurately used. Maybe you shall place the follow-up orders in OnOrderEvent.
In principle, “the history request, or my updating the indicators” is correct if we despite the indentation.
Best
Louis
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.
Vladimir
Victoria Butler, Louis Szeto
Just wondering where the short positions came from.
.ekz.
Victoria Butler , this post might help:
https://www.quantconnect.com/forum/discussion/12932/share-scheduled-intraday-universe-selection-w-indicators/p1
Louis Szeto
Hi Vladimir
The extra negative quantity comes off from my above comment stated issue:
“You're also assuming the order is immediately filled after placed, but if not, self.Portfolio[symbol].Quantity might not be accurately used. Maybe you shall place the follow-up orders in OnOrderEvent.”
Best
Louis
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.
Vladimir
Victoria Butler
I played a bit with your algorithm to solve the exposure problem. Enjoy backtesting with my latest improvements.
Victoria Butler
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!