Closed NoctalIvan closed 2 years ago
This is because FISG is not a valid stock symbol.
The "bug" is that the documentation lists invalid symbol FISG
as the example stock symbol in the getPrice usage example.
It should be FSIG for Four Sigma
This is probably a weirdness (or bug?) related to the version of Bitburner you used to export your save file. Attached is a save file that I'm sure was exported using a version prior to v2.1.0. It's the file BN1x4_SQLInject.json
from here:
https://github.com/quacksouls/bitburner/tree/main/data/program/intelligence
Load the attached save file into the online version of the game. Create this script:
/** @param {NS} ns */
export async function main(ns) {
// The price of a stock. Require the following:
//
// (1) A WSE account.
// (2) Access to the TIX API.
const sym = ns.stock.getSymbols()[0];
ns.tprint(sym);
ns.tprint(ns.stock.getPrice(sym));
}
Run the script and I got the error in the attached image. Still using the given save file, export it to your computer. Now load your exported save file into the online version of the game. Run the script again.
I'm running on a save exported from 2.0.2 (something wonky happened overnight that caused the stockmarket and contract generation from updating for 11 hours) and that script runs just fine for me.
Version : v2.1.0 Noticed today (I'm new so I didn't play stocks until now)
In stock API, for any stock I tried, any
stock
function I tried crashes with errorInvalid stock symbol
Repro step :
ns.stock.getPrice('FISG')
- or any other symbol I triedExpected : price got Actual : crash with
Invalid stock symbol
Issue exists also with every
stock
method I tried which took a symbol as a parameter (getPrice, getEstimation, getVolatility)Having a blast on BitBurner, cheers from France !