Lu-Yi-Hsun / iqoptionapi

IQ Option API
372 stars 288 forks source link

Indicators IQ #137

Open josuecocoman opened 4 years ago

josuecocoman commented 4 years ago

Hello 👋

I would like to know if you have a way to get the iQ indicators in real time with all decimals without rounding (Donation for the Collaboration or indication how to obtain them)

I saw that you recommend this library https://mrjbq7.github.io/ta-lib/ for indicators but this is not real time it is a calculation with formula and missing values

Lu-Yi-Hsun commented 4 years ago

Real-time candle api + TA-lib

josuecocoman commented 4 years ago

So I am populating it and I realize that TA-lib does not bring the information in real time the indicators is a formula that generates an approximate not exact due to the lack of all decimals

josuecocoman commented 4 years ago

TA-lib is missing or not all parameters exist, and the only ones it delivers is an approximate

Lu-Yi-Hsun commented 4 years ago

Give me Sample code

josuecocoman commented 4 years ago

data=I_want_money.get_candles(goal, 60, 7, time.time()) if int(end_time - time.time() - 30) == 31:

when it reaches the second 31

the library gives me the value 39

but the real value is -89

josuecocoman commented 4 years ago

if int(end_time - time.time() - 30) == 31: data=I_want_money.get_candles(goal, 60, 7, time.time())

    data1 = pd.DataFrame(data)
    max = np.asarray(data1["max"].tolist())
    close = np.asarray(data1['close'].tolist())
    min = np.asarray(data1['min'].tolist())
    #
    cci1 = talib.CCI(max, min, close, timeperiod=7)
    print(cci1)
    print("-----------------------------------------------------------")
Lu-Yi-Hsun commented 4 years ago

https://github.com/Lu-Yi-Hsun/iqoptionapi/blob/master/README.md#get-realtime-candles

Please use get real-time candle,

Because get candle api only can get the close candle. Get candle api not real time so the indicator value is different

JafferWilson commented 4 years ago

@josuecocoman Try as @Lu-Yi-Hsun has said. I do not have Ta-LIB. But I can quote a rough example here that might be helpful.

>>> import talib,time
>>> from iqoptionapi.stable_api import IQ_Option
>>> maxdict=1
>>> size=60
>>> goal="EURUSD"
>>> I_want_money=IQ_Option(email,password)
>>> I_want_money.__version__
'4.0.0'
>>> I_want_money.start_candles_stream(goal,size,maxdict)
>>> cc=I_want_money.get_realtime_candles(goal,size)
>>> while True:
...           for key in cc:
...               cci1 = talib.CCI(cc[key]["max"], cc[key]["min"], cc[key]["close"], timeperiod=7)
...               print(cci1)
...           time.sleep(1)
mlSourcerer commented 3 years ago

https://github.com/Lu-Yi-Hsun/iqoptionapi/blob/master/README.md#get-realtime-candles

Please use get real-time candle,

Because get candle api only can get the close candle. Get candle api not real time so the indicator value is different

Hello. Apparently, get_realtime_candles is not working correctly. When I do:

goal="EURUSD" size=1 maxdict=1 Iq.start_candles_stream(goal,size,maxdict) cc=Iq.get_realtime_candles(goal,size) for k in cc: print(datetime.fromtimestamp(cc[k]['from']))

it shows yesterday date and the times are completely wrong.

Could someone help me?