Closed 10ucapital closed 4 days ago
实践中出现了浮点数转换精度问题,应该是出现在pyalgo/subscription.rs中的round_price和floor_to_lot_size函数中。简单改了一下,pyo3传decimal好像并不原生支持。
Order { time: 1719646291875, symbol: "ethfdusd", side: BUY, state: REJECTED, order_type: LIMIT, tif: GTC, quantity: 0.0058000000000000005, price: 3397.52, order_id: -1, internal_id: 51, trade_time: 0, trade_price: 0.0, trade_quantity: 0.0, acc: 0.0, making: false, }
好像我在传入rust那边改掉就好了。
可以提个pr吗,我合并一下你的代码
已经提交最新的代码到main分支,目测应该是解决了精度问题
大佬动作还是快 thx
实践中出现了浮点数转换精度问题,应该是出现在pyalgo/subscription.rs中的round_price和floor_to_lot_size函数中。简单改了一下,pyo3传decimal好像并不原生支持。
Order { time: 1719646291875, symbol: "ethfdusd", side: BUY, state: REJECTED, order_type: LIMIT, tif: GTC, quantity: 0.0058000000000000005, price: 3397.52, order_id: -1, internal_id: 51, trade_time: 0, trade_price: 0.0, trade_quantity: 0.0, acc: 0.0, making: false, }