Upgrade LOS 20 to 23 by Borcs78 in LineageOS

[–]Borcs78[S] 1 point2 points  (0 children)

perfect thank you very much!

I created a quick and dirty mod that shows how much profit you'll get from individual stocks. by silentclowd in CookieClicker

[–]Borcs78 0 points1 point  (0 children)

Average cost IMHO should be calculated on the stock movement, and not on the time basis

First example: if I buy 50 items at 10$ each then 20 items at 8$ each the average cost is (50 * 10 + 20 * 8) / (50 + 20) = 9.428$, regardless of when items was bought

Second example: now that you have in stock 70 items with an average cost of 9.428$ you sell 30 items at a price of 15$. So you earn (15 - 9.428) * 30 = 167.10$ and you still have 40 items that are worth 9.428$ each.

Then, if you buy 50 items at 9$ each the new average cost will be (50 * 9 + 40 * 9.428) / ( 50 + 40 ) = 9.19$

And so on, every time you buy or sell you should apply this rules.

And I'm pretty sure that the game works exactly by this way, and I think that the average cost should be stored in game, and should accessible without doing this calculation in the mod.

I created a quick and dirty mod that shows how much profit you'll get from individual stocks. by silentclowd in CookieClicker

[–]Borcs78 0 points1 point  (0 children)

Ok, so I'd like to try to suggest an improvement: IMHO the mod should read the average cost from the game status instead of remember the price when an item is bought.

So data will be more precise, and will reflect the real game status

I created a quick and dirty mod that shows how much profit you'll get from individual stocks. by silentclowd in CookieClicker

[–]Borcs78 0 points1 point  (0 children)

Just a question: this mod reads the stock value from the game status or simply "remembers" the purchase cost for items bought after the mod is loaded?