Skip to content
Riot Bits

Riot Bits

  • Home
  • News
  • Guides
  • Video Guides
  • Patch Notes
  • Report Abuse
  • Toggle search form

Bitburner – BitNode 8: Ghost of Wall Street Script

Posted on 05/25/2022 By LorDamned No Comments on Bitburner – BitNode 8: Ghost of Wall Street Script
  • Title: Bitburner
  • Release Date:
  • Developer:
  • Publisher:
Information about Bitburner is still incomplete. Please help us fill the details of the game using this contact form.

Basic Script for BN8.1 Advanced Script for BN8.2-3 & BN8+ Achievement in Bitburner.

BN8.1

function round(value) {
let signs = ["", "k", "m", "b", "t"]
let which = 0
while (value > 999 || value < -999) {
value = Math.round(value / 10) / 100
++which
}
return value + signs[which]
}
/** @param {NS} ns */
export async function main(ns) {
ns.disableLog("ALL")
let index = ns.args[0] // should be FSIG or FLCM
let history = []
let max_shares = ns.stock.getMaxShares(index)
let max_history = 40
let fee = 100000
while (true) {
let money = (ns.getServerMoneyAvailable("home") - fee) * 0.9
let price = ns.stock.getPrice(index)
let my_shares = ns.stock.getPosition(index)[0]
ns.clearLog()
if (history.length > (max_history - 1)) {
if (price > Math.max(...history)) {
let buy = Math.floor((money / price))
if ((buy + my_shares) > max_shares) {
buy = max_shares - my_shares
}
if (buy > 0 && (price * buy) > 10000000) {
ns.print("Buy(Long): " + ns.stock.buy(index, buy))
}
} else if (price < Math.min(...history)) {
if (my_shares > 0) {
ns.print("Sell(Long): " + ns.stock.sell(index, my_shares))
}
}
}
history.splice(0, 0, price)
if (history.length > max_history) {
history.pop()
}
let profit = ns.stock.getSaleGain(index, my_shares, "Long")
ns.print("Index: " + index)
ns.print("Max Shares: " + round(max_shares))
ns.print("My Long Shares: " + round(ns.stock.getPosition(index)[0]))
ns.print("Price: $" + round(price))
ns.print("History saved: " + history.length)
ns.print("Highest Price: $" + round(Math.max(...history)))
ns.print("Lowest Price: $" + round(Math.min(...history)))
ns.print("-------------------------")
ns.print("Profit: $" + round(profit))
ns.print("-------------------------")
while (price == ns.stock.getPrice(index)) {
await ns.sleep(100)
}
}
}

BN8.2-3 & BN8 + Achievement

function round(value) {
let signs = ["", "k", "m", "b", "t", "q"]
let which = 0
while (value > 999 || value < -999) {
value = Math.round(value / 10) / 100
++which
}
return value + signs[which]
}
/** @param {NS} ns */
export async function main(ns) {
ns.disableLog("ALL")
let index = ns.args[0] // should be FSIG or FLCM
let history = []
let max_shares = ns.stock.getMaxShares(index)
let max_history = 40
let fee = 100000
while (true) {
let money = (ns.getServerMoneyAvailable("home") - fee) * 0.9
let price = ns.stock.getPrice(index)
let my_shares = ns.stock.getPosition(index)[0]
let my_shorts = ns.stock.getPosition(index)[2]
ns.clearLog()
if (history.length > (max_history - 1)) {
if (price > Math.max(...history)) {
if (my_shorts > 0) {
ns.print("Sell(Short): " + ns.stock.sellShort(index, my_shorts))
}
let buy = Math.floor((money / price))
if ((buy + my_shares) > max_shares) {
buy = max_shares - my_shares
}
if (buy > 0 && (price * buy) > 10000000) {
ns.print("Buy(Long): " + ns.stock.buy(index, buy))
}
} else if (price < Math.min(...history)) {
if (my_shares > 0) {
ns.print("Sell(Long): " + ns.stock.sell(index, my_shares))
}
if (my_shorts == 0) {
let buy = Math.floor(((ns.getServerMoneyAvailable("home") - fee) / price))
if (buy > max_shares) {
buy = max_shares
}
ns.print("Buy(Short): " + ns.stock.short(index, buy))
}
}
}
history.splice(0, 0, price)
if (history.length > max_history) {
history.pop()
}
let profit
if (my_shares > my_shorts) {
profit = ns.stock.getSaleGain(index, my_shares, "Long")
} else {
profit = ns.stock.getSaleGain(index, my_shorts, "Short")
}
ns.print("Index: " + index)
ns.print("Max Shares: " + round(max_shares))
ns.print("My Long Shares: " + round(ns.stock.getPosition(index)[0]))
ns.print("My Short Shares: " + round(ns.stock.getPosition(index)[2]))
ns.print("Price: $" + round(price))
ns.print("History saved: " + history.length)
ns.print("Highest Price: $" + round(Math.max(...history)))
ns.print("Lowest Price: $" + round(Math.min(...history)))
ns.print("-------------------------")
ns.print("Profit: $" + round(profit))
ns.print("-------------------------")
while (price == ns.stock.getPrice(index)) {
await ns.sleep(100)
}
}
}

That's everything we are sharing today for this Bitburner guide. This guide was originally created and written by LorDamned. In case we fail to update this guide, you can find the latest update by following this link.

If you believe that any of the content on this site violates your rights, including your intellectual property rights, please contact us immediately using our contact form.
Guides Tags:Bitburner

Post navigation

Previous Post: Wobbly Life – Simple Tips and Tricks
Next Post: King Kaiju 100% Achievement Guide

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Title: Bitburner
  • Release Date:
  • Developer:
  • Publisher:
Information about Bitburner is still incomplete. Please help us fill the details of the game using this contact form.

Disclaimer

All content cited is derived from their respective sources. If you think we have used your content without permission, make sure to reach us and we will be taking it seriously.
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms of Service

Copyright © 2025 Riot Bits.

Powered by PressBook News WordPress theme