Skip to content

Commit a3edd14

Browse files
committed
docs: update readme doc
1 parent 6a79e2a commit a3edd14

File tree

5 files changed

+100
-56
lines changed

5 files changed

+100
-56
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ pip install -r requirements.txt
123123

124124
**多只股票**
125125

126-
选取 `79` 只股票,进行训练,共计
126+
选取 `1002` 只股票,进行训练,共计
127127

128-
- 盈利: `44.8%`
129-
- 不亏不赚: `49.0%`
130-
- 亏损:`6.3%`
128+
- 盈利: `44.5%`
129+
- 不亏不赚: `46.5%`
130+
- 亏损:`9.0%`
131131

132132
<img src="img/pie.png" alt="drawing" width="60%"/>
133133

img/hist.png

-762 Bytes
Loading

img/pie.png

425 Bytes
Loading

rlenv/StockTradingEnv0.py

-30
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,6 @@ def __init__(self, df):
3535
self.observation_space = spaces.Box(
3636
low=0, high=1, shape=(19,), dtype=np.float16)
3737

38-
def _next_observation2(self):
39-
# Get the stock data points for the last 5 days and scale to between 0-1
40-
frame = np.array([
41-
self.df.loc[self.current_step: self.current_step + 5, 'open'].values / MAX_SHARE_PRICE,
42-
self.df.loc[self.current_step: self.current_step + 5, 'high'].values / MAX_SHARE_PRICE,
43-
self.df.loc[self.current_step: self.current_step + 5, 'low'].values / MAX_SHARE_PRICE,
44-
self.df.loc[self.current_step: self.current_step + 5, 'close'].values / MAX_SHARE_PRICE,
45-
self.df.loc[self.current_step: self.current_step + 5, 'volume'].values / MAX_VOLUME,
46-
self.df.loc[self.current_step: self.current_step + 5, 'amount'].values / MAX_AMOUNT,
47-
self.df.loc[self.current_step: self.current_step + 5, 'adjustflag'].values / 10,
48-
self.df.loc[self.current_step: self.current_step + 5, 'tradestatus'].values / 1,
49-
self.df.loc[self.current_step: self.current_step + 5, 'pctChg'].values / 100,
50-
self.df.loc[self.current_step: self.current_step + 5, 'peTTM'].values / 1e4,
51-
self.df.loc[self.current_step: self.current_step + 5, 'pbMRQ'].values / 100,
52-
self.df.loc[self.current_step: self.current_step + 5, 'psTTM'].values / 100,
53-
self.df.loc[self.current_step: self.current_step + 5, 'pctChg'].values / 1e3,
54-
])
55-
56-
# Append additional data and scale each value to between 0-1
57-
obs = np.append(frame, [[
58-
self.balance / MAX_ACCOUNT_BALANCE,
59-
self.max_net_worth / MAX_ACCOUNT_BALANCE,
60-
self.shares_held / MAX_NUM_SHARES,
61-
self.cost_basis / MAX_SHARE_PRICE,
62-
self.total_shares_sold / MAX_NUM_SHARES,
63-
self.total_sales_value / (MAX_NUM_SHARES * MAX_SHARE_PRICE),
64-
]], axis=0)
65-
66-
return obs
67-
6838
def _next_observation(self):
6939
obs = np.array([
7040
self.df.loc[self.current_step, 'open'] / MAX_SHARE_PRICE,

0 commit comments

Comments
 (0)