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

python 的新手问题

Author: 哈哈哈哈1, Created: 2021-01-13 02:25:17, Updated:

    acc = _C(exchanges[0].GetAccount)
    acc1 = acc.Balance
    if tickers_new.Last < 100000:
        id = exchanges[0].Buy(tickers_new.Last, buycash)  
        a = tickers_new.Last
        b = buycash
        c = a
        d = b
        avg = ((a+c)*(b+d))/a+c
        Log("持仓成本:",avg,"账户余额",acc1)
        
        tickers_new.Last 最新价格  buycash 买入份数
        请问如何实现计算持仓成本啊? 
        计算出来的数据都是不对的, 

More

小草 (初始资金-现在资金)/(现在币-初始币)