《比特燃烧者》股市入门指南

0 点赞
Bitburner
转载

A short guide and simple working script for initially playing with the Bitburner Stock Market. The Beginning           I never knew very much about the stock market other than it was like gambling and I am just terrible at gambling - I always seem to lose. But I got to a point in my early game where I was spending ~3t+ for each augment (they increase exponentially for each one you buy, in case you didn't know, yet) and ~3t was about all I could make each day off hacking and my hacknets. I have access to 40 augments, so I’m trying to buy all I can so I can get that achievement as well. Realizing it would take forever at this rate and considering the cost of each augment was increasing as well - I needed a better way to make money. So I decided to learn about how to play the stock market in Bitburner, besides it's all virtual - what can I lose?           Turns out, the stock market isn’t so much like gambling in a casino and relying on the cards or slots and your luck to win. The market is like an ocean shore with its ebbs and tides that can be mostly predicted mathematically to take advantage of for profit, which is how people and corporations make money off the stock market and it’s actually allowed. You can’t really do that in a casino and from what I hear that could actually get you in a lot of trouble if you tried to do so. Information about a stock’s history is called market data, which can be purchased to formulate buying and selling strategies mathematically. The Very Basicz Here’s the real basics you’ll need to know: What Is a Position?           A position is the amount of stocks that is owned by the player for a given corporation. A player takes a position when they make a purchase through a buy order. Open positions can be either long or short depending on your progress through the game. Initially you only have access to Long Stocks, but later you will be able to purchase Short Stocks (much later it seems). What are Long and Short Stocks?           Long positions refers to the purchase of a stock with the expectation it will increase in value. Short positions profit when the underlying security falls in price. Short stocks often involve securities that are borrowed and then sold, to be bought back hopefully at a lower price. For more basic information, consult the game docs here: https://bitburner.readthedocs.io/en/latest/basicgameplay/stockmarket.html This is also a good read about how the Stock Market works in real life from Investopedia: Stock Market Positions[www.investopedia.com] The Bitburner Stock Market Initially, you go to the Stock Market through the map - all cities have access to it. WSE Account - Costs 200m and is required for access to the stock market. Buying this will add the Stock Market to the left menu under ‘World’. Market Data TIX API Access - Costs 5b for access to the API functions which will allow you to buy/sell stocks and other stock related tasks. Four Sigma (4S) Market Data Access - Costs 1b for access to 4S forecast data. I read somewhere that using the 4S data will increase your profit by 60%. Which is exactly what we need right now. Four Sigma (4S) Market API Access - Costs 25b for the API access which lets you use the TIX functions that require 4S Market Data Access.      To start off with, you’ll want to just buy all the market access stuff at once when you can afford it. By the time you need the stock market, you should be making plenty off of hacking, which is more important initially (More hacking xp = more servers can be hacked = more $$ gained and even more hacking exp). Later, once you know more about what you're doing, you’ll be required to do it all over again without 4S data access and little resources. So the goal now is simply to make a ton of cash to buy as many initial augments as possible while learning how the stock market works.      Remember, once you augment, you’ll lose all your cash and have to start over, so all your money at this point is completely disposable and the more you spend on the market, the more you’ll make off the market. The Information Pleaz        After scouring the internet for any available information I could find, I managed to cobble together a working script using the best code from many different sources, authors and suggestions in posts, mostly Reddit (which is notoriously unreliable), updated them to Bitburner 2.0 and NS2 syntax, cleaned up or added more comments so that it is easier to see exactly what the script is doing and made the general output more useful and more properly timestamped so you can see it actually running better.       The purpose is to learn from the script, so I’ve kept it as simple and self explanatory as possible while retaining the original math and logic. I’ve also found formulas from a data scientist for no 4S market access that claim to work, but I’ll save that for later, maybe a more advanced guide. I have left in the short stocks code I found and wrapped it in a flag you can toggle it in the Globals header - it's untested so beware if you play with this later when you have access to shorts. There are some other settings in the Globals header you can play with, but everything is set to go full bore once you start it. But you want to have more than 1b, that's what the failsafe is set to, but you can set it to what you like, so don't forget to set it to 1m if you have less than 1b.       The 'q+' formatting code and the +/- forecast code actually came from the game's source itself, I converted it from React to NS2 and I stripped it down so it's easier to understand. I recommend using those code blocks in your own scripts, since they are very helpful. I had to keep some of that part in short-hand, so save help keep the script short and simple still as possible.           The script will use as much money as possible to buy as much favorable stock at once for grinding huge profits. I’ve seen it use as much as 1q purchasing stocks when there is a huge market boom. I had 40t when I first started the script in the morning and made 150t by the afternoon just letting it run constantly. At this point now in my writing, I’ve purchased 35 augments (only 5 left to go!) with them costing ~45q now each and I’m making about ~10q a day now with this script. There is an achievement to make 1Q (Q not q), but this script would just take too long, so more stock market magic in the calculations would be needed or some other cheat. Note you can also influence the market through hacking/growing, stock purchases and even working for the company you have stock in. So really, this script is just scratching the surface of what you actually could do to make even more money.          I recommend just watching the script run for a few days. Get a good feel for the stock market behaviors - it’s ‘ebbs and tides’. Remember to save your game file before you start in case of problems or you simply just want to go back. You should see debug messages for everything and you can add more if you like to see exactly what is going on. Also, watching your ‘portfolio’ in the stock market menu you can see how much each position has made you currently and under ‘Stats - General - Money’ you can see how much money you’ve made overall on the stock market. If you panic, just kill the script and sell everything, you won't lose very much - just mostly commission fees.

脚本常规显示输出: 4S预测:下一个市场“周期”内股票的4S预测情况。 持仓量:你持有的股票数量。 利润:股票持仓所产生的利润,已扣除佣金。 当前股票价值:你目前投入股票的资金总额。 当前净值:如果你终止脚本并卖出所有资产后实际拥有的资金。这更像是你当前的“银行存款”,而非概览显示的资金或所有资金都投入股市时的“总价值”。 代码相关: 我不得不将代码移至Github,因为Steam不断修改代码并引入错误。如果你之前从Steam复制粘贴过代码,建议从Github重新获取,因为部分内容可能已失效。《Bitburner》脚本问题修复说明 1. 【数字显示问题】Netscript 使用的 numeral.js 库在格式化超过't'的数字时存在 bug,导致无法显示'q'。Bitburner 源代码中已注明此问题,开发者已创建自定义函数 formatReallyBigNumber()以在 Bitburner 概览中显示 q 及以上数值。目前脚本已更新为使用 formatReallyBigNumber(),以正确显示 q 及以上数值。 2. 【交互与界面优化】买卖操作现在应会显示提示消息,并且脚本会在每个周期清除尾部窗口,使界面看起来更稳定。日志历史因此丢失,但反正它运行得也不好,或许应该将其保存到文本文件中。 最后 希望我能在你的《网络黑客》旅程中为你提供帮助,并激励你继续沉迷于《网络黑客》的游戏世界。你可以将我的脚本作为模板学习,进而编写自己的脚本。我已经编程30多年了(我是一名退休软件工程师),从个人电脑诞生之初就开始接触各种编程语言和平台,甚至包括大型主机——真的!这些年来,我觉得自己学到了一些不错的编程习惯和编程模式,尽管可能有点老派。顺便说一下,标题中的“For Dummies”只是我借用了20世纪90年代一系列旧书的名称,并不是要称任何人是傻瓜或笨蛋。此内容包含外部链接,根据规则已删除相关链接。以下是处理后的内容: 本指南由Zac Starfire在Steam上创建。如果你在其他服务器上发现此指南,那就是它的起源地。 更新日志 3/2/23 - 新增脚本指南链接 10/13/22 - 因Steam不断更改代码导致错误,已将代码迁移至Github。 9/25/22 - 修正脚本中"forecast"的拼写错误。 - 更新脚本图片。 - 对购买的股票数量进行四舍五入处理。 9/21/22 - 调整脚本显示中"Forecast"和"Position"的位置。 - 新增股票利润显示。 - 修复卖出提示消息。 - 更新脚本图片。 9/20/22 - 新增脚本输出图片。 - 调整脚本显示方式,添加+/-预测符号。 - 修复部分小错误。 9/19/22 - 新增【信息须知】部分。 - 在股票脚本中添加formatReallyBigNumber()函数。- 买卖消息现已改为弹窗消息。 - 通过在股票脚本末尾添加clearLog()修复了显示问题。 - 修复了“Forecasts”的拼写错误 - 抱歉! - 引入了一个漏洞,但我认为已修复,若发现股票卖出相关异常请留言反馈。 2022年9月15日 - 添加了我的份额自动化脚本并修复了一些问题。 2022年9月16日 - 添加了更新日志部分,并将我的变更说明移至该部分。 - 其他一些调整。