fix fees RL
This commit is contained in:
parent
95651fcd5a
commit
2b3e166dc2
@ -194,12 +194,12 @@ class BaseEnvironment(gym.Env):
|
|||||||
if self._position == Positions.Neutral:
|
if self._position == Positions.Neutral:
|
||||||
return 0.
|
return 0.
|
||||||
elif self._position == Positions.Short:
|
elif self._position == Positions.Short:
|
||||||
current_price = self.add_exit_fee(self.prices.iloc[self._current_tick].open)
|
|
||||||
last_trade_price = self.add_entry_fee(self.prices.iloc[self._last_trade_tick].open)
|
|
||||||
return (last_trade_price - current_price) / last_trade_price
|
|
||||||
elif self._position == Positions.Long:
|
|
||||||
current_price = self.add_entry_fee(self.prices.iloc[self._current_tick].open)
|
current_price = self.add_entry_fee(self.prices.iloc[self._current_tick].open)
|
||||||
last_trade_price = self.add_exit_fee(self.prices.iloc[self._last_trade_tick].open)
|
last_trade_price = self.add_exit_fee(self.prices.iloc[self._last_trade_tick].open)
|
||||||
|
return (last_trade_price - current_price) / last_trade_price
|
||||||
|
elif self._position == Positions.Long:
|
||||||
|
current_price = self.add_exit_fee(self.prices.iloc[self._current_tick].open)
|
||||||
|
last_trade_price = self.add_entry_fee(self.prices.iloc[self._last_trade_tick].open)
|
||||||
return (current_price - last_trade_price) / last_trade_price
|
return (current_price - last_trade_price) / last_trade_price
|
||||||
else:
|
else:
|
||||||
return 0.
|
return 0.
|
||||||
|
Loading…
Reference in New Issue
Block a user