Closed JafferWilson closed 5 years ago
@JafferWilson yes! iqoption only can get 1000 candle once time!! so you need to write a for loop to get more! be careful the time need change!
@Lu-Yi-Hsun Is there no way to get the candles more than 1000? I hope there must be something in the code that can be done. Please help me.
@JafferWilson it need some time, because you only can get 1000 candle once time
from iqoptionapi.stable_api import IQ_Option
import time
I_want_money=IQ_Option("email","password")
end_from_time=time.time()
ANS=[]
for i in range(70):
data=I_want_money.get_candles("EURUSD", 60, 1000, end_from_time)
ANS =data+ANS
end_from_time=int(data[0]["from"])-1
print(ANS)
Thank you @Lu-Yi-Hsun. I tried this. But the candles that I got is something like this:
I see that the candles returned are not like the actual candles that are on the IQO. Please can you check it once? I see OHLC values but no biid ask values .. may thats the reason for the weird candles.
@JafferWilson How to print candle to that image? Iqoption do not sent ask/bid . Only OHLC
Basically I am using MT5 - Metatrader5 to visualize the candles that are sent through your api. Hence, I am a bit concerned why is this happening? The MT5 show only what it receives. ultimately it just a visualization point for the candles.
@JafferWilson 1.what time you catch the candle
2.give me your raw data (csv file for mt5) what is : Tick Volume /Volume different?
Ok @Lu-Yi-Hsun I will share the data file with you, here it is:
10001candles.txt Please let me know, if there is any issue.
@JafferWilson 1970-01-01? you get the data from iqoption? iqoption do not have volume
Ok check this new file then:
10001candles.txt
Please check this.. Still I am having trouble plotting. Please can you
check it once.
@JafferWilson try this code output iqoption candle to csv for MT5 i have been check it is same as iqoption plot 1.check MT5 Timeframes is right 2.if you view large gap of candle (1).check your data do not miss (2) or the data is cross to holiday put MT5.csv file to MT5
from iqoptionapi.stable_api import IQ_Option
import time
import datetime
I_want_money=IQ_Option("email","password" )
end_from_time=time.time()
ANS=[]
for i in range(1):
data=I_want_money.get_candles("EURUSD", 60, 1000, end_from_time)
ANS =data+ANS
end_from_time=int(data[0]["from"])-1
ok=""
for li in ANS:
value = datetime.datetime.fromtimestamp(li["to"])
exct_time =value.strftime('%Y.%m.%d %H:%M:%S')
ok=exct_time+","+str(li["open"])+","+str(li["max"])+","+str(li["min"])+","+str(li["close"])+","+str(li["volume"])+"\n"+ok
fp=open("MT5.csv","w+")
fp.write(ok)
@Lu-Yi-Hsun Ok, I will chec it out. I thought the candles returned are not the one from the IQO. I guess the time-frame might be issue. I will check it out. thank you help.
@Lu-Yi-Hsun Have a look at the two images.
This one is from the IQoption:
The following is from the MT5:
Kindly, let me know whether they look same to you. Please let me know what might have caused this issue.
@JafferWilson
you check the value is different?
i get the same image
try this code and we have same timestamp
:heavy_exclamation_mark:please check MT5 and iqoption Timeframes is the same 1 min
from iqoptionapi.stable_api import IQ_Option
import time
import datetime
I_want_money=IQ_Option("email","password" )
end_from_time=1539675885
ANS=[]
for i in range(1):
data=I_want_money.get_candles("EURUSD", 60, 1000, end_from_time)
ANS =data+ANS
end_from_time=int(data[0]["from"])-1
ok=""
for li in ANS:
value = datetime.datetime.fromtimestamp(li["to"])
exct_time =value.strftime('%Y.%m.%d %H:%M:%S')
ok=exct_time+","+str(li["open"])+","+str(li["max"])+","+str(li["min"])+","+str(li["close"])+","+str(li["volume"])+"\n"+ok
fp=open("MT5.csv","w+")
fp.write(ok)
Hey @Lu-Yi-Hsun can you share the code that you used in MT5 for it? I am trying to make it but getting different result still may be made some another mistake in displaying the stuff.
@JafferWilson you mean MT5 call this api function to produce the candle? i do not know MT5 code! i produce the data from this api,and import the data to MT5
@JafferWilson no! it need to import .csv/.prn/.txt View->Symbols->Create Custom Symbol->click your new Symbol->Bars->import Bars->Browse and you can import the data
Yes yes.. I got it .. I forgot almost.. I am trying it out.. thank you.. I am checking if it works for me.
Dear @Lu-Yi-Hsun Please have a look at this image: I do not understand what might be the issue. I tried everything but still the candles are the same way they looked before. Have a look at the image:
There is a lot of dojis. Please let me know whether this is a fault of IQO api or is there anything you think is there any mistake in my way? I tried it your way this time by importing but the same thing happened.
what your timestamp?
Here have a look at the file:
MT5.txt
Try using this. I have changed one line from your current where you have mentioned end time:
end_from_time=1539675885
to
end_from_time=time.time()
As I was in need of candles from current time.
check the value is same or different?
See the following @Lu-Yi-Hsun :
Have a look at this. This values are getting truncated I guess.
You helped a lot my friend I guess this is the fault of MT5 itself. I will check with them.
Thank you very much for your help ... :)
@JafferWilson my pleasure
I have tried the following way to collect the dataset, but got only 1000 candles and no more.
Please help me.