Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reproduce the results on more recent data? #6

Open
jnenx opened this issue Nov 25, 2020 · 7 comments
Open

How to reproduce the results on more recent data? #6

jnenx opened this issue Nov 25, 2020 · 7 comments

Comments

@jnenx
Copy link

jnenx commented Nov 25, 2020

Hi,

I am trying to replicate the results of this algo but everytime I try I get very, very poor results. I am wondering how the data was preprocessed. Could you clarify that? Any help is very welcome.

Thanks!

@Ivsxk
Copy link
Owner

Ivsxk commented Nov 26, 2020

Hi,

I am trying to replicate the results of this algo but everytime I try I get very, very poor results. I am wondering how the data was preprocessed. Could you clarify that? Any help is very welcome.

Thanks!

To generate Data.db about the latest data, please refer to the code contributed by ZhengyaoJiang(https://github.com/zhengyaujiang/PGPortfolio).
You can also write your own code to generate data files that meet the following rules:
image

@jnenx
Copy link
Author

jnenx commented Nov 27, 2020

Hi, thanks a lot for the reply. About this step described in the paper:

"we normalize the price series of each asset by element-wise dividing the prices regarding the last period in the price series."

Is that done by the code deposited here, or that is a previous step that I have to do before processing the dataset?

@jnenx
Copy link
Author

jnenx commented Nov 27, 2020

You did mention to generate the .db file from the code contributed by ZhengyaoJiang. But is this .db file compatible with the code from RAT?

I managed to normalize the data with the pandas library however when I save it as .db file I am not able to preserve the information fully and that results in the error: ValueError: the length of selected coins 0 is not equal to expected 10. So the algorithm is not able to see the coin data as before which results in no coins to be found. I was not able to find a way to resolve this issue in particular with pandas.

@jnenx
Copy link
Author

jnenx commented Dec 7, 2020

The link above is no longer working ZhengyaoJiang(https://github.com/zhengyaujiang/PGPortfolio)

@Ivsxk
Copy link
Owner

Ivsxk commented Dec 13, 2020

Hi, thanks a lot for the reply. About this step described in the paper:

"we normalize the price series of each asset by element-wise dividing the prices regarding the last period in the price series."

Is that done by the code deposited here, or that is a previous step that I have to do before processing the dataset?

The normalization is performed in the forward function of the EncoderDecoder:
image
The price series is a tensor with [4 kinds of prices, batch size, window size, number of coins].
price_series[0:1,:,-1:,:] is the close price of the last period in a window.

@Ivsxk
Copy link
Owner

Ivsxk commented Dec 13, 2020

You did mention to generate the .db file from the code contributed by ZhengyaoJiang. But is this .db file compatible with the code from RAT?

I managed to normalize the data with the pandas library however when I save it as .db file I am not able to preserve the information fully and that results in the error: ValueError: the length of selected coins 0 is not equal to expected 10. So the algorithm is not able to see the coin data as before which results in no coins to be found. I was not able to find a way to resolve this issue in particular with pandas.

It's compatible. You only need to use ZhengyaoJiang's code to generate Data.db file. The normalization is done in RAT.

@jediyoda36
Copy link

@Ivsxk
Same problem here...
image

The link you mentioned above is no longer available

ZhengyaoJiang(https://github.com/zhengyaujiang/PGPortfolio).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants