Cookie Clicker

Cookie Clicker

CookiStocker 2 | Automatic Stock Trading Mod
227 Comments
グレイ2 10 hours ago 
I love this mod.
without this mod, i was impossible to unlock achievements related to stocks.
ty
OpenSauce 19 hours ago 
An option to turn off the extra achievements this mod adds would be nice. I use this mod for its automation, not to add extra progression. I want to keep my list of achievements vanilla.
z  [author] Oct 14 @ 10:11pm 
I have fixed a number of bugs in the last CookiStocker release. The new release (3.0.2) has been installed here, and if you subscribe to CookiStocker, you should get this release automatically the next time you reload your game. Pastebin and Google Drive versions of the mod have also been updated; please see the section on Installation in the Steam Guide for more details on these. This version of CookiStocker contains no known bugs.
z  [author] Oct 14 @ 9:50pm 
BubbasawDBD - The maximum cookies required (which I assume is what you mean when you say "maximum stock price") refers to the most expensive single purchase you can make, where the purchase price is the number of shares available times the price per share, which is then multiplied by the highest number of raw cookies per second attained in the current ascension. (Raw CPS does not include cookies generated by buffs or clicks, so it's a fairly stable baseline. Raw CPS does include long-term effects, such as what's in your garden.)

You can find the number of shares available and the price per share in the main stock market display. You can find both the current raw CPS and the highest raw CPS for this ascension on the Stats page, under General. If you do the calculations mentioned above, I think you'll find that the maximum required cookie amount is being calculated properly.
BubbasawDBD Oct 14 @ 9:31pm 
Im not sure what im doing wrong but whenever i get a good combo and my bank floods with a lot of cookies the maximum stock price doesnt reflect the actual prices of the stock but instead seems almost random. It makes it so the automatic purchases stop working even though the max stock at the momenth isnt nearly as close as the mod says
z  [author] Oct 13 @ 7:11am 
OpenSauce - The reason that the default max bank percent per purchase is set to 5% is that when automatic trading begins, it is common to purchase around 10 stocks fairly quickly. This would add up to about 50% of your bank, which I thought was a reasonable maximum. But if you don't like this, you can easily change it with the slider in the Options menu. You can put it all the way up to 100% if you like.

You're right that the options aren't fully described in-game; as I mentioned below, their full description will soon be available in the Steam Guide. In the mean time, I can tell you that the cookie minimum and maximum values are the costs to buy the cheapest and most expensive stocks, respectively. Since the mod doesn't know ahead of time which stocks it will want to buy, the maximum value is indeed used as a threshold for permitting auto trading.

The Warehouse Exponent description will need to wait for its explanation in the Guide. The default value does nothing.
OpenSauce Oct 13 @ 5:09am 
The new features in the 3.0 version of the mod have strange defaults that cause unexpected behaviour when updating. In particular, the max bank percent per purchase being set to only 5% is incredibly low.

The features themselves are also kind of poorly explained in the UI. "Required cookie minimum" reads as the minimum required cookies for trading, but this isn't the case. The "Maximum" value is what actually seems to control this, but even then it's unclear to me what exactly this Maximum value represents.

The in-game description of the "Warehouse Exponent" value is also very hard to understand.
z  [author] Oct 11 @ 4:36am 
CookiStocker 3.0 has now been uploaded to Steam. For those who subscribe to this mod, you should get it automatically the next time you restart Cookie Clicker. It contains all the new features described in this post, plus a few more. The basic function of the new features should be quite self-explanatory. However, I will also be updating the Steam Guide to include a complete description of all the new features and their use, including how they can be used in your stock market strategy.

The new version has been tested extensively, but as always, there may be bugs. If you think you have found one, please report it in the Bug Reports discussion thread.
z  [author] Oct 9 @ 3:29pm 
What exactly did you do to download the mod?
GDICommander Oct 8 @ 10:45pm 
I downloaded this mod, but I dont see it in the mod page, is there something different about it?
z  [author] Oct 8 @ 2:58pm 
The dragon aura supreme intellect simply makes the market more chaotic, which has no effect on the trading algorithm. (I tested it.) I have this aura on myself for its other benefits.
ChrispyKnight Oct 7 @ 8:36am 
Does the mod work better or worse when using the dragon aura supreme intellect?
z  [author] Sep 21 @ 11:52pm 
Thanks, Agnostos! The update is running a bit late because I got a little carried away and added a bunch of new features. They're all done now, though, and I am in the final stages of testing. There are a large number of new features that I've added - enough to bump the version number to 3.0.

You can find a full list of features in the upcoming release in this post in the CookiStocker Versions 2 and 3 discussion. [Note that this most recent post supersedes the initial post in that discussion.] You can also see what the new options page looks like here. [imgur.com] All the features on the new options page are explained in the post referenced above.
Agvostos Sep 18 @ 2:17pm 
Glad to see you are still looking to improve CookiStocker and thanks for explaining why the mod decides to not buy stocks, and the slider seems pretty useful. Keep up the good work, can't wait for the update.
z  [author] Sep 10 @ 10:34pm 
Currently, the minimum number of brokers required for automatic trading is set to 58, which corresponds to a commission rate of 1% (in contrast to the commission rate of 20% that you get if you have no brokers). Surprisingly, I have found through testing that a 1% commission results in long-term profits that are only 30% as much as those that are made when using 162 brokers, which corresponds to a commission of 0.005%. Therefore, I am doing tests with a larger number of brokers to see what commission level gives the best balance between number of brokers and investment return. This number, which will be the new default, will be at least 103, which corresponds to a commission rate of 0.1%. However, there will be a slider in the new Options settings that will allow you to adjust this minimum to whatever you want.
z  [author] Sep 10 @ 10:21pm 
After much investigation, I found that the mod's failure to buy stocks was not a bug at all. The mod was simply following its directions that no single purchase should be more than 5% of the current bank.

Now different people may have different tolerances for risk, and also different ideas of how much of their bank they're willing to spend on a single stock. Therefore, although I'm keeping the 5% minimum as a default, I'm adding a slider in the Options that will let the player set this value anywhere between 1% and 100%. Hopefully, this should make everyone happy (at least about this feature).
z  [author] Sep 10 @ 1:57am 
Status update - As some of you have noticed, CookiStocker occasionally gets into a mode where it will not trade stocks even when it should. I have found and fixed this bug, and this fix will be present in the next release. More updates in the following post...
z  [author] Sep 10 @ 1:56am 
[continued]
The Options buttons feature has been fully implemented and appears to be working perfectly; testing is almost complete, and will not take much longer.

The biggest holdup right now is that the statistics showing earnings per hour and per day in the main window, and the more detailed statistics when console logging is turned on, often get corrupted upon game reload. Other statistics, such as total profits and various other totals, are not affected. This should not take long to fix.

There are also a couple of other features I'd like to get in here if time permits; one of them will extend the stock market's usefulness substantially.

All in all, I expect to put out a new release within the next week. This will still be a Version 2 release, as Version 3 will include a much more sophisticated trading algorithm.

Your patience is greatly appreciated here.
EightBitDonut Sep 9 @ 12:09pm 
when do you think you'll be able to finish the update? i want to use the mod but having to go into the files to do so is too unintuitive for me to follow.
-|-Gancro-|- Sep 6 @ 7:38am 
I forgot to mention that I have same issue as SirZedlus. Nothing is buying anymore. I should've seen it after few hours but it doesn't seem to it now.
-|-Gancro-|- Sep 6 @ 2:49am 
This cookistocker you've been working is version 3 or an update?
z  [author] Sep 3 @ 3:38pm 
I'm adding something that people have wanted for a long time, and it's almost finished. You can see a screenshot of it here. [drive.google.com]

Note that I didn't write the code. In fact, nobody wrote the code.
z  [author] Sep 3 @ 12:51pm 
SirZedlus - How long has the mod not been buying stocks (e.g., hours, days, etc.)? The stock market as a whole often goes through periodic declines where all stocks fall for many hours at a time, and the mod typically does not buy stocks during these declines.
SirZedlus Sep 2 @ 4:56am 
its wierd I have 23 million in displayed profits now but the mod just stopped working and does not buy any stocks anymore any Idea why?
z  [author] Aug 28 @ 3:22am 
Overspark - It is indeed! I just implemented this feature on my version of the mod a few days ago, and I was surprised to see how nice it was just to have the mod buy the brokers automatically and not have to worry about them at all.

This feature will be in the next release, which is coming very soon.
Overspark Aug 26 @ 5:11am 
Automatic buying of brokers would be an awesome feature.
z  [author] Aug 25 @ 6:32pm 
No problem, sarath_dilrow. The new requirements are currently mentioned only in this conversation. I need to add them to the main documentation, and more importantly (since few people read the documentation), I have to fix the new display to notify the player when and why automatic buying is not running.

