@@ -35,36 +35,6 @@ def __init__(self, df):
35
35
self .observation_space = spaces .Box (
36
36
low = 0 , high = 1 , shape = (19 ,), dtype = np .float16 )
37
37
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
-
68
38
def _next_observation (self ):
69
39
obs = np .array ([
70
40
self .df .loc [self .current_step , 'open' ] / MAX_SHARE_PRICE ,
0 commit comments