-
-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Digital options buy with actual price #65
Comments
@mattia177 sorry i don't understand. you want to check what price you buy? |
@Lu-Yi-Hsun I want to buy a digital option, not setting a specific strike price but buying it at the spot price (closest price). Is it possibile? |
Hi @mattia177 : The method to buy a digital option require the instrument_id
|
Hi @Mecabot : I’m not sure you are right. I know that you tipically you have to buy digital options at a specific strike price, but if you check well you will see that you can buy a digital option at the spot price, and the payout is fixed (usually at 87%). It’s an update of the platform che implemented about one month ago. It give you the chance to trade digital options in a similar way to binary options, but you can buy them till 15 seconds to expiry. Someone can Help me? |
@mattia177 you want set the price ,like forex limit price? |
@Lu-Yi-Hsun yes, something like: if [my asset] has a particular condition, then buy the digital options with limit price (strike price) equal to the spot price. It’s like forex limit price, and I want to use it with digitals (I know it’s possible) |
Any news? |
Hi @Lu-Yi-Hsun what @mattia177 means is that he wishes to do a purchase with the percentage ROI that you would get from a regular purchase that is not through using strike prices, in other words making a decision that the price will be higher or lower than it currently is using digital options(Due to the percentage ROI being different from Binary at times). I have attached an image below to help with understanding. I require this solution too, please. |
https://github.com/Lu-Yi-Hsun/iqoptionapi/blob/master/README.md#data-format Your can get that data |
Ho @TileshB, exactly, you understood what I mean :) If someone of you is interested, I developed an algo strategy to play with digital options, and backtested it through Bloomberg terminal. I can write it through Python, I am an engineer, but I do not have a professional account, if you want to join a business with me we could reach a strong result. Have a good day guys... |
You can get profit percentag. Sorry I still can not get your point. You can not set that limit price in digit You can buy digit by choose what profit you and price |
@Lu-Yi-Hsun Usually when you trade a classic binary option, you have a fixed payout percentage and you can buy it till 30 seconds to expiry. If you want to buy an option till 15seconds to expiry you have to buy a digital option, where you have to specify the strike price you want to execute the option. If you move far from the spot price the payout percentage will be slower, right? But you have a second way: buying a digital option without specifying the strike price, because you buy that option at the spot price. IQ Options tells you: Eur/Usd is @1.1213? If you don’t want to buy a digital option with strike price higher or lower, you can buy a digital option with strike price equals to 1.1213, the same level of the spot price. So, I would be interested to know how I could do this with python. I mean, how can I do a similar buy trade? |
Right!
Il giorno ven 5 apr 2019 alle 16:03 hesller <notifications@github.com> ha
scritto:
… I think what is trying to say is:
how to get the current price in digital options like in pic below
1 - First go to settings
[image: settings 1]
<https://user-images.githubusercontent.com/25598426/55633043-eed01700-5791-11e9-87a9-21e06b3bce01.PNG>
2 - Select the option "Current Price"
[image: settings 2]
<https://user-images.githubusercontent.com/25598426/55633283-64d47e00-5792-11e9-8d47-e634bb98ecec.PNG>
This way it`s possible to open digital orders in the current price instead
of orders to hit strike prices.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aoy4dEUChlbbJLFkrZSEd5aH7tC_Pkw0ks5vd1fNgaJpZM4ZgWHE>
.
|
#65 (comment) |
Any solution for this issue? |
@Lu-Yi-Hsun any news? Could you provide as a code to buy Digital Options with ACTUAL PRICE? |
I haven’t implement yet |
@Lu-Yi-Hsun I understand, do you think it will be long time for developing? Thank you |
I think it is very easy , I will add it |
Thank you, really appreciate it!
Il giorno mer 10 lug 2019 alle 15:45 Anson <notifications@github.com> ha
scritto:
… I think it is very easy , I will add it
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#65?email_source=notifications&email_token=AKGLQ5EPFA4XJUKFNEUCHWTP6XRWFA5CNFSM4GMBMHCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZTQEPY#issuecomment-510067263>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKGLQ5DUWG4F32IQJH5PV7DP6XRWFANCNFSM4GMBMHCA>
.
|
Nothing my friend?
Il giorno mer 10 lug 2019 alle ore 17:50 ardemagni mattia <
ardemagni.mattia@gmail.com> ha scritto:
… Thank you, really appreciate it!
Il giorno mer 10 lug 2019 alle 15:45 Anson ***@***.***> ha
scritto:
> I think it is very easy , I will add it
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#65?email_source=notifications&email_token=AKGLQ5EPFA4XJUKFNEUCHWTP6XRWFA5CNFSM4GMBMHCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZTQEPY#issuecomment-510067263>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AKGLQ5DUWG4F32IQJH5PV7DP6XRWFANCNFSM4GMBMHCA>
> .
>
|
this code can buy the price near current price! from iqoptionapi.stable_api import IQ_Option
import time
import random
I_want_money=IQ_Option("email","pasword")
goal="EURUSD"
size=1#size=[1,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,28800,43200,86400,604800,2592000,"all"]
maxdict=1
print("start stream...")
I_want_money.start_candles_stream(goal,size,maxdict)
print("print candles")
candle=I_want_money.get_realtime_candles(goal,size)
key=list(candle)[0]
current_price=candle[key]["close"]
print("current_price",current_price)
######
duration=1#minute 1 or 5
amount=1
buy="call"#or "put"
I_want_money.subscribe_strike_list(goal)
#get strike_list
data=I_want_money.get_realtime_strike_list(goal, duration)
#get price list
price_list=list(data.keys())
close_current_price=[]
for p_list in price_list:
close_current_price.append(abs(current_price-float(p_list)))
most_close_price=price_list[close_current_price.index(min(close_current_price))]
print("most_close_price",most_close_price,"current_price",current_price)
print(data[str(most_close_price)])
#random choose Strategy
choose_price=most_close_price
#get instrument_id
instrument_id=data[choose_price][buy]["id"]
#get profit
profit=data[choose_price][buy]["profit"]
print("choose you want to buy")
print("price:",choose_price,"side:call","instrument_id:",instrument_id,"profit:",profit)
#put instrument_id to buy
buy_check,id=I_want_money.buy_digital(amount,instrument_id)
if buy_check:
print("wait for check win")
#check win
while True:
check_close,win_money=I_want_money.check_win_digital(id)
if check_close:
if float(win_money)>0:
win_money=("%.2f" % (win_money))
print("you win",win_money,"money")
else:
print("you loose")
break
I_want_money.unsubscribe_strike_list(buy)
else:
print("fail to buy,please run again,digit is change very fast so sometime if can not buy the price!,please try more time") |
Thank you!!
Il giorno mar 16 lug 2019 alle ore 06:33 Anson <notifications@github.com>
ha scritto:
… Nothing my friend? Il giorno mer 10 lug 2019 alle ore 17:50 ardemagni
mattia < ***@***.***> ha scritto:
… <#m_5113456737074033187_>
Thank you, really appreciate it! Il giorno mer 10 lug 2019 alle 15:45
Anson *@*.***> ha scritto: > I think it is very easy , I will add it > >
— > You are receiving this because you were mentioned. > Reply to this
email directly, view it on GitHub > <#65
<#65>?email_source=notifications&email_token=AKGLQ5EPFA4XJUKFNEUCHWTP6XRWFA5CNFSM4GMBMHCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZTQEPY#issuecomment-510067263>,
> or mute the thread >
https://github.com/notifications/unsubscribe-auth/AKGLQ5DUWG4F32IQJH5PV7DP6XRWFANCNFSM4GMBMHCA
> . >
this code can get the close current price!
from iqoptionapi.stable_api import IQ_Option
import time
import random
I_want_money=IQ_Option("email","pasword")
goal="EURUSD"
size=1#size=[1,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,28800,43200,86400,604800,2592000,"all"]
maxdict=1
print("start stream...")
I_want_money.start_candles_stream(goal,size,maxdict)
print("print candles")
candle=I_want_money.get_realtime_candles(goal,size)
key=list(candle)[0]
current_price=candle[key]["close"]
print("current_price",current_price)
######
duration=1#minute 1 or 5
amount=1
buy="call"#or "put"
I_want_money.subscribe_strike_list(goal)
#get strike_list
data=I_want_money.get_realtime_strike_list(goal, duration)
#get price list
price_list=list(data.keys())
close_current_price=[]
for p_list in price_list:
close_current_price.append(abs(current_price-float(p_list)))
most_close_price=price_list[close_current_price.index(min(close_current_price))]
print("most_close_price",most_close_price,"current_price",current_price)
print(data[str(most_close_price)])
#random choose Strategy
choose_price=most_close_price
#get instrument_id
instrument_id=data[choose_price][buy]["id"]
#get profit
profit=data[choose_price][buy]["profit"]
print("choose you want to buy")
print("price:",choose_price,"side:call","instrument_id:",instrument_id,"profit:",profit)
#put instrument_id to buy
buy_check,id=I_want_money.buy_digital(amount,instrument_id)
if buy_check:
print("wait for check win")
#check win
while True:
check_close,win_money=I_want_money.check_win_digital(id)
if check_close:
if float(win_money)>0:
win_money=("%.2f" % (win_money))
print("you win",win_money,"money")
else:
print("you loose")
break
I_want_money.unsubscribe_strike_list(buy)
else:
print("fail to buy,please run again,digit is change very fast so sometime if can not buy the price!,please try more time")
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#65?email_source=notifications&email_token=AKGLQ5FQ2XJRGKGEY33AAU3P7VFRDA5CNFSM4GMBMHCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ7VG3A#issuecomment-511660908>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKGLQ5ARRVJW4SFUZHVMKO3P7VFRDANCNFSM4GMBMHCA>
.
|
Not working: buy_order() got an unexpected keyword argument
'stop_lose_price'
Il giorno mar 16 lug 2019 alle ore 11:09 ardemagni mattia <
ardemagni.mattia@gmail.com> ha scritto:
… Thank you!!
Il giorno mar 16 lug 2019 alle ore 06:33 Anson ***@***.***>
ha scritto:
> Nothing my friend? Il giorno mer 10 lug 2019 alle ore 17:50 ardemagni
> mattia < ***@***.***> ha scritto:
> … <#m_5021003690527267350_m_5113456737074033187_>
> Thank you, really appreciate it! Il giorno mer 10 lug 2019 alle 15:45
> Anson *@*.***> ha scritto: > I think it is very easy , I will add it > >
> — > You are receiving this because you were mentioned. > Reply to this
> email directly, view it on GitHub > <#65
> <#65>?email_source=notifications&email_token=AKGLQ5EPFA4XJUKFNEUCHWTP6XRWFA5CNFSM4GMBMHCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZTQEPY#issuecomment-510067263>,
> > or mute the thread >
> https://github.com/notifications/unsubscribe-auth/AKGLQ5DUWG4F32IQJH5PV7DP6XRWFANCNFSM4GMBMHCA
> > . >
>
> this code can get the close current price!
>
> from iqoptionapi.stable_api import IQ_Option
> import time
> import random
>
>
>
> I_want_money=IQ_Option("email","pasword")
>
>
>
> goal="EURUSD"
>
> size=1#size=[1,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,28800,43200,86400,604800,2592000,"all"]
>
> maxdict=1
> print("start stream...")
>
> I_want_money.start_candles_stream(goal,size,maxdict)
>
>
> print("print candles")
>
> candle=I_want_money.get_realtime_candles(goal,size)
>
> key=list(candle)[0]
>
> current_price=candle[key]["close"]
> print("current_price",current_price)
>
>
> ######
>
>
>
>
>
> duration=1#minute 1 or 5
>
> amount=1
>
> buy="call"#or "put"
>
> I_want_money.subscribe_strike_list(goal)
> #get strike_list
>
> data=I_want_money.get_realtime_strike_list(goal, duration)
>
>
> #get price list
>
> price_list=list(data.keys())
>
>
>
> close_current_price=[]
> for p_list in price_list:
>
> close_current_price.append(abs(current_price-float(p_list)))
>
>
>
> most_close_price=price_list[close_current_price.index(min(close_current_price))]
> print("most_close_price",most_close_price,"current_price",current_price)
> print(data[str(most_close_price)])
>
>
> #random choose Strategy
>
> choose_price=most_close_price
> #get instrument_id
>
> instrument_id=data[choose_price][buy]["id"]
> #get profit
>
> profit=data[choose_price][buy]["profit"]
> print("choose you want to buy")
> print("price:",choose_price,"side:call","instrument_id:",instrument_id,"profit:",profit)
> #put instrument_id to buy
>
> buy_check,id=I_want_money.buy_digital(amount,instrument_id)
> if buy_check:
>
> print("wait for check win")
>
> #check win
>
> while True:
>
> check_close,win_money=I_want_money.check_win_digital(id)
>
> if check_close:
>
> if float(win_money)>0:
>
> win_money=("%.2f" % (win_money))
>
> print("you win",win_money,"money")
>
> else:
>
> print("you loose")
>
> break
>
> I_want_money.unsubscribe_strike_list(buy)
> else:
>
> print("fail to buy,please run again,digit is change very fast so sometime if can not buy the price!,please try more time")
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#65?email_source=notifications&email_token=AKGLQ5FQ2XJRGKGEY33AAU3P7VFRDA5CNFSM4GMBMHCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ7VG3A#issuecomment-511660908>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AKGLQ5ARRVJW4SFUZHVMKO3P7VFRDANCNFSM4GMBMHCA>
> .
>
|
@mattia177 |
Ok I try and then will tell you, thanks
Il giorno mer 17 lug 2019 alle 00:29 Anson <notifications@github.com> ha
scritto:
… @mattia177 <https://github.com/mattia177>
What your api version?
Try update
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#65?email_source=notifications&email_token=AKGLQ5CFECOKP46F2TUKCQDP7ZDUVA5CNFSM4GMBMHCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2COMDI#issuecomment-512026125>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKGLQ5H52KHGW3OGCYP4IITP7ZDUVANCNFSM4GMBMHCA>
.
|
My friend, I just tried but it's not what I would need yet. If you see the image I'm actually pasting, you will see that on digital option instrument you can chose between two options:
I would need to buy the option at the actual price, as you can see in the image where the flag is on the right option. Do you think to be able to solve this issue? |
@mattia177 The sample code can buy the actual price! In the low level iqoption buy the Actual price
2.buy the actual price near the candle |
As the guys said in the previous messages, I tried to change a little part of your code and I put as "INSTRUMENT ID" = doEURUSD201907242130PT5MCSPT In this way it works and it buys always at the ACTUAL PRICE. Now the only thing you could do, if not a problem, is putting it into a function...and the last problem is that in the strike list there are the payouts for all the strikes, but not for the instrument id that finishes with "SPT" --> that means SPOT. How could you do to find that in your opinion? |
Nothing mi friend? |
@thiagottjv thank you ,I will check how to implement! And put your name on the code haha |
@Lu-Yi-Hsun We trust in your ability to develop our request my friend :) |
Does the code still work? I'm having trouble getting the current price |
Not working , I am find what happen |
Thanks. You are good! |
I am waiting for a solution for getting the actual price and a fixed profit as well. Tks for the great work. |
Not work? |
thank@thiagottjv @mattia177 @valderind4 @htnlabs |
Great job |
Your welcome. Your code helped me a lot understanding how the api works. Thanks for that! |
Thank You so much for your effort, but I am getting some return of "error" on using buy_digital_spot and when It works I am getting error on check_win_digital as you can see at the picture attached, maybe the problem is that you return digital_option_placed_id in the new code instead return order_id required to use on check_win_digital as before. Is there another python def to check win for digital spot or I am doing something wrong? |
@valderind4 thank ,i will check id problem |
thanks for your great job again. Below is more specifically the "error" returned when it try buying a digital spot sometimes: Is It not possible to return the specific error message explaining the reason for not buying at that time? PS: Please check that buy_order_id is always returning "None". |
After the API update yesterday, after 1 hour of execution I am getting this error bellow:
PS: before the code update I could run for a lot of hours in a row without get any error. |
Replace on the last lines: I_want_money.unsubscribe_strike_list(buy) |
Hello @Lu-Yi-Hsun any news about the problem regarding order id? |
News? |
I thank so much to @Lu-Yi-Hsun for his great job, but It so important to get the spot price. So far, we can only wait for it. |
Hello @Lu-Yi-Hsun the API development is stopped? We need just get the return (win or loss) for buy digital spot method because no method that exists right now can get the correct return and the check_digital_win return order id not found since the buy digital spot returns the digital option id instead of the order id, please help us!!! |
@thiagottjv How is it going Your PHP api Will You put it on Github? |
@valderind4 Unfortunately I wont be making an api on PHP. What I did was just a one page class including the websocket connection and the request to connect. Thats basically it. After that you send requests to subscribe to the candle stream and buy when its time. |
Tks for your answser I got what you said, my problem is on getting the return (win or loss). |
Iq option is update the server ,so some api can not working , I am fix check win for now |
Thank You so much @Lu-Yi-Hsun because check win is, for now, the only thing that makes the API not working for me. |
Hi @Lu-Yi-Hsun |
Hi @Lu-Yi-Hsun def procura_abertas(tipo):
par = API.get_all_open_time() |
Hi, I am using iqoptionapi for my python code. i am still getting error in check_win_digital_v2.Please help me |
Hi my friend,
Could you please tell me (and write) a code where I can buy a digital option (for example EURUSD digital) where as buy price I have the actual price?
Now on IQ Option you can buy digitals both setting a specific price or with the actual price (with a fixed payout associated). I would be interested into this second way. Could you help me?
Thanks!
The text was updated successfully, but these errors were encountered: