「FTX CCXT」:修訂間差異
跳至導覽
跳至搜尋
無編輯摘要 |
無編輯摘要 |
||
| 第1行: | 第1行: | ||
*< | *<php> | ||
//掛單小數精度換算 | |||
symbol = 'BTC/USDT' | symbol = 'BTC/USDT' | ||
ftx.load_markets() | ftx.load_markets() | ||
| 第8行: | 第8行: | ||
formatted_price = ftx.price_to_precision(symbol, price) | formatted_price = ftx.price_to_precision(symbol, price) | ||
print(formatted_amount, formatted_price) | print(formatted_amount, formatted_price) | ||
< | </php> | ||
於 2021年11月4日 (四) 20:18 的修訂
- <php>
//掛單小數精度換算 symbol = 'BTC/USDT' ftx.load_markets() amount = 1.2345678 # amount in base currency BTC price = 87654.321 # price in quote currency USDT formatted_amount = ftx.amount_to_precision(symbol, amount) formatted_price = ftx.price_to_precision(symbol, price) print(formatted_amount, formatted_price) </php>