TheOtherDavid / CoinCheck

A simple app that checks a crypto coin price and sends an SMS alert if there has been a big move recently.
1 stars 0 forks source link

Record orders with their prices #22

Closed TheOtherDavid closed 3 years ago

TheOtherDavid commented 3 years ago

To help better determine if I'll make money buying or selling, I need the average price I've paid for each of my crypto products. I guess I should add that to my PRTFL table. To do this, I need to record all of my orders, the amount I bought, and the average price.

TheOtherDavid commented 3 years ago

According to MotleyFool, you can calculate Weighted Average Price for stock purchases at various prices with formula: image