'Python ValueError issue when using CCXT stop_market order for Deribit

OS: Mac,
Programming Language version: Python 3.8.3,
CCXT version: '1.77.71'

Hello when I execute the below code I continue to receive the ValueError shown below. When I test a different order exchange.create_order("ETH/USD:ETH", "limit","sell", order_size, 3650) it functions without a problem. It seems to be something I am doing with the stop market order specifically. I've spent about 5 hours now searching so I could really use some help. The exchange is Deribit.

S_order = exchange.create_order("ETH/USD:ETH", "stop_market","sell", order_size, None, {"trigger_price": 3470, "trigger": "last_price"})
Traceback (most recent call last):   File "/Users/al/Desktop/Visual Studio/Test/RH_boty.py", line 142, in
schedule.run_pending() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/schedule/__init__.py", line 780, in run_pending default_scheduler.run_pending() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/schedule/__init__.py", line 100, in run_pending self._run_job(job) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/schedule/__init__.py", line 172, in _run_job ret = job.run() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/schedule/__init__.py", line 661, in run ret = self.job_func() File "/Users/al/Desktop/Visual Studio/Test/RH_boty.py", line 135, in run_bot check_buy_sell_signals(reversal_hunter_data) File "/Users/al/Desktop/Visual Studio/Test/RH_boty.py", line 98, in check_buy_sell_signals S_order = exchange.create_order("ETH/USD:ETH", "stop_market","sell", order_size, None, {"trigger_price": 3470, "type": "stop_market", "trigger": "last_price"}) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ccxt/deribit.py", line 1359, in create_order return self.parse_order(order, market) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ccxt/deribit.py", line 1201, in parse_order return self.safe_order({ File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ccxt/base/exchange.py", line 2564, in safe_order price = self.omit_zero(self.safe_string(order, 'price')) **File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ccxt/base/exchange.py", line 2732, in omit_zero if float(string_number) == 0: ValueError: could not convert string to float: 'market_price'**


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source