资源加载中... loading...

总收益计算

Author: 小野, Created: 2021-07-28 14:19:52, Updated:

想问问,在有持仓情况下,如何计算当前总收益率? 如:BTC_USD或BTC_USDT; 我的计算是当前市值: (exchange.GetAccount().Stocks+exchange.GetAccount().FrozenStocks)*(exchange.GetTicker().Last)

  • exchange.GetAccount().Balance+exchange.GetAccount().FrozenBalance

但总感觉有点对持仓货币期货有点不对。 求解答


More

小草 你这是现货返回的信息

小草 期货不能这样算,一般GetAccount()原始信息里有总权益

小野 {"Info":{"c2c": [{"free":"0.0","frozen":"0.0","currency":"BCH","fee":"0.0"}, {"frozen":"0.0","currency":"BTC","fee":"0.0","free":"0.0"}, {"fee":"0.0","free":"0.0","frozen":"0.0","currency":"EOS"}, {"fee":"0.0","free":"0.0","frozen":"0.0","currency":"ETH"}, {"currency":"EVE","fee":"0.0","free":"0.0","frozen":"0.0"}, {"currency":"LTC","fee":"0.0","free":"0.0","frozen":"0.0"}, {"fee":"0.0","free":"0.0","frozen":"0.0","currency":"USDT"}], "exchange":[{"fee":"0.0","free":"0.0","frozen":"0.0","currency":"BCH"}, {"currency":"BTC","fee":"0.0","free":"3.4394","frozen":"0.0"}, {"frozen":"0.0","currency":"EOS","fee":"0.0","free":"4983.0"}, {"free":"102.8","frozen":"0.0","currency":"ETH","fee":"0.0"}, {"currency":"EVE","fee":"0.0","free":"10000.0","frozen":"0.0"}, {"currency":"LTC","fee":"0.0","free":"1589.2343","frozen":"0.0"}, {"currency":"USDT","fee":"1444.32269553675","free":"431.15634146325","frozen":"0.0"}], "wallet":[{"currency":"BCH","fee":"0.0","free":"0.0","frozen":"0.0"}, {"fee":"0.0","free":"0.0","frozen":"0.0","currency":"BTC"}, {"currency":"EOS","fee":"0.0","free":"0.0","frozen":"0.0"}, {"frozen":"0.0","currency":"ETH","fee":"0.0","free":"0.0"}, {"currency":"EVE","fee":"0.0","free":"0.0","frozen":"0.0"}, {"currency":"LTC","fee":"0.0","free":"0.0","frozen":"0.0"}, {"currency":"USDT","fee":"0.0","free":"111.0","frozen":"0.0"}]}, "Stocks":3.4394,"FrozenStocks":0,"Balance":431.15634146325,"FrozenBalance":0} 我用实盘的信息看了下信息,看不太懂各个字段的意思