It also occurred to me that I should add automatic buying of brokers up to the minimum limit, doing this in a way that doesn't have a significant impact on the bank.

Also, you'll get slightly better results the more brokers you have. I personally recommend 100; after 162, adding brokers essentially has no effect.
sarath_dilrow Aug 24 @ 9:48am 
Thank you for the answer and sorry for the question. Yes, the problem was that I was at 50 brokers instead of 58, bought 10 more and it started auto buying inmediately. Sorry again for the question.
z  [author] Aug 24 @ 5:54am 
sarath_dilrow - If the mod is auto-selling properly but not buying anything, by far the most likely explanation is that you have not met the recently introduced requirements for the mod to purchase stocks. These consist of having a minimum of 58 brokers as well as enough cookies in your bank so that a purchase of all the available shares of a single stock will not consume more than 5% of your bank. The number of cookies in your bank required to fulfill this requirement is given by the following formula:

Cookies required = (number of shares) * (highest raw CPS this session) * (price per share) * 20

Since neither the existence nor the value of this formula is obvious, it seems, I'll need to add another line to the new display indicating what's going on here. In the meantime, a rough guide is that when you have 150,000 seconds or more worth of cookies in your bank (more or less), the mod should be able to purchase stocks. (That's a little less than two days' worth of cookies.)
sarath_dilrow Aug 22 @ 9:39pm 
Hello, sorry if this question is dumb but does the mod wait for some special requirement to buy stocks? The mod auto-sells everything just fine but I have left it running for around 6 hours and it hasn't buy any stock. I tried doing what yaboi did and even reinstalled the mod but no luck.
yaboi skweezy jibbs1 Aug 22 @ 3:00pm 
Added CCSE and everything works now, thanks for figuring it out :crystaldragon:
dyl4n010 Aug 21 @ 4:35pm 
Doing gods work Z. Insane how quickly and active you're working on improving the mod. Plenty of other mod developers would have taken their sweet time or completely dropped the mod when having so many people report in broken features. Thank you :leyhappy:
z  [author] Aug 21 @ 12:29pm 
Fascinating! The mod even includes the standard line that checks for the existence of CCSE and loads it if it isn't present, but obviously that wasn't sufficient. Therefore, I've added CCSE to the list of Required Items on this page. Thanks, lil' orange for finding this, and thanks, mxrc, for verifying that this fixes your problem as well.
mxrc Aug 21 @ 12:11pm 
Installing CCSE/Enabling CCSE and putting it on top of the mod list has actually solved my issue. Thanks for helping :)
lil' orange Aug 21 @ 6:36am 
Ah yes, my bad I had a typo with my comment. It was supposed to be 615. (Which was wrong anyway I had meant the line you mentioned 610, it’s just that both of those functions gave errors as I was commenting out that function) I commented out the whole replacegamemenu function and its call later on and the mod and the mod worked again. Then I restored it back to the latest, added CCSE and then the mod worked again. I imagine if you remove CCSE or disable it you’ll reproduce the same issues that others have been getting. Prior to this update CCSE I imagine must have been loading fine so not sure why this is happening now for us.
If you want to continue chatting about it I don’t mind but perhaps another place would be better?
z  [author] Aug 21 @ 5:16am 
lil' orange - The function customOptionsMenu.push is just a placeholder for the eventual option buttons code. It's been there for a long time without causing any problems.

BTW, the function ReplaceGameMenu is at line 620 in my code, so if it's at line 516 in yours, you don't have the latest version of CookiStocker.
lil' orange Aug 21 @ 4:30am 
Hey Z, I checked out what the issue was as I saw you were having issues figuring it out. So essentially around line 516 there’s this new function Replace Game menu that when it calls customOptionsMenu.push it can’t. Presumably because it’s a CCSE thing? Not sure what might cause CCSE not be loaded on starting any more but installing CCSE from the workshop and placing it at the top of my mods seems to have fixed it. I imagine anyone else also experiencing the trading not working for the last while will be able to fix it by adding CCSE and doing the same.

Anyway there’s my fix for now. Good luck and keep up the good work
z  [author] Aug 21 @ 12:13am 
I must say that the problems being reported here are a bit mysterious to me, as I've been running the mod 24/7 for quite a while now, and my daily profits in the stock market are identical to what they were before I made the latest update. The only difference is that I don't have to disable the mod before ascending and re-enable it once my bank and brokers reach a sufficient level.

