Lu-Yi-Hsun / iqoptionapi

IQ Option API
372 stars 289 forks source link

Not able to get the tick values #24

Closed JafferWilson closed 6 years ago

JafferWilson commented 6 years ago

Hello Lu, Thank you for sharing the reference of your repository. Can you tell me how I can get the tick values of the iqoption in realtime and connect the api with MT5 for analysis?

Lu-Yi-Hsun commented 6 years ago

@JafferWilson In README file this can get real-time data

from iqoptionapi.stable_api import IQ_Option
import logging
import time
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(message)s')
I_want_money=IQ_Option("email","password")
I_want_money.start_candles_stream("EURUSD")
thread=I_want_money.collect_realtime_candles_thread_start("EURUSD",100)
I_want_money.start_candles_stream("USDTRY")
thread2=I_want_money.collect_realtime_candles_thread_start("USDTRY",100)
time.sleep(3)
#Do some thing
ans=I_want_money.thread_collect_realtime.items()
for k, v in ans:
    print (k, v)
I_want_money.collect_realtime_candles_thread_stop(thread)
I_want_money.stop_candles_stream("EURUSD")
I_want_money.collect_realtime_candles_thread_stop(thread2)
I_want_money.stop_candles_stream("USDTRY")

I think if you very very care about realtime you can try this https://1forge.com/forex-data-api

Sorry I am not write to connect MT5 I think you can use python lib to get the same analysis

JafferWilson commented 6 years ago

This is great. Thank you for your help. I just need to find out how I can use it in MT5 now...