AminHP / gym-mtsim

A general-purpose, flexible, and easy-to-use simulator alongside an OpenAI Gym trading environment for MetaTrader 5 trading platform (Approved by OpenAI Gym)
MIT License
412 stars 101 forks source link

questions on _process_data(), _get_observation() and multi symbols #11

Closed yglpyn8888 closed 2 years ago

yglpyn8888 commented 2 years ago

1 The _process_data() method takes the return value of _get_prices() as a feature, but the return value of _get_prices() is two columns of bar data which are close and open, and this are not features. Why? 2 _get_observation() returns a dict, but not a np.ndarray, for a typicle gym env, Shouldn't the observation returned by the step method be a np.ndarray? 3 I see many data structures in this framework use Dict, which should be to support multiple symbols? I only load data of a single symbol, so should I change the underlying data structure,? or just put a single key (the single symbol i focus on) in the dict.

yglpyn8888 commented 2 years ago

for question1 , i thought i understand that you just collect close and open as two features as an example, and i can override this method to load other feature columns what i want

AminHP commented 2 years ago
  1. It should return Dict when the observation_space is an instance of spaces.Dict.
  2. There is no need to change the structure. Just put a single key for the symbol you want. And make sure simulator.unit is in symbol_info.currencies for that symbol.