n1nj4z33 / iqoptionapi

IQ Option API 4.x (Python 2.7) The project is obsolete and is not supported because of problems with access to IQ Options in Russia
121 stars 559 forks source link

Delayed iqoption data (Not realtime?) #110

Open jimmylai-hk opened 5 years ago

jimmylai-hk commented 5 years ago

I try to read one minute iq option data at every minute using the following code.

However, I found that the returned data is not realtime. THe data delayed for 2-3 minutes. Let say the current time in iqoption platform is 21:53:01. I want to read the last candle which is 21:52 but the return data is at 21:50.

Anyone have similar finding?

while True: last_seconds=int(time.strftime("%S")) last_minutes=int(time.strftime("%M")) decimal=currency_decimal[pair] if (last_seconds >= 59) time.sleep(2) candles_con=con.getcandles(OP_code.ACTIVES[symbol], 60,1,time.time()) while con.candles.candles_data==None: pass candles_iq=pd.DataFrame(con.candles.candles_data)

jimmylai-hk commented 5 years ago

The updated code should be as following.

while True: last_seconds=int(time.strftime("%S")) last_minutes=int(time.strftime("%M")) decimal=currency_decimal[pair] if (last_seconds >= 59) time.sleep(2) candles_con=con.getcandles(OP_code.ACTIVES[symbol], 60,2,time.time()) while con.candles.candles_data==None: pass candles_iq=pd.DataFrame(con.candles.candles_data)