AminHP / gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)
MIT License
2.1k stars 465 forks source link

What is the purpose of this code? len(frame_bound) == 2 (Question) #23

Closed toksis closed 4 years ago

toksis commented 4 years ago

What is the purpose of this code in forex_env? assert len(frame_bound) == 2? I am getting this error. What is the purpose of that? my parameters are window_size: 10 frame_bound: (50, 100)

 def __init__(self, df, window_size, frame_bound, unit_side='left'):

        print("df: ",df," window_size: ",window_size," frame_bound: ", frame_bound)
        assert len(frame_bound) == 2
        assert unit_side.lower() in ['left', 'right']

        self.frame_bound = frame_bound
        self.unit_side = unit_side.lower()
        super().__init__(df, window_size)

        self.trade_fee = 0.0003  # unit
toksis commented 4 years ago

So the error is how to add the parameter frame bound in Visual studio code.

AminHP commented 4 years ago

This line of code only checks that you pass a tuple/list of size 2. It shouldn't give an error if your frame_bound is (50, 100).

toksis commented 4 years ago

Thank you