BitBurner Stock Settings Example

mail@pastecode.io avatar
unknown
javascript
7 months ago
1.7 kB
5
Indexable
Never
import { SettingsInfo } from "settings.common.js"

export const StockSettings = new SettingsInfo("stock", {
  buyShort: {
    default: true,
  },
  sellShort: {
    default: true,
  },
  buyLong: {
    default: true,
  },
  sellLong: {
    default: true,
  },
  buyLongStocksWhenOverForecastPropability: {
    default: 0.6,
    min: 0,
    max: 1,
    step: 0.05,
    get description() {
      return this.ns.formatPercent(this.value, 0);
    },
    get hint() {
      return Math.random();
    }
  },
  sellLongStocksWhenBelowForecastPropability: {
    default: 0.55,
    min: 0,
    max: 1,
    step: 0.05,
    get description() {
      return this.ns.formatPercent(this.value, 0);
    },
  },
  buyShortStocksWhenBelowForecastPropability: {
    default: 0.4,
    min: 0,
    max: 1,
    step: 0.05,
    get description() {
      return this.ns.formatPercent(this.value, 0);
    },
  },
  sellShortStocksWhenAboveForecastPropability: {
    default: 0.5,
    min: 0,
    max: 1,
    step: 0.05,
    get description() {
      return this.ns.formatPercent(this.value, 0);
    },
  },
  maxStockVolatility: {
    default: 0.05,
    min: 0,
    max: 0.2,
    step: 0.01,
    get description() {
      return this.ns.formatPercent(this.value, 0);
    },
  },
  minPlayerMoney: {
    default: 1000000000,
  },
  minSharesToBuy: {
    default: 5,
  },
  profit: {
    get text() {
      return `$${this.ns.formatNumber(this.value ?? 0)}`;
    }
  },
  currentlyUsedLongShares: {
    default: "[]",
    hidden: true
  },
  currentlyUsedShortShares: {
    default: "[]",
    hidden: true
  },
  sellAll: {
    default: Function
  },
});
Leave a Comment