How Qlib handles dividend by factor data?
❓ Questions and Help
I've been seeking a solution to update Qlib database to reflect the real stock market in China, while found that the 'factor' is supposed to be the bridge connecting qlib data to real world. But this Qlib factor appreas to reflect the real dividend date but somehow not the value itself. Example for instrument SH600016 in datetime, instrument, $close, $factor, $close/$factor, Real_close, Real_foreAdjustFactor 2019-07-04, SH600016, 10.784764, 1.6746529, 6.4399996, 6.4399996, 0.850308 2019-07-04, SH600016, 10.775917, 1.7694445, 6.09, 6.09, 0.850308
When the stock executed dividend plan and the price changed accordingly, Qlib seems taking the non-dividend values as its price data and put them into storate. In above my test it shows $close/$factor = Real_close (non-dividend price)
I calculated these two qlib $factors and found: 1.6746529 / 1.7694445 = 0.946429 != 0.850308, it made my question: when it comes to a day that I got the real stock price together with a new real adjust factor, how could I decide a proper $factor for qlib so to make all prices for Qlib data to update?
Qlib team, can I ask your favour to this question? You must know that Yahoo Finance has banned all the requests coming from China, thus injecting data from outer source is must-have to keep Qlib programs continue working. Any idea to share about how Qlib determines the factor? Thanks.
Qlib team, can I ask your favour to this question? You must know that Yahoo Finance has banned all the requests coming from China, thus injecting data from outer source is must-have to keep Qlib programs continue working. Any idea to share about how Qlib determines the factor? Thanks.
I'm sorry to reply your issue so late. Qlib uses the post-recovery price. To ensure this, qlib sets the first day price to 1 to calculate the post-recovery price, which is not the same as the recovery you are using, so the difference you are seeing will appear.
This issue is stale because it has been open for three months with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days