About the Code:
The purpose of this code is to select trending stock among all.
Basically it only looks at the stocks which are above sma20, sma40, and sma60.
I am expecting around 2000 stocks out of 16000 stocks each day.
So on 2017-07-28 the program selected around 1800 stocks which is correct.
However after 2017-07-28, the number reduced significantly. This is absolutely wrong.
And 2017-07-28 is the first day, the filter starts working.
(Caution: The backtest might take a long time)
//*********************************************************************
Question:
Can anyone help with this problem please?
Thank you very much.
//*********************************************************************
The output of this code is writing into log file.
Result showing below.
//*********************************************************************
2017-07-20 00:00:00 Number:0
2017-07-21 00:00:00 Number:0
2017-07-22 00:00:00 Number:0
2017-07-25 00:00:00 Number:0
2017-07-26 00:00:00 Number:0
2017-07-27 00:00:00 Number:0
2017-07-28 00:00:00 Number:1841
2017-07-29 00:00:00 Number:445
2017-08-01 00:00:00 Number:155
2017-08-02 00:00:00 Number:91
2017-08-03 00:00:00 Number:99
2017-08-04 00:00:00 Number:98
2017-08-05 00:00:00 Number:83
2017-08-08 00:00:00 Number:91
2017-08-09 00:00:00 Number:79
2017-08-10 00:00:00 Number:60
2017-08-11 00:00:00 Number:53
2017-08-12 00:00:00 Number:40
2017-08-15 00:00:00 Number:48
2017-08-16 00:00:00 Number:48
2017-08-17 00:00:00 Number:39
2017-08-18 00:00:00 Number:43
2017-08-19 00:00:00 Number:55
2017-08-22 00:00:00 Number:64
2017-08-23 00:00:00 Number:46
2017-08-24 00:00:00 Number:41
2017-08-25 00:00:00 Number:0
OuYangFeng
The Backtest is attached.
Alexandre Catarino
When an universe changes, we are notified about the changes.
In the first interation, it was included 1841 symbols. to the universe In the following one, 445 were added and some were removed, but the total proably remained around 1800 symbols.
Please take a look into this thread, where we show how to get all symbols from an universe:
OuYangFeng
Thanks Alexandre, this is really helpful
If QC can give a really indepth tutorial about the Universe and Universe manager will be very nice.
Perhaps with some examples as well.
The tutorial/example in QC are good, but if QC can go a little bit further will be great.
Alexandre Catarino
Sure. We are working on our tutorials and we will add more details about that feature.
Meanwhile, please checkout the docs. There is a section about Universe Selection.
OuYangFeng
Thanks Alexandre.
Is it possible to have multiple universes in multiple resolution?
OuYangFeng
Hi Alexandre, dont worry about the multiple universes question.
I have found your old answer and code.
It worked.
Thank you
OuYangFeng
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!