Skip to content
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

Struggling with the buy_order_id for Buy_order #323

Open
Arielnu opened this issue Dec 27, 2021 · 1 comment
Open

Struggling with the buy_order_id for Buy_order #323

Arielnu opened this issue Dec 27, 2021 · 1 comment

Comments

@Arielnu
Copy link

Arielnu commented Dec 27, 2021

Hi there!

I have been trying to set up the code for the buy_order option in the IQOption API and find that I'm struggling at the buy_order_id= part.

I would like to know, how exactly do I write the code in order to accurately return the buy_order_id and what exactly do I put after the buy_order_id= part?

So far my code looks like this:

while True:
for RTS in Realtime:
print(Realtime[RTS]["open"])
print(Realtime[RTS]["close"])
time.sleep(0.1)
if ["open"] == ["open"]:
Buy = API.buy_order(instrument_type="crypto", instrument_id="BTCUSD",side="buy",amount=1,leverage=0,type="Market",
limit_price=None,stop_price=None,stop_lose_kind=None,stop_lose_value=None,take_profit_kind="percent",
take_profit_value=1,use_trail_stop=False,auto_margin_call=True,use_token_for_commission=False)
id = API.get_async_order(buy_order_id= id())
print (id())

I just want to know, how do I get the correct order of functions here to get this buy_order code running?

Any help would be appreciated!

Thanks again for the amazing API! Keep up the great work! Great job!

@TheHolsback
Copy link

TheHolsback commented Dec 27, 2021

i use the .buy_digital_spot_v2(Active, amount, action, duration) function to start a negotiation. (for binary/turbo type, use .buy(amount, active, action, duration)
This function return the status and ID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants