Cookie Clicker

Cookie Clicker

CookiStocker | Automatic Stock Market mod
98 Comments
z  [author] 23 Mar, 2024 @ 9:01am 
Rozok57 - Please see my previous post.
Rozok57 23 Mar, 2024 @ 1:41am 
does it disable achievements?
z  [author] 11 Feb, 2024 @ 11:14am 
JMEWLSN - As I mention in my previous post, this version of the mod is now obsolete. Please unsubscribe from this mod and subscribe to CookiStocker 2.
JMEWLSN 10 Feb, 2024 @ 9:00pm 
just doesn't work all of a sudden. Notification pops up when i load in like its working but just wont work.
z  [author] 3 Dec, 2023 @ 1:58pm 
@jessechemish - You can't go by the "Profits:" figure in the upper left hand corner of the stock market, which is unfortunately misnamed. That figure actually represents the net revenue from the stock market. Every time you (or the mod) buys a stock, the cost of the stock is subtracted from this number. So it always starts out negative. Over time, though, this number and the true profits gradually converge.

Also, do you have enough brokers? You need at least 80 brokers for this mod to work well.

Finally, please read the boldfaced part of the Description above, which starts out by saying, " This version of the mod is now obsolete... " You really should use CookiStocker 2 instead, as it generates about an order of magnitude more profits per day.
Duke_FishronEnjoyer 2 Dec, 2023 @ 11:19pm 
Im 53k in debt because of this
z  [author] 30 Jul, 2023 @ 1:11am 
The Steam version of CookiStocker 2.0 has now been released. Please see the text above in the Description section for instructions on how to upgrade to it, or how to install it for the first time.

Any further comments on this mod should be posted on the new mod page .
z  [author] 13 Jul, 2023 @ 6:50pm 
@Ziajowaty - The "new and improved" version of CookiStocker is here; it just hasn't been installed as the Steam version yet due to technical difficulties, which should be resolved soon. In the meantime, though, the new version can be downloaded from this pastebin [pastebin.com]. The version in the pastebin fixes the bug you identified as well as a number of others. No editing is required.
z  [author] 13 Jul, 2023 @ 6:43pm 
@Champin8u - Your question about Supreme Intellect is answered in detail in the Troubleshooting & FAQ section of the CookiStocker Steam Guide .
z  [author] 13 Jul, 2023 @ 6:38pm 
@Hay! There are actually three different versions of CookiStocker with three different algorithms.

1. Version 1.6, which is the version released on Steam, uses a fairly basic trading algorithm based only on mode changes. This is the algorithm that is currently described in the CookiStocker Steam Guide ; I will be updating it when I update the Steam version of CookiStocker, which should be soon.
z  [author] 13 Jul, 2023 @ 6:38pm 
(continued)

2. Version 2.0, which can be found in this pastebin [pastebin.com], is the latest complete version of CookiStocker. It uses an algorithm that takes into account not only mode changes, but short term changes that occur while the mode stays the same. It also fixes a number of bugs, such as the one Ziajowaty refers to. Finally, it handles boundary conditions intelligently, buying whenever a stock falls below $2, never selling when a stock is below $11, and being cautious about stocks selling for high prices.
z  [author] 13 Jul, 2023 @ 6:36pm 
(continued)
3. Version 3.0, which is under development, uses a much more sophisticated stock trading algorithm. It treats the stock modes more as hints than as absolute descriptions, which better reflects reality. It puts a lot of weight into detecting patterns in mode changes that I have found after analyzing very large amounts of data, and it bases its trades on these patterns. It keeps the same boundary condition checking that is present in CookiStocker 2.0.
Ziajowaty 13 Jul, 2023 @ 9:32am 
while we wait for the "new and improved" version of the mod, I recommend everyone to edit the main.js file and change the "restingPrice" value on line 117 to
> restingPrice: 40+(i*5)
It gives me much better results than the default. This works best for buildings lv0-1, since I'm not sure how the average price rises with building levels.

While the variable name should change to averagePrice, since resting price is something else on the stock market, it doesn't matter for the average user trying to get the gaseous assets achievement.
Champin8u 5 Jul, 2023 @ 5:35am 
does the krumblor aura: ''supreme intellect'' boost the incomes?
Hayl 15 Jun, 2023 @ 7:56am 
Hey, I was wondering about the algorithm you used to make this mod. Is it based on prediction and long sales? Opposed to something like momentum short sales and be a bit more chaotic/toxic?
z  [author] 3 Jun, 2023 @ 10:14pm 
@ Watermangaming , your results are normal. It can take many hours for the game to settle into its standard profit-generating mode, which currently maxes out at about $2 million per day. Major updates are on the way; my current personal version generates about $15 million per day, and I am working on a major upgrade to the current algorithm that should boost that output significantly. This upgrade requires massive amounts of data analysis, though, so it's going to take a little longer. I have decided that I will release my current version soon as an intermediate release.
z  [author] 3 Jun, 2023 @ 9:50pm 
This mod does not currently disable Steam achievements, and my plans don't call for anything that would change that. Orteil says that Steam achievements should be enabled "if this is a good honest mod that does not incredibly unbalance the game" ( Cookie Clicker Steam Workshop documentation [orteil.dashnet.org]), and I intend to keep this mod in that category.
Waterman 3 Jun, 2023 @ 6:53pm 
idk if its broken but ive been using it for about 4 hours and my profits are -$500,000
Cassion 1 Jun, 2023 @ 5:24am 
does this mod disable achievements?
z  [author] 16 May, 2023 @ 6:36pm 
As there's a lot behind the question of a release date, I've replied to this question in this post of the CookiStocker 2.0 discussion thread.
Ͼokeman 15 May, 2023 @ 2:09pm 
Looking forward to 2.0!

