ZhengyaoJiang / PGPortfolio

PGPortfolio: Policy Gradient Portfolio, the source code of "A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem"(https://arxiv.org/pdf/1706.10059.pdf).
GNU General Public License v3.0
1.73k stars 748 forks source link

A Error in data Processing #130

Open GameHoo opened 4 years ago

GameHoo commented 4 years ago

Thanks to the author for the paper and the code, this is really great work.

I found a fatal error in data processing. When filling missing data, other coin's data is used.

I added a few lines of print code in globaldatamatrix.py to observe the missing and filled data. image

The output is as follows

... FCT 2015-10-05 00:30:00 2017-06-30 16:00:00 FCT 2015-10-05 00:30:00 2017-06-30 16:00:00 FCT 2015-10-05 00:30:00 2017-06-30 16:00:00 GNT 2017-02-18 04:00:00 2017-06-30 16:00:00 GNT 2017-02-18 04:00:00 2017-06-30 16:00:00 GNT 2017-02-18 04:00:00 2017-06-30 16:00:00 ZEC 2016-10-28 18:30:00 2017-06-30 16:00:00 ZEC 2016-10-28 18:30:00 2017-06-30 16:00:00 ZEC 2016-10-28 18:30:00 2017-06-30 16:00:00 coin_name: ZEC close high low 2015-06-30 16:00:00 490.000000 2600.000000 2.048000 2015-06-30 16:30:00 490.000000 2600.000000 2.048000 2015-06-30 17:00:00 490.000000 2600.000000 2.048000 2015-06-30 17:30:00 490.000000 2600.000000 2.048000 2015-06-30 18:00:00 490.000000 2600.000000 2.048000 2015-06-30 18:30:00 490.000000 2600.000000 2.048000 2015-06-30 19:00:00 490.000000 2600.000000 2.048000 2015-06-30 19:30:00 490.000000 2600.000000 2.048000 2015-06-30 20:00:00 490.000000 2600.000000 2.048000 2015-06-30 20:30:00 490.000000 2600.000000 2.048000 2015-06-30 21:00:00 490.000000 2600.000000 2.048000 2015-06-30 21:30:00 490.000000 2600.000000 2.048000 2015-06-30 22:00:00 490.000000 2600.000000 2.048000 2015-06-30 22:30:00 490.000000 2600.000000 2.048000 2015-06-30 23:00:00 490.000000 2600.000000 2.048000 2015-06-30 23:30:00 490.000000 2600.000000 2.048000 2015-07-01 00:00:00 490.000000 2600.000000 2.048000 2015-07-01 00:30:00 490.000000 2600.000000 2.048000 2015-07-01 01:00:00 490.000000 2600.000000 2.048000 2015-07-01 01:30:00 490.000000 2600.000000 2.048000 2015-07-01 02:00:00 490.000000 2600.000000 2.048000 2015-07-01 02:30:00 490.000000 2600.000000 2.048000 2015-07-01 03:00:00 490.000000 2600.000000 2.048000 2015-07-01 03:30:00 490.000000 2600.000000 2.048000 2015-07-01 04:00:00 490.000000 2600.000000 2.048000 2015-07-01 04:30:00 490.000000 2600.000000 2.048000 2015-07-01 05:00:00 490.000000 2600.000000 2.048000 2015-07-01 05:30:00 490.000000 2600.000000 2.048000 2015-07-01 06:00:00 490.000000 2600.000000 2.048000 2015-07-01 06:30:00 490.000000 2600.000000 2.048000 ... ... ... ... 2017-06-30 01:30:00 0.125222 0.126384 0.125208 2017-06-30 02:00:00 0.124460 0.125213 0.123112 2017-06-30 02:30:00 0.124190 0.124461 0.123001 2017-06-30 03:00:00 0.123411 0.124659 0.122930 2017-06-30 03:30:00 0.123202 0.125138 0.123150 2017-06-30 04:00:00 0.123593 0.123593 0.122863 2017-06-30 04:30:00 0.123131 0.123642 0.122634 2017-06-30 05:00:00 0.122255 0.123630 0.122255 2017-06-30 05:30:00 0.120116 0.122255 0.119000 2017-06-30 06:00:00 0.120899 0.120899 0.118810 2017-06-30 06:30:00 0.121580 0.121607 0.120000 2017-06-30 07:00:00 0.120638 0.121580 0.120000 2017-06-30 07:30:00 0.120860 0.121281 0.119570 2017-06-30 08:00:00 0.121236 0.121600 0.119730 2017-06-30 08:30:00 0.121999 0.123708 0.121200 2017-06-30 09:00:00 0.123400 0.124000 0.121900 2017-06-30 09:30:00 0.124126 0.124150 0.122851 2017-06-30 10:00:00 0.122200 0.124126 0.121930 2017-06-30 10:30:00 0.122500 0.123300 0.121930 2017-06-30 11:00:00 0.123500 0.124150 0.122500 2017-06-30 11:30:00 0.125060 0.125075 0.122820 2017-06-30 12:00:00 0.124100 0.125310 0.124000 2017-06-30 12:30:00 0.124000 0.124945 0.124000 2017-06-30 13:00:00 0.123446 0.123968 0.122834 2017-06-30 13:30:00 0.121110 0.123447 0.121110 2017-06-30 14:00:00 0.122062 0.122429 0.120874 2017-06-30 14:30:00 0.121581 0.121910 0.121510 2017-06-30 15:00:00 0.121200 0.121581 0.120370 2017-06-30 15:30:00 0.121790 0.121790 0.120938 2017-06-30 16:00:00 0.121000 0.122300 0.120938

It can be seen that ZEC had no data before 2016-10-28, but it was filled with a huge number, which is believed to have impact on the experiment.

jiahaoli57 commented 2 years ago

Good point.