delta-exchange / python-rest-client

https://pypi.org/project/delta-rest-client/
13 stars 19 forks source link

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://testnet-api.delta.exchange/orderbook/BTCUSD/l2 #25

Closed paowongsakorn closed 4 years ago

paowongsakorn commented 4 years ago

raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://testnet-api.delta.exchange/orderbook/BTCUSD/l2

product_id = 'BTCUSD' delta_client.get_L2_orders(product_id, auth=True) delta_client.get_ticker(product_id) delta_client.get_wallet(2)

delta_client.get_mark_price(product_id) delta_client.get_position(product_id) delta_client.set_leverage(product_id, 2) try: order_limit_gtc = delta_client.place_order( product_id, 10, 'buy', limit_price=3800, time_in_force=TimeInForce.FOK) stop_order = delta_client.place_stop_order( product_id, order_type=OrderType.MARKET, size=10, side='sell')

trailing_stop_order = delta_client.place_stop_order(
    product_id=product_id,
    size=10,
    side='sell',
    order_type=OrderType.MARKET,
    trail_amount=20,
    isTrailingStopLoss=True
)

except requests.exceptions.HTTPError as e: print(e.response.text) delta_client.order_history() delta_client.fills() delta_client.get_assets() delta_client.get_all_products()