Any idea when it will release (or it's expected release)?
z  [author] 14 May, 2023 @ 2:22am 
As for your questions about currency, all prices are in dollars. In the development version of CookiStocker, I have moved the currency symbol before the numbers, as is customary when specifying US dollars, and also as is done in the rest of Cookie Clicker.

I would also recommend against adding rules to CookiStocker right now, as the new version will make them all obsolete. You can follow the progress of the new version by reading (and possibly subscribing to) the discussions linked above, specifically the ones on "The Trading Algorithm" and "CookiStocker 2.0".
z  [author] 14 May, 2023 @ 2:12am 
@ tsuzimi - Your results are not surprising; I reported on this exact problem in a post here dated March 27th, and I explained why it was happening.

The problem is actually only with the line about selling. Note that this line omits the call to console.log, which is quite problematic.

I also found and posted the fix for another major bug in a March 4th post. This sounds like the same bug you mentioned in the last line of your first post.

As for your questions in your second post, I am currently involved in a major rewrite of the stock trading algorithm that takes into account every possible type of stock transition. Preliminary results are very positive, as my simulations show that the new algorithm buys and sells at the exact perfect points most of the time. When it doesn't, it corrects itself quickly, and losses are kept quite small. When this algorithm is finished, I expect that it will be possible to achieve Gaseous Assets in less that two days of play.
tsuzumi 13 May, 2023 @ 12:16pm 
(Seems like parsing screwed some of my previous posts up a little. Make sure to not copy past and actually check the script if you want to make these changes)
tsuzumi 13 May, 2023 @ 12:14pm 
Also, I wonder. Is the prices written in 1$ or 0.01$? Like if listed current price in game says 10$ would stockList.goods [i] .currentPrice be 10 or 10000?
So if I wanted to add a rule to never buy unless current price is lower than 50, would this be correct?
&& (stockList.goods [i] .currentPrice < 50)
tsuzumi 13 May, 2023 @ 12:12pm 
I don't know if it by happenstance but i managed to get about 4 million in half a day or less after doing some changes to the script.

I commented out both of the console.log from buying and selling:
// if (stockerConsoleAnnouncements) console.log('=====$$$== Buying '+ stockList.goods .name);
// if (stockerConsoleAnnouncements) ('=====$$$== Selling '+ stockList.goods .name +' at a profit of ' + (stockList.goods .currentPrice - stockList.goods .priceBought).toFixed(2));

And added a limit on buying at 50% of resting price for buying:
(stockList.goods .currentPrice < (stockList.goods .restingPrice * 0.5 ))

For selling I kept it higher than resting price instead of last bought price
(stockList.goods .currentPrice > stockList.goods .restingPrice)
z  [author] 11 May, 2023 @ 12:10pm 
@That Hat Guy - The workings of the stockbrokers are completely unaffected by this mod. Without any brokers, you will be charged a 20% commission on all purchases, making it virtually impossible to turn a profit in the market. You can read all about brokers in the Ultimate Stock Market Guide , in the section entitled "Brokers". I would personally recommend hiring at least 80 brokers before you start to use this mod so as to maximize your profits, and I would recommend increasing that to 100 brokers as soon as you can afford to do so. This will reduce your commissions to a little over 0.1% of your purchases, which will have a negligible effect on your profits.
z  [author] 11 May, 2023 @ 12:09pm 
@Mark - There is currently no section in the options menu for this mod's options. Instead, you can adjust all the options by editing the beginning of the main CookiStocker source file. No programming knowledge is required, and complete instructions for doing this can be found in the Steam Guide for CookiStocker in the "Options" section. I strongly recommend that all users of this mod read this guide.

I plan to move the options into the standard Options menu with the release of CookiStocker 2.0, which I'm currently working on. You can find a list of all the features planned for this release in the CookiStocker 2.0 discussion, which is also linked above.
That Hat Guy 11 May, 2023 @ 2:32am 
How does this mod factor in with brokers? Am I supposed to just not have any, and leave it running to do what it can with the money?
Mark 10 May, 2023 @ 12:55pm 
Is there supposed to be a dedicated section in the options menu for this mod? I do not have any so I'm confused
z  [author] 10 May, 2023 @ 10:22am 
@Maple - Although you'll have to wait until CookiStocker 2.0 to see the biggest improvements, there are a number of things that you can do now to greatly improve your returns. Two of these are bug fixes; I have described how to implement them in my posts of March 4th and March 27th. These should more than double your daily returns. Bringing your cursors up to level 12 will also help significantly, and bringing up your banks to level 10 will help as well, although not as much as leveling up your cursors. After that, leveling up the rest of your buildings and buying more of them will also increase your returns.

Losses such as you have reported are a bit on the high side, but not unexpected. The key is to run the minigame for long periods of time. If you do, you should get fairly steady returns of $1 to $2 million per day, and that's even without the bug fixes.
z  [author] 10 May, 2023 @ 8:57am 
For now, yes. I am currently working on CookiStocker 2.0 , which is a major revision. So far, I have it generating about $14 million per day in profits, and I expect to get at least a few million more than that by the time I finish the new trading algorithm. See the link in this post for more details, and the other two discussions linked above have even more information.

BTW, the new version of CookiStocker is currently averaging about 1.4 trades per minute. I don't have a release date for it, but I am actively working on it.
Maple :3 9 May, 2023 @ 8:20pm 
Ive been running the mod for 4hrs and 30 minutes and have lost -523758$, with the bot only selling 3 times and purchasing 49 times. Is this normal?
z  [author] 25 Apr, 2023 @ 4:29am 
I have started using the Discussions tab on this page to provide more in-depth information and discussions about the continuing development of CookiStocker. Links to currently open discussions can also be found directly above. Please feel free to contribute there.
z  [author] 8 Apr, 2023 @ 4:41pm 
I am currently completely rewriting the trading algorithm from scratch. The latest test version I am using generates more than five times as much profits as the released version, generating about one trade per minute in the process. I think that when I am finished, which should be soon, the algorithm should work about as well as a skilled person when it comes to trading this particular market. You will see completely different trading behavior then, which will be much more accurate than any fixed buy and sell prices could be.

If you want to follow the development process more closely, I recommend subscribing to the Steam Guide devoted to this mod.

In the meantime, you can fix the problem of selling only at high prices (which is a bug) by applying the fix I posted in this thread on March 4th.
AndrewMV 7 Apr, 2023 @ 11:33pm 
Is there a way to customize the buy at/sell at values?
It buys stocks at rather high prices.
Instead of buying PBL at +110$ it should buy them when its less than 60$ no?
z  [author] 3 Apr, 2023 @ 1:40pm 
If you change the value of the variable stockerLoopFrequency to 1000 and the value of stockerForceLoopUpdates to true (both located at the beginning of main.js), then that will run both the stock market and this mod once per second. The value of stockerLoopFrequency is the number of milliseconds between runs of CookiStocker.
Zyox 2 Apr, 2023 @ 8:05pm 
Does the mod still work with a stock market at a high tick speed? E.g 1 tick per second?
z  [author] 30 Mar, 2023 @ 7:58pm 
A number of people who use the Stock Assistant mod (highly recommended) along with CookiStocker have noticed that the use of CookiStocker breaks the "Bought value:" entry in Stock Assistant.

However, this can be easily fixed in CookiStocker. In the "buying" section of the code, right before the statement "stockList.sessionPurchases++;" (that's line 199 in the original file), insert the following:

if (StockAssistant ?? 0)
{
StockAssistant.stockData.goods .boughtVal = market .prev;
StockAssistant.buyGood(i);
}

Similarly, in the "selling" section of the code, right before the statement "stockList.sessionPurchases++;" (that's line 218 in the original file), insert the following:

if (StockAssistant ?? 0)
StockAssistant.sellGood(i);

(Note: you need to indent this code properly, as all indentation is removed in these comments.)

Once this is done, Stock Assistant will behave properly, exactly as before.
z  [author] 27 Mar, 2023 @ 9:46pm 
While I'm continuing to work on the main trading algorithm, there's one simple thing that people can do to improve the performance of the current version of CookiStocker. Some people may have noticed that the mod never sells more than two stocks in any given minute. Since the mod runs twice a minute, this means it actually never sells more than one stock per run. This can be a real problem if the market starts plunging (as it occasionally does), and many stocks need to be sold simultaneously.

I tracked down this bug and found that it's actually a JavaScript implantation issue, which happens to coexist with a second bug that simply prevents some output from being sent to the console.

Continued below
z  [author] 27 Mar, 2023 @ 9:46pm 
On line 200 of the original main.js file, the expression that begins "('=====$$$== Selling" should be immediately preceded by "console.log"; this will get the message actually printed to the console. At the end of that line, the expression

stockList.goods .priceBought).toFixed(2)

needs to be replaced with

Beautify(market .boughtVal, 2)

It turns out that the built-in toFixed() method (which appears to be implemented as a macro) has the unintended consequence of setting the variable "i" to a random number. Since "i" is the loop index for the loop that processes each stock, this causes the loop to be broken as soon as one stock is sold. Making the above replacement fixes this problem and lets the mod sell as many stocks in one run as it needs to.
SettathaOX 26 Mar, 2023 @ 8:40am 
This is good! I got a little bit skeptical when profit was -$120,000 but now it's at +%240,000 so turned out good
z  [author] 8 Mar, 2023 @ 2:30am 
The results are in from the change I described below, and they are extremely positive. They are posted in full in the Steam Guides description of this mod. From now on, I wil be posting only there so as to avoid unnecessary duplication.
z  [author] 4 Mar, 2023 @ 4:29am 
I think I found a major bug in this mod - one that would explain why it's not always selling when it should. Here is line 212 from main.js:

&& (stockList.goods .currentPrice > stockList.goods .restingPrice) // only if the price is higher than the price it was bought at

Note that despite what the comment says, the code is actually checking to see if the stock price is above the resting price - not the price at which it was bought. To make the code check the current price against the bought price, which is what the comment states and which is what makes sense, line 212 should read as follows:

&& (stockList.goods .currentPrice > stockList.goods .priceBought) // only if the price is higher than the price it was bought at

I would expect that this change would bring significantly better performance.
💧🖤 PabloTS 💔🥀 11 Feb, 2023 @ 6:34pm 
worked like a charm, nets about 2 mil a day if you have a big stockpile of cookies. It does do a lot more buying than selling but just trust the process
blahdishma 29 Dec, 2022 @ 8:35pm 
it works, for me at least.
tidalyuna 22 Dec, 2022 @ 9:02pm 
This mod keep hoarding all the stock and refuse to sell any even if that stock starting to nose dive.:steamfacepalm:
Dr.Hultenstein 17 Dec, 2022 @ 12:48am 
it seems to work fine for me, just a long time to wait until u start getting profits
MangoScreampies 2 Dec, 2022 @ 5:41pm 
Has this been fixed yet?
القطة 4 Nov, 2022 @ 4:52pm 
Please fix it