TypeError: can’t read property ‘Price’ of null at main (कोई कोड नहीं है जो किसी समय शून्य के मूल्य को पढ़ सकता है)FILE8:53), जिसके कारण प्रोग्राम बाहर निकल गया, कृपया DreamCatcher से पूछें कि क्या यह कस्टम फ़ील्ड के कारण null था, या यह कि मूल्य जानकारी प्राप्त नहीं हुई, मैंने var pos = exchange.GetPosition() को var pos = में बदल दिया_C ((exchange.GetPosition (())), क्या इस समस्या को हल किया जा सकता है; चूंकि सिम्युलेटर फीडबैक इस बग का परीक्षण नहीं कर सकता है, इसलिए इसे रीयल-डिस्क पर करना होगा, इसलिए पहले डॉन के साथ परामर्श करें, धन्यवाद!
var currTotalEq = getTotalEquity()
var pos = _C(exchange.GetPosition())
//var pos = exchange.GetPosition()
if (currTotalEq && pos) {
// LogStatus(_D(), "当前总权益:", currTotalEq, "持仓:", pos)
var tblPos = {
"type" : "table",
"title" : "持仓",
"cols" : ["持仓数量", "持仓方向", "持仓均价", "持仓盈亏", "合约代码", "自定义字段 / " + SpecifyPosField],
"rows" : []
}
var descType = ["多头仓位", "空头仓位"]
for (var posIndex = 0 ; posIndex < pos.length ; posIndex++) {
tblPos.rows.push([pos[posIndex].Amount, descType[pos[posIndex].Type], pos[posIndex].Price, pos[posIndex].Profit, pos[posIndex].ContractType, SpecifyPosField == "" ? "--" : pos[posIndex].Info[SpecifyPosField]])
}
var tbl = {
"type" : "table",
"title" : "数据",
"cols" : ["当前总权益", "实际盈亏", "当前价格", "买单价格/数量", "卖单价格/数量"],
"rows" : []
}
var buyOrder = null
var sellOrder = null
for (var orderIndex = 0 ; orderIndex < orders.length ; orderIndex++) {
if (orders[orderIndex].Type == ORDER_TYPE_BUY) {
buyOrder = orders[orderIndex]
} else {
sellOrder = orders[orderIndex]
}
}
var realProfit = currTotalEq - totalEq
if (exchange.GetName() == "Futures_Binance") {
_.each(pos, function(p) {
realProfit += parseFloat(p.Info.unRealizedProfit)
})
}
var t = exchange.GetTicker()
tbl.rows.push([currTotalEq, realProfit, t ? t.Last : "--", (buyOrder.Price + "/" + buyOrder.Amount), (sellOrder.Price + "/" + sellOrder.Amount)])