| 1: Input: Full dataset D, window configurations
|
| 2: Output: Trained agents for specific time periods |
| 3: |
| 4: Function
TrainRLAgnets (D, windows): |
| 5:
SplitDataset(D, windows) |
| 6:
{Initialize empty dictionary for storing agents} |
| 7: for each
in
windows: |
| 8: for each
segment
in
: |
| 9:
InitializeRLModel()
|
| 10: Train(agent, segment.data) {Train agent on data segment} |
| 11:
|
| 12: return
agents
|
| 13: |
| 14: Function
SplitDataset(D, windows): |
| 15:
|
| 16: for each
in
windows: |
| 17: if
“yearly”: |
| 18:
SplitByYear(D) |
| 19: if
"semiannual": |
| 20:
SplitBySixMonths(D) |
| 21: if
"quarterly": |
| 22:
SplitByThreeMonths(D) |
| 23: return
|
| 24: |
| 25: Main Program: |
| 26:
LoadMarketData()
|
| 27:
|
| 28:
TrainRLAgents(D, windows) |
| 29: Print(“Agents trained:",
) |