0
Follow
0
Followers
复制的现货单币种平衡策略,在火币平台BTC3S_USDT,未修改前遇到交易单精度错误,修改如下:
193: trade('buy', buy_price.toFixed(6), buy_value.toFixed(4), '买入平衡')
194: trade('sell', sell_price.toFixed(6), sell_value.toFixed(4), '卖出平衡')
然后报错:InternalError: bad argument #3 to 'Exchange_Trade' (float64 expected, got string) at <anonymous> (native) at Buy (FILE) at trade (FILE:139) at onTick (FILE:193) at main (FILE:205)
在API文档里发现exchange.Buy(Price, Amount)传递的两个参数,现货单币种平衡策略里面是:
139 id = exchange.Buy(price, amount, msg)
三个参数删掉msg后还是如上报错,感觉是toFixed()用错了,求正确的截取小数点位数的方法
Related Recommendations
How to Specify Different Versions of Data for the Rented Strategy by Its Rental Code MetadataAdvanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?
Comment
All comments (1)
- 1
