I am playing around with a stock trading agent trained via (deep) reinforcement learning, including memory replay. The agent is trained for 1000 episodes, where each episode consists of 180 timesteps (e.g. daily stock prices).
My question is concerning the sampling of episodes for training.
Assuming I've got daily stock prices going back 3 years, that's about 750 trading days/prices.
How should I sample this data set to get enough episodes for training?
With an episode length of 180 and an episode count of 1000, I'd need 180k "days" to choose from, if I wouldn't want any duplication.
Do I even need to sample 1000 non-overlapping windows from my dataset or can I sample my episodes using a sliding window approach? Could I even just randomly sample the dataset for episodes? For example, calculate a random date and build the episode from the 180 days following that random starting date?
The reward for each action is calculated as follows, p
are the prices and t
is the current timestep of the episode.
- CASH:
0
- BUY:
p(t+1) - p(t) - fee
- HOLD:
p(t+1) - p(t)