Skip to content

Commit

Permalink
Make action/observation space compatible with latest gym
Browse files Browse the repository at this point in the history
  • Loading branch information
AminHP committed Jun 30, 2022
1 parent 40c08e9 commit 96ae011
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gym_mtsim/envs/mt_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ def __init__(

# spaces
self.action_space = spaces.Box(
low=-np.inf, high=np.inf,
low=-1e10, high=1e10, dtype=np.float64,
shape=(len(self.trading_symbols) * (self.symbol_max_orders + 2),)
) # symbol -> [close_order_i(logit), hold(logit), volume]

self.observation_space = spaces.Dict({
'balance': spaces.Box(low=-np.inf, high=np.inf, shape=(1,)),
'equity': spaces.Box(low=-np.inf, high=np.inf, shape=(1,)),
'margin': spaces.Box(low=-np.inf, high=np.inf, shape=(1,)),
'features': spaces.Box(low=-np.inf, high=np.inf, shape=self.features_shape),
'balance': spaces.Box(low=-np.inf, high=np.inf, shape=(1,), dtype=np.float64),
'equity': spaces.Box(low=-np.inf, high=np.inf, shape=(1,), dtype=np.float64),
'margin': spaces.Box(low=-np.inf, high=np.inf, shape=(1,), dtype=np.float64),
'features': spaces.Box(low=-np.inf, high=np.inf, shape=self.features_shape, dtype=np.float64),
'orders': spaces.Box(
low=-np.inf, high=np.inf,
low=-np.inf, high=np.inf, dtype=np.float64,
shape=(len(self.trading_symbols), self.symbol_max_orders, 3)
) # symbol, order_i -> [entry_price, volume, profit]
})
Expand Down

0 comments on commit 96ae011

Please sign in to comment.