Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[希望新增功能] 顯示玩家目前持有股票的買入均價 #269

Open
frozenmouse opened this issue Dec 5, 2017 · 3 comments
Open

Comments

@frozenmouse
Copy link
Contributor

在玩家的持股資訊中,加入顯示該玩家買入該股票的平均價格

舉例說明,某玩家購入
A公司 股票10股 每股20元
之後又購入20股 每股10元 平均價格為400元/30股=13.3元

然後原則是只計購入不計賣出,所以該玩家不論賣掉多少股票均價都是13.3元
假設該玩家之後將股票賣到剩下10股 均價13.3元
又購入10股 每股25元 平均價格計算為:
[庫藏(10股)X均價(13.3元)+新購股(10股)X每股價格(25元)]/總股數(10+10股)
=(133+250)/20
=19.15

@frozenmouse
Copy link
Contributor Author

此為代發,目前尚未有人處理

@mrbigmouth
Copy link
Collaborator

@silentvow
你之前做到一半的 XD

@silentvow
Copy link
Contributor

有人想做可以領走 XD 我再找時間看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants