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.74k stars 750 forks source link

Investment #64

Closed MuslemRahimi closed 6 years ago

MuslemRahimi commented 6 years ago

I wanted to ask where i can see how much the program invest in each coin? For example if we have 11 coins and an intial capital of 1 BTC, then how much does the invest ( please tell me the line of the code).

My second question is where does the program decide to buy or sell (again please tell me the code line).

fbrusch-ik commented 6 years ago

Thats not really how this works, wether to buy or sell is implicit in the difference between the old and new omega returned by the agent.

Here is the place that "decides" wether to buy or sell trader.py#88 pgportfolio.trade.Trader.__trade_body

The "trading" you see in the backtest to that omega happens in backtest.py#70 pgportfolio.trade.Backtest.trade_by_strategy

However, I urge you to familiarize yourself with the whitepaper first before digging any deeper into the code.