n1nj4z33 / iqoptionbot

IQ Option Trade system (Python 2.7)
37 stars 29 forks source link

Active is always EURUSD-OTC #3

Open j1and1 opened 7 years ago

j1and1 commented 7 years ago

Acording to the code in pattern base.py line self.api.getcandles(76, 60) the robot is always checking for the EURUSD-OTC candles not the active I chose in config....

Also when creating patterns in signaler.py active ID is not passed in as param to pattern constructor... so it always gets the candles for EURUSD-OTC with hardcoded id 76

Oh and by the way...... it sometimes crashes in pattern code because theres no check if the candles ar NoneType

I'm not a python guru, and I may be mistaking here somewhere, but please investigate this!

Oh and thanks for the great API ;)

f1ab83o commented 7 years ago

For NoneType error, try to set self.candles into a var and check if is not None. For example:

def put(self): """Method to check put pattern.""" t_candles = self.candles if t_candles is not None and ( t_candles.current_candle.candle_type == "red" ): return True