3
Follow
1513
Followers
각 거래소의 불일치로 인해 FMZ에는 통일된 주문 정밀도 반환 함수가 없습니다. 하나의 통화만 하는 것이 좋다면, 여러 거래 쌍을 호환하는 경우도 여러 거래소를 호환하는 것이 좋습니다. 여기서 깊이 정보를 기반으로 주문 정밀도를 자동으로 추산하는 획득 심도를 사용하는 것이 좋습니다. 물론, 여러 통화를 거래하는 경우 HttpQuery로 원본 API 인터페이스를 액세스하는 것이 좋습니다.
함수는 다음과 같습니다:
function GetPrecision(){
var precision = {price:0, amount:0}
var depth = exchange.GetDepth()
for(var i=0;i<exchange.GetDepth().Asks.length;i++){
var amountPrecision = exchange.GetDepth().Asks[i].Amount.toString().indexOf('.') > -1 ? exchange.GetDepth().Asks[i].Amount.toString().split('.')[1].length : 0
precision.amount = Math.max(precision.amount,amountPrecision)
var pricePrecision = exchange.GetDepth().Asks[i].Price.toString().indexOf('.') > -1 ? exchange.GetDepth().Asks[i].Price.toString().split('.')[1].length : 0
precision.price = Math.max(precision.price,pricePrecision)
}
return precision
}
Related Recommendations
Advanced 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?5.5 Trading strategy optimization
