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

Market orders working / but not limit orders? #15

Open
jpbruneton opened this issue Mar 5, 2024 · 0 comments
Open

Market orders working / but not limit orders? #15

jpbruneton opened this issue Mar 5, 2024 · 0 comments

Comments

@jpbruneton
Copy link

answer = client.buy('BTC-PERPETUAL', 10, 'limit', False, price = 64460)
would be
{'jsonrpc': '2.0', 'id': 1, 'result': {'trades': [], 'order': {'is_liquidation': False, 'risk_reducing': False, 'order_type': 'limit', 'creation_timestamp': 1709663161987, 'order_state': 'open', 'contracts': 1.0, 'average_price': 0.0, 'reduce_only': False, 'post_only': False, 'last_update_timestamp': 1709663161987, 'filled_amount': 0.0, 'replaced': False, 'web': False, 'api': True, 'mmp': False, 'instrument_name': 'BTC-PERPETUAL', 'order_id': '66581975120', 'max_show': 10.0, 'time_in_force': 'good_til_cancelled', 'amount': 10.0, 'direction': 'buy', 'price': 64460.0, 'label': ''}}, 'usIn': 1709663161985366, 'usOut': 1709663161988051, 'usDiff': 2685, 'testnet': False}

trying to cancel this order_id
d = client.cancel(order_id)
returns
{'jsonrpc': '2.0', 'id': 1, 'error': {'message': 'not_open_order', 'code': 11044}, 'usIn': 1709663172181556, 'usOut': 1709663172183829, 'usDiff': 2273, 'testnet': False}

Any help greatly appreciated : very nice code otherwise; good start to build more

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

1 participant