3
Follow
1513
Followers
गहराई प्राप्त करके ऑर्डर सटीकता समस्या को हल करें
Created 2020-03-20 09:10:52 Updated 2020-03-20 09:11:16
2
1869
विभिन्न एक्सचेंजों की असमानता के कारण, एफएमजेड के पास एक समान आदेश सटीकता रिटर्न फ़ंक्शन नहीं है। यदि रणनीति केवल एक मुद्रा के लिए है, तो कई एक्सचेंजों के साथ संगत है, यहां यह अनुशंसा की जाती है कि गहराई प्राप्त करें, गहराई की जानकारी के आधार पर स्वचालित रूप से आदेश सटीकता का अनुमान लगाया जाए। बेशक, यदि कई मुद्राओं का व्यापार करना है, तो एचटीटीपीक्वेरी का उपयोग करके मूल एपीआई इंटरफ़ेस का उपयोग करने की सिफारिश की जाती है।
फ़ंक्शन इस प्रकार है:
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
