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 买入份数
请问如何实现计算持仓成本啊?
计算出来的数据都是不对的,
Ervas daninhas(Capital inicial - agora o dinheiro) / (Currency agora o dinheiro)