0
fokus pada
0
Pengikut

Catatan tentang penggunaan exchange.GetPosition(): pertama periksa apakah itu array kosong

Dibuat di: 2018-11-07 08:17:28, diperbarui pada: 2019-04-17 15:52:12
comments   2
hits   2100
    exchange.SetTimeout(3000);
    exchange.SetContractType("XBTUSD");

    //取得第一次币量
    position = _C(exchange.GetPosition);
    last_Amount = position[0].Amount; //持币数量  
    hold_price = Math.round(position[0].Price); //持币均价
    
    
    TypeError: cannot read property 'Amount' of undefined at main (__FILE__:38)