The resource loading... loading...

New problems with python

Author: I'm not going to do it., 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

The grass(Initial funding - now funding) / (Initial funding - now funding)