Open keinbuck opened 5 years ago
@keinbuck
i check what happen now
@keinbuck
i fix the bug
if your leverage is not Available you will happen this
from iqoptionapi.stable_api import IQ_Option
I_want_money = IQ_Option("email", "password")
instrument_type="forex"
instrument_id="EURUSD"
side="buy"#sell
type="market"#limit
amount=10
limit_price=0#for limit ,if you choose market this not work,
leverage=200#you can get more information in get_available_leverages()
#^^^^^^^^^^^^^
stop_lose_price=1.12#
take_profit_price=1.16#
check,order_id=I_want_money.buy_order(instrument_type,instrument_id,side,type,amount,limit_price,leverage,stop_lose_price,take_profit_price)
Thank you for the fast reply... So the way i used the Code was correct?! Will try tomorrow with version 3.5. The lerverage in my example was available (20) for EURUSD.
@keinbuck you need use "get_available_leverages()" check ""available leverage"" in sample code work in "200"
Thats what i did and Response was [20, 30]. Why 200 in your example?
@keinbuck
from iqoptionapi.stable_api import IQ_Option
I_want_money = IQ_Option("email", "password")
instrument_type="forex"
instrument_id="EURUSD"
print(I_want_money.get_available_leverages(instrument_type,instrument_id))
(True, {'instrument_type': 'forex', 'group_id': 1, 'leverages': [{'active_id': 1, 'unregulated': [200, 300, 500, 1000], 'unregulated_default': 300, 'regulated': [200, 300, 500, 1000], 'regulated_default': 300}]})
In my case (Europe) just 20 and 30 is available...
ok,try v3.5
Thanks!!!!
Can someone please give me an example for buying EURUSD as forex. See below for how I tried, but it ends in an infinite loop... Thank you guys in advance!
instrument_type="forex" instrument_id="EURUSD" side="buy"#sell type="market"#limit amount=10 limit_price=0#for limit ,if you choose market this not work, leverage=20#you can get more information in get_available_leverages() stop_lose_price=1.12# take_profit_price=1.16#
check,order_id=I_want_money.buy_order(instrument_type,instrument_id,side,type,amount,limit_price,leverage,stop_lose_price,take_profit_price)