Nevertheless, a number of people are clearly having very different experiences here, so there's definitely something going on that needs to be addressed. You can rest assured that I will get this to the point where the mod works as well for everyone as it does for me.
z  [author] Aug 20 @ 10:47pm 
For bug reports, please post in the Bug Reports discussion group. Doing so will allow you to post screenshots if I need them, as well as allow more complex formatting than is permitted in these comments. It will also keep these comments from turning into long discussions that may make it harder for other people to get the information that they need. Furthermore, posts in the discussion groups don't have the short length limits that the comments do.

I'll address the comments by yaboi skweezy jibbs1 , mxrc , and Tap W in the Bug Reports discussion group shortly. If you subscribe to this group, you'll be notified whenever new entries are posted.
Tap W Aug 20 @ 10:31pm 
Can attest to the two comments below me. Ever since the update, I've had the game on for days and it hasn't traded at all. I have 90 brokers, and my bank is large enough that even the most expensive purchases should be possible.
Reinstalled the mod and tweaked any settings that vaguely looked like they could help, but nothing changed.
mxrc Aug 20 @ 4:06pm 
For demonstration I bought every stock manually now and it isn't selling them (Additionally I reinstalled the mod as well)
yaboi skweezy jibbs1 Aug 20 @ 3:05pm 
Been using the new update since it came out, have 109 brokers, buying maximum of any stocks costs a fraction of my total bank, and still it hasnt sold or bought a single stock in almost 4 days...
Overspark Aug 19 @ 5:20am 
Unsubscribing in the workshop seems to have worked! Thanks for the tip, very happy I can keep using this wonderful mod the way I want.
z  [author] Aug 19 @ 3:13am 
dyl4n010 - I have fixed the problem of the overlaying of the statistics lines when the display pane is narrow. Currently, this fix is only in my version of the mod; I want to fix a few other bugs before releasing yet another version. This shouldn't take long.
z  [author] Aug 19 @ 3:10am 
Overspark - The problem with option changes being overwritten has been present since before I took over this mod more than two years ago. For unknown reasons, it just manifests more or less frequently for different people at different times.

One workaround I have found that always works is to unsubscribe from the mod in the workshop, but not in the game. That's what I'm currently doing.

Option buttons are clearly needed here, and I will get them in as soon as possible.
z  [author] Aug 19 @ 3:05am 
mxrc - You need to give the mod more time. To make sure that trading begins as soon as possible, build up a big bank, and be sure to have at least 58 brokers. To complete a purchase, your bank must be at least 20 times the maximum number of shares available for the stock the mod wants to buy, times the stock price as expressed in cookies, where the cookies are the highest number of raw cookies per second for this session.

As this is not a trivial calculation to do in your head, I'll put in an option in the statistics line when the mod fails to make a purchase that will show if there's a deficit in the number of brokers owned, or what the requirement number of cookies in your bank was if that was too low for a trade.

Note that as you progress in the game, this problem quickly disappears after your first automated stock purchase.
z  [author] Aug 19 @ 2:49am 
Ivoravoid - In a situation like yours, where you have 750/775 of a stock, and the mod just doesn't buy the last 25 shares, that simply means that the stock has shifted from a "buy" mode to a "neutral" mode (which is why it's not selling the 750 shares). Given time, the situation will change so that the mod will either buy the remaining 25 shares or sell the original 750.

The reason your Chocolate is not being sold even though it's falling is that the mod's central algorithm isn't convinced that this is going to be a long term fall. This algorithm was built empirically with a huge amount of testing, during which I discovered that although the four central modes provide good information about where a stock is heading, there is additional emergent information in the movement of stocks that can help get much better returns than if only the four modes (or the stock's current direction) were followed. Give the mod time, and watch the stats in the new info lines.
Overspark Aug 18 @ 5:20am 
Version change doesn't work for me, file still gets overwritten. Even making the file read-only doesn't work, it still gets overwritten and the read-only attribute is gone.
I would love to have options buttons, this version is challenging to use like this! (Changing settings did stick for me with previous versions of the script).
mxrc Aug 17 @ 3:16pm 
Isn't buying / selling for me neither
Ivoravoid Aug 17 @ 1:33pm 
By "$44M in overhead" I mean that I have 44 million seconds of CPS in my bank.

Vanilla is currently at $1.61 each and I have 750/775 stock, and it's not buying the last 25. Chocolate is at $100 and falling, I have 850, and it's not selling.

I have 89 brokers, a Tiny Bank (level 2 offices), and level 1 banks.