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

buy_order() not working #347

Open
Dawood-Siddique opened this issue Jul 22, 2023 · 3 comments
Open

buy_order() not working #347

Dawood-Siddique opened this issue Jul 22, 2023 · 3 comments

Comments

@Dawood-Siddique
Copy link

Describe the bug
When I try to buy forex or crypto using buy_order(), it goes into infinite loop and error given is:

**ERROR:websocket:error from callback <bound method WebsocketClient.on_message of <iqoptionapi.ws.client.WebsocketClient object at 0x7d4160ab1480>>: 'id'
  File "/usr/local/lib/python3.10/dist-packages/websocket/_app.py", line 343, in _callback
    callback(*args)
  File "/usr/local/lib/python3.10/dist-packages/iqoptionapi/ws/client.py", line 139, in on_message
    order_placed_temp(self.api, message)
  File "/usr/local/lib/python3.10/dist-packages/iqoptionapi/ws/received/order_placed_temp.py", line 5, in order_placed_temp
    api.buy_order_id = message["msg"]["id"]**

And when I stop the cell it then tells that it was stuck in

   **1249         )
   1250 
-> 1251         while self.api.buy_order_id == None:
   1252             pass
   1253         check, data = self.get_order(self.api.buy_order_id)**

To Reproduce
Steps to reproduce the behavior:

  1. After login and connecting
  2. check,order_id=Iq.buy_order(instrument_type=instrument_type, instrument_id=instrument_id,
    side=side, amount=amount,leverage=leverage,
    type=type,limit_price=limit_price, stop_price=stop_price,
    stop_lose_value=stop_lose_value, stop_lose_kind=stop_lose_kind,
    take_profit_value=take_profit_value, take_profit_kind=take_profit_kind,
    use_trail_stop=use_trail_stop, auto_margin_call=auto_margin_call,
    use_token_for_commission=use_token_for_commission)
  3. after running the code which is copied from documentation
  4. Error

Thanks For you time

@damianportillo
Copy link

The same error happens to me.

@FarnazAbdollahi
Copy link

@Lu-Yi-Hsun can you please help us with this matter? i have the same problem

@Sekharonline4u
Copy link

@Lu-Yi-Hsun help us please buy_order method is not working and showing the following error:

__For_Forex_Stock_Commodities_Crypto_ETFs
File "/Users/sekharsrinivasan/Desktop/IQOptionForexBot/iqoptionenv/lib/python3.9/site-packages/websocket_client-0.56.0-py3.9.egg/websocket/_app.py", line 343, in _callback
callback(*args)
File "/Users/sekharsrinivasan/Desktop/IQOptionForexBot/iqoptionenv/lib/python3.9/site-packages/iqoptionapi-7.1.1-py3.9.egg/iqoptionapi/ws/client.py", line 139, in on_message
order_placed_temp(self.api, message)
File "/Users/sekharsrinivasan/Desktop/IQOptionForexBot/iqoptionenv/lib/python3.9/site-packages/iqoptionapi-7.1.1-py3.9.egg/iqoptionapi/ws/received/order_placed_temp.py", line 5, in order_placed_temp
api.buy_order_id = message["msg"]["id"]

Please help us - Sekhar

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

4 participants