Cookie Clicker

Cookie Clicker

CookiStocker 2 | Automatic Stock Trading Mod
z  [developer] 29 Jul, 2023 @ 1:34am
New Changes and Additions to the Console Output
The following discussion refers to CookiStocker 2.0, which is the most recent version.

Starting with CookiStocker 2.0, the console output has changed substantially. There are two reasons for this: 1) The stock trading algorithm no longer trades only on mode changes, but may trade at any time. 2) Additional detail was found to be very useful in the periodic activity reports.

Note that enabling the console automatically disables Steam achievements. The apparent reason for this is that while using the console, you can execute arbitrary commands, including essentially any cheat you want. However, disabling the console (and making sure that the DEV variable in start.js is set to zero) will re-enable Steam achievements, as long as they are not disabled somewhere else.

For those people who want to see a completely detailed picture of what is happening, enabling the console and setting the variable stockerActivityReportFrequency to be equal to the tick length in milliseconds (default 60,000) will print out a full report every time the stock market runs. If you do this, it is recommended that you set the variable stockerActivityReport to false in order to avoid excessive popups in your game; all of the information contained in these popups (and much, much more) is contained in the new console output, so you will not be missing out on anything.

Here is an example of the new console output, showing both the output that occurs with every tick, along with the periodic full report:
15:46:13.853 Cereals mode is unchanged at 1 [slowly rising] at $6.31 15:46:13.853 Chocolate mode is unchanged at 5 [fluctuating] at $7.10 15:46:13.853 MODE CHANGE Butter old mode was 5 [fluctuating] and new mode is 1 [slowly rising] at $23.48 15:46:13.854 =====$$$=== Buying Butter at $23.48 15:46:13.854 Sugar mode is unchanged at 5 [fluctuating] at $31.12 15:46:13.854 =====$$$=== Selling Sugar at $31.12 for a profit of $17,981 and total revenue of $55,240. Last bought at $20.99. 15:46:13.854 MODE CHANGE Nuts old mode was 2 [slowly falling] and new mode is 4 [rapidly falling] at $4.68 15:46:13.854 Salt mode is unchanged at 2 [slowly falling] at $11.64 15:46:13.854 MODE CHANGE Vanilla old mode was 5 [fluctuating] and new mode is 2 [slowly falling] at $66.84 15:46:13.854 Eggs mode is unchanged at 5 [fluctuating] at $53.24 15:46:13.854 MODE CHANGE Cinnamon old mode was 1 [slowly rising] and new mode is 3 [rapidly rising] at $41.17 15:46:13.855 MODE CHANGE Cream old mode was 2 [slowly falling] and new mode is 3 [rapidly rising] at $7 15:46:13.855 Jam mode is unchanged at 2 [slowly falling] at $4.78 15:46:13.855 White chocolate mode is unchanged at 4 [rapidly falling] at $2.42 15:46:13.855 Honey mode is unchanged at 2 [slowly falling] at $70.88 15:46:13.855 Cookies mode is unchanged at 1 [slowly rising] at $114.60 15:46:13.855 Recipes mode is unchanged at 5 [fluctuating] at $74.21 15:46:13.855 Subsidiaries mode is unchanged at 3 [rapidly rising] at $173.74 15:46:13.855 Publicists mode is unchanged at 2 [slowly falling] at $53.65 15:46:13.855 z mode is unchanged at 3 [rapidly rising] at $148.85 15:46:13.855 Running for 9 hours, 21 minutes, and 8 seconds and made $79.484 million in net profits and $79.277 million in revenue (displayed profits) in 2,769 purchases and 2,768 sales. Total number of stocks held: 12. Total shares: 19,170. Total value: $905,413. Unrealized profits: $338,389. Total gross profits: $86.717 million. Profitable stocks: 17. Profitable trades: 1969. Average profit per trade: $44,041. Total gross losses: $7.233 million. Unprofitable stocks: 0. Unprofitable trades: 799. Average loss per trade: $9,053. 15:46:13.855 Profits[0][0] = $4.063 million 5.11% 156 trades 15:46:13.855 Profits[0][1] = $0 15:46:13.855 Profits[0][2] = $2.755 million 3.47% 102 trades 15:46:13.855 Profits[0][3] = $0 15:46:13.855 Profits[0][4] = $1.453 million 1.83% 47 trades 15:46:13.855 Profits[0][5] = $0 15:46:13.855 Profits[1][0] = $213,386 0.27% 8 trades 15:46:13.855 Profits[1][1] = $5.917 million 7.44% 500 trades 15:46:13.855 Profits[1][2] = $9.795 million 12.32% 278 trades 15:46:13.855 Profits[1][3] = $63,189 0.08% 3 trades 15:46:13.855 Profits[1][4] = $4.631 million 5.83% 128 trades 15:46:13.855 Profits[1][5] = $34,100 0.04% 3 trades 15:46:13.855 Profits[2][0] = $0 15:46:13.856 Profits[2][1] = $0 15:46:13.856 Profits[2][2] = $2.997 million 3.77% 242 trades 15:46:13.856 Profits[2][3] = $0 15:46:13.856 Profits[2][4] = $1.28 million 1.61% 45 trades 15:46:13.856 Profits[2][5] = $0 15:46:13.856 Profits[3][0] = $0 15:46:13.856 Profits[3][1] = $0 15:46:13.856 Profits[3][2] = $2.065 million 2.60% 39 trades 15:46:13.856 Profits[3][3] = $20,924 0.03% 33 trades 15:46:13.856 Profits[3][4] = $18.756 million 23.60% 293 trades 15:46:13.856 Profits[3][5] = $30,726 0.04% 4 trades 15:46:13.856 Profits[4][0] = $0 15:46:13.856 Profits[4][1] = $0 15:46:13.856 Profits[4][2] = $0 15:46:13.856 Profits[4][3] = $0 15:46:13.856 Profits[4][4] = $79,690 0.10% 4 trades 15:46:13.856 Profits[4][5] = $0 15:46:13.856 Profits[5][0] = $222,213 0.28% 3 trades 15:46:13.856 Profits[5][1] = $0 15:46:13.856 Profits[5][2] = $7.492 million 9.43% 221 trades 15:46:13.856 Profits[5][3] = $0 15:46:13.856 Profits[5][4] = $3.731 million 4.69% 118 trades 15:46:13.856 Profits[5][5] = $13.885 million 17.47% $17,981 541 trades 15:46:13.856 Subtotal[0] = $8.271 million 10.41% 305 trades 15:46:13.856 Subtotal[1] = $20.654 million 25.99% 920 trades 15:46:13.856 Subtotal[2] = $4.277 million 5.38% 287 trades 15:46:13.856 Subtotal[3] = $20.873 million 26.26% 369 trades 15:46:13.856 Subtotal[4] = $79,690 0.10% 4 trades 15:46:13.856 Subtotal[5] = $25.33 million 31.87% $17,981 883 trades 15:46:13.856 Total profits = $79.484 million $17,981 2768 trades 15:46:13.856 Profit per hour = $566,596; profit per day = $13.598 million 15:46:13.856 That's 114.121 novemdecillion cookies and 2.739 vigintillion cookies, respectively. It's also 157 times your highest raw cookie production rate. 15:46:13.856 In unadjusted, true numbers: 15:46:13.856 Profit per hour = $8.499 million; profit per diem = $203.975 million 15:46:13.857 That's 1.712 vigintillion cookies and 41.084 vigintillion cookies, respectively. It's also 2,360 times your highest raw cookie production rate. 15:46:13.857 ------------------------------------------------------------------
Last edited by z; 30 Jul, 2023 @ 1:00am
< >
Showing 1-1 of 1 comments
z  [developer] 29 Jul, 2023 @ 1:35am 
The first part of this output shows what is happening with every single stock. This is the output that shows up at every single tick. So, for example, the first line states, "Cereals mode is unchanged at 1 [slowly rising] at $6.31". Note that the word "unchanged" applies only to the mode, and not the price. Although this information is useful to watch on a tick-by-tick basis, it can be even more useful when seen in summary fashion, as will be shown later on.

In the current example, the line for Chocolate is identical in form to the line for Cereals. But the line for Butter is quite different; it reads "MODE CHANGE Butter old mode was 5 [fluctuating] and new mode is 1 [slowly rising] at $23.48". Mode changes are still extremely important to the trading strategy, and the all caps notification is used to make these changes easier to see.

Following the mode change is the line "=====$$$=== Buying Butter at $23.48". All purchases and sales by CookiStocker are preceded by the string "=====$$$===", once again for visibility purposes. Purchases and sales do not always follow mode changes, nor are mode changes always followed by a purchase or sale, as can be seen in this example. But this is the one place where you can track profits or losses from individual stock sales.

Note that for stock sales, figures are given for both profit and total revenue. "Profit" is the difference between the total amount received from the sale of the stock minus the amount paid for it, while "total revenue" is simply the total amount received from the sale of the stock. However, it is the total revenue that is added to the "Profits:" figure in the upper left of the stock market display, as this number has already been decreased by the amount used for the purchase of the stock. As this "Profits" figure grows larger, it will gradually converge with the total of the profits from stock sales shown in these reports.

The periodic report starts at the line directly after the last stock, which is You (in this case, labeled "z"). The first line of the report is the one that says:
Running for 9 hours, 21 minutes, and 8 seconds and made $79.484 million in net profits and $79.277 million in revenue (displayed profits) in 2,769 purchases and 2,768 sales.
Before you get too impressed by that $79 million earned in a little over 9 hours, keep in mind that for testing purposes, this run was done with a tick length of 4 seconds instead of 60, so the figures here need to be adjusted by a factor of 15. A four-second tick length means that 9 hours, 21 minutes, and 8 seconds is equivalent to 5 days, 20 hours, and 17 minutes of a normal run, which means that the $79.484 million would come out to $13.598 million per day. But there is no need to calculate this yourself if you're running at fast speed; this calculation is done automatically down below.

The next six lines contain various statistics that some people may find useful. The item "Unrealized profits" is the total amount of profits that would be obtained if all stocks that are currently held were sold. This can give you a good idea of how much profit potential there is in your current holdings.

After this comes the detailed part of the profit report, laid out in what appears to be an array. The indices of the array are simply the modes in which the stocks were bought and sold, respectively. So the first line, which starts "Profits [0][0]" refers to stocks that were both bought and sold while in mode 0; the second line that starts "Profits [0][1]" refers to stocks that were bought while in mode 0 but sold while in mode 1, etc. As for the columns after the equals sign, the first column represents the total profits for this mode combination since the start of this run; the second column shows what percentage this is of all profits made since the beginning of this run; the third column shows any profits or losses made since the last periodic report; and the fourth column shows the number of completed trades (i.e., sales) for this mode combination since the beginning of the run.

After the 36 "Profits" lines come six "Subtotals" lines with just a single index. For these lines, the index signifies the mode in which the stocks were bought, so that each group of six lines from the previous section is summarized in a single line in this section. Finally, there is a single line summarizing the total profits for this run.

Following all of this, there is a line that conveniently summarizes the profits per hour and profits per day for this run. In case the tick length has been changed from its default of one minute, these figures are adjusted to be what they would be if the tick length had been one minute, Thus, we see that the profit per day is $13.598 million - the same figure we calculated above.

The next line converts these dollar figures into numbers of cookies; the conversion rate depends on your highest number of raw cookies per second produced during this ascension.

The next three lines are optional, and appear only if your tick length is not the standard one minute length. If this is the case, these lines show the actual ("true") numbers of dollars and cookies produced per hour and per day.

Now this may all be very interesting, but where it turns out to be especially useful is where you run the console output through a filter that retains only those lines containing a specific stock name. For example, here's the first part of the results of doing that when one selects the Nuts stock:
Search "Nuts" (1462 hits in 1 file of 1 searched) E:\ViceVersa\Program Files (x86)\Games\Cookie Clicker\workshop\CookiStocker 1.6\Z 12% $13,438 38,625.log (1462 hits) Line 72: 15:12:08.254 Stock: Nuts Status: fluctuating at $13.62 Line 116: 15:13:08.265 Nuts mode is unchanged at 5 [fluctuating] at $12.96 Line 188: 15:14:08.260 Nuts mode is unchanged at 5 [fluctuating] at $13.33 Line 260: 15:15:08.267 Nuts mode is unchanged at 5 [fluctuating] at $12.16 Line 332: 15:16:08.270 Nuts mode is unchanged at 5 [fluctuating] at $8.40 Line 405: 15:17:08.270 Nuts mode is unchanged at 5 [fluctuating] at $4.99 Line 477: 15:18:08.264 Nuts mode is unchanged at 5 [fluctuating] at $5.49 Line 550: 15:19:08.265 MODE CHANGE Nuts old mode was 5 [fluctuating] and new mode is 3 [rapidly rising] at $4.13 Line 627: 15:20:08.263 Nuts mode is unchanged at 3 [rapidly rising] at $8.68 Line 699: 15:21:08.268 Nuts mode is unchanged at 3 [rapidly rising] at $11.92 Line 772: 15:22:08.279 MODE CHANGE Nuts old mode was 3 [rapidly rising] and new mode is 5 [fluctuating] at $10.86 Line 847: 15:23:08.271 Nuts mode is unchanged at 5 [fluctuating] at $12.60 Line 920: 15:24:08.265 Nuts mode is unchanged at 5 [fluctuating] at $18.14 Line 992: 15:25:08.269 Nuts mode is unchanged at 5 [fluctuating] at $15.76 Line 1064: 15:26:08.276 Nuts mode is unchanged at 5 [fluctuating] at $17.37 Line 1138: 15:27:08.284 Nuts mode is unchanged at 5 [fluctuating] at $17.16 Line 1211: 15:28:08.277 Nuts mode is unchanged at 5 [fluctuating] at $20.91 Line 1284: 15:29:08.271 Nuts mode is unchanged at 5 [fluctuating] at $23.19 Line 1356: 15:30:08.286 Nuts mode is unchanged at 5 [fluctuating] at $28.74 Line 1428: 15:31:08.277 Nuts mode is unchanged at 5 [fluctuating] at $29.62 Line 1500: 15:32:08.274 Nuts mode is unchanged at 5 [fluctuating] at $30.25 Line 1572: 15:33:08.272 Nuts mode is unchanged at 5 [fluctuating] at $30.35 Line 1645: 15:34:08.288 Nuts mode is unchanged at 5 [fluctuating] at $34.50 Line 1717: 15:35:08.271 Nuts mode is unchanged at 5 [fluctuating] at $34.85 Line 1789: 15:36:08.276 Nuts mode is unchanged at 5 [fluctuating] at $32.15 Line 1861: 15:37:08.283 Nuts mode is unchanged at 5 [fluctuating] at $28.39 Line 1933: 15:38:08.306 Nuts mode is unchanged at 5 [fluctuating] at $30.91 Line 2005: 15:39:08.328 Nuts mode is unchanged at 5 [fluctuating] at $30.90 Line 2077: 15:40:08.283 Nuts mode is unchanged at 5 [fluctuating] at $30.81 Line 2149: 15:41:08.275 Nuts mode is unchanged at 5 [fluctuating] at $31.09 Line 2222: 15:42:08.287 MODE CHANGE Nuts old mode was 5 [fluctuating] and new mode is 2 [slowly falling] at $29.83 Line 2223: 15:42:08.287 =====$$$=== Selling Nuts at $29.83 for a profit of $43,059 and total revenue of $52,046. Last bought at $5.15. Line 2297: 15:43:08.289 Nuts mode is unchanged at 2 [slowly falling] at $30.91 Line 2369: 15:44:08.277 Nuts mode is unchanged at 2 [slowly falling] at $31.94 Line 2441: 15:45:08.273 Nuts mode is unchanged at 2 [slowly falling] at $32.80 Line 2515: 15:46:08.274 Nuts mode is unchanged at 2 [slowly falling] at $33.60 Line 2516: 15:46:08.274 =====$$$=== Buying Nuts at $33.60 Line 2595: 15:47:08.282HBMODE CHANGE Nuts old mode was 2 [slowly falling] and new mode is 4 [rapidly falling] at $33.94 Line 2596: 15:47:08.283 =====$$$=== Selling Nuts at $33.94 for a profit of $593.61 and total revenue of $59,224. Last bought at $33.60. Line 2668: 15:48:08.280 Nuts mode is unchanged at 4 [rapidly falling] at $34.62 Line 2740: 15:49:08.280 Nuts mode is unchanged at 4 [rapidly falling] at $34.26 Line 2816: 15:50:08.273 Nuts mode is unchanged at 4 [rapidly falling] at $36.66 Line 2889: 15:51:08.282 MODE CHANGE Nuts old mode was 4 [rapidly falling] and new mode is 5 [fluctuating] at $34.08 Line 2963: 15:52:08.274 MODE CHANGE Nuts old mode was 5 [fluctuating] and new mode is 1 [slowly rising] at $32.94 Line 2964: 15:52:08.275 =====$$$=== Buying Nuts at $32.94 Line 3039: 15:53:08.280 Nuts mode is unchanged at 1 [slowly rising] at $34.08 Line 3112: 15:54:08.282 Nuts mode is unchanged at 1 [slowly rising] at $35.16 Line 3185: 15:55:08.280 MODE CHANGE Nuts old mode was 1 [slowly rising] and new mode is 0 [stable] at $38.34 Line 3261: 15:56:08.327 Nuts mode is unchanged at 0 [stable] at $37.29 Line 3333: 15:57:08.276 Nuts mode is unchanged at 0 [stable] at $37.07 Line 3405: 15:58:08.281 Nuts mode is unchanged at 0 [stable] at $36.52 Line 3478: 15:59:08.282 Nuts mode is unchanged at 0 [stable] at $36.62 Line 3553: 16:00:08.297 Nuts mode is unchanged at 0 [stable] at $36.47 Line 3625: 16:01:08.281 Nuts mode is unchanged at 0 [stable] at $36.35 Line 3698: 16:02:08.283 Nuts mode is unchanged at 0 [stable] at $36.20 Line 3771: 16:03:08.278 Nuts mode is unchanged at 0 [stable] at $36.09 Line 3772: 16:03:08.279 =====$$$=== Selling Nuts at $36.09 for a profit of $5,495 and total revenue of $62,980. Last bought at $32.94. Line 3844: 16:04:08.288 Nuts mode is unchanged at 0 [stable] at $35.98
This allows you to see what the Nuts stock was doing at every single tick - a total of 1440 ticks for a day's worth of data. This type of data has never been available before, and it has been invaluable for developing the next generation trading algorithm, which will be available with CookiStocker 3.0. Meanwhile, if you produce this output yourself, you will see that although the trading algorithm used in the new CookiStocker 2.0 does a fairly good job, there is still lots of room for improvement. Data of the type shown above will make this improvement possible.
< >
Showing 1-1 of 1 comments
Per page: 1530 50