Open sqlsaikumar opened 6 years ago
@sqlsaikumar I think you can try real-time sample ,it is candle stream I think it can work better
Thanks for the update @Lu-Yi-Hsun , Tried the realtime candle . but its not accepting the parameters .Below is the code i tried
from iqoptionapi.stable_api import IQ_Option
import logging
import time
I_want_money=IQ_Option("email","password")
goal="EURUSD"
size=60
maxdict=10
I_want_money.start_candles_stream(goal,size,maxdict)
time.sleep(10)
cc=I_want_money.get_realtime_candles(goal,size)
for k in cc:
print(goal,"size",k,cc[k])
print("stop candle")
I_want_money.stop_candles_stream(goal,size)
it raising error . I think its not accepting more than 1 parameter : is there any thing like we get 1min candle from realtime stream.
Traceback (most recent call last):
File "test.py", line 18, in <module>
thread=I_want_money.collect_realtime_candles_thread_start(goal,60,100)
TypeError: collect_realtime_candles_thread_start() takes 3 positional arguments but 4 were given
Check your iqoption version is last version
yes @Lu-Yi-Hsun . i upgraded it to latest one,Still im getting the same , unable to pass parameters
@sqlsaikumar first check your version is 2.1.1 if not please uninstall all all and reinstall
I_want_money=IQ_Option("email","password")
print(I_want_money.__version__)
than run this sample
from iqoptionapi.stable_api import IQ_Option
import logging
import time
#logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(message)s')
print("login...")
I_want_money=IQ_Option("email","password")
goal="EURUSD"
size="all"#size=[1,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,28800,43200,86400,604800,2592000,"all"]
maxdict=10
print("start stream...")
I_want_money.start_candles_stream(goal,size,maxdict)
#DO something
print("Do something...")
time.sleep(10)
print("print candles")
cc=I_want_money.get_realtime_candles(goal,size)
for k in cc:
print(goal,"size",k,cc[k])
print("stop candle")
I_want_money.stop_candles_stream(goal,size)
Hey Hi @Lu-Yi-Hsun , Most of the time while fetching 1min candle it raising
ERROR:root:**error** get_candles need reconnect .
Because of re-connection i'm missing some 1min candles .Is there anything that i need to add in my code to increase the connection buffer. Here is my code .