AminHP / gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

self.signal_features[0] and self.signal_features[-1] are never be used

lbgitjp opened this issue · comments

in the class TradingEnv, self.signal_features[0] and self.signal_features[-1] are never be used.

  1. below code will skip self.signal_features[0]:
    def _get_observation(self):
    return self.signal_features[(self._current_tick-self.window_size+1):self._current_tick+1]

I think it should be changed to:

def _get_observation(self):
    return self.signal_features[(self._current_tick-self.window_size):self._current_tick]
  1. below code will skip self.signal_features[-1]:

    if self._current_tick == self._end_tick:
    self._done = True

    I think it should be changed to:

     if self._current_tick == self._end_tick+ 1:
         self._done = True
    

thanks!