Berikut codenya

// ==UserScript==
// @name         Stockbit BID Size Alarm (ARA/ARB Mode)
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  Monitor BID lot size for ARA (reduction) or ARB (new BID) conditions with alarm alert
// @author       yourname
// @match        https://stockbit.com/symbol/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    const script = document.createElement('script');
    script.textContent = `
      (function() {
        let lot = null;
        let curBid = null;
        let mode = "ARA"; // default mode

        const targetSymbol = "BBCA"; // Set your symbol here per tab

        const originalWebSocket = window.WebSocket;
        window.WebSocket = function(...args) {
          const ws = new originalWebSocket(...args);
          const url = args[0];

          const wsId = Math.random().toString(36).substr(2,5); // unique id per socket

          console.log("New websocket created:", url, "ID:", wsId);

          if (url.includes("wss-trading.stockbit.com/ws")) {
            console.log("Hooking trading websocket:", url, "ID:", wsId);

            ws.addEventListener('message', function(event) {
              if (event.data instanceof ArrayBuffer) {
                const decoder = new TextDecoder("utf-8");
                const text = decoder.decode(event.data);

                if (text.includes("|BID|") && text.includes(targetSymbol)) {
                  console.log("=== BID message for", targetSymbol, "detected ===");
                  //console.log(text);

                  const bidMatch = text.match(/\\|BID\\|(\\d+);(\\d+);(\\d+)/);
                  if (bidMatch) {
                    const lotRaw = parseInt(bidMatch[3]);
                    curBid = Math.round(lotRaw / 100);
                    console.log("Parsed BID lot for", targetSymbol, ":", curBid);
                  } else {
                    console.log("BID regex match failed for", targetSymbol);
                  }
                }
              }
            });
          }

          return ws;
        };

        window.WebSocket.prototype = originalWebSocket.prototype;
        window.WebSocket.OPEN = originalWebSocket.OPEN;
        window.WebSocket.CONNECTING = originalWebSocket.CONNECTING;
        window.WebSocket.CLOSING = originalWebSocket.CLOSING;
        window.WebSocket.CLOSED = originalWebSocket.CLOSED;

        const createDisplay = () => {
          const existing = document.getElementById('aneas');
          if (!existing) {
            const target = document.querySelector('.orderbook-last-price');
            if (target) {
              const span = document.createElement('span');
              span.id = 'aneas';
              span.textContent = "00:00";
              span.style.background = "white";
              span.style.color = "black";
              span.style.padding = "2px 4px";
              span.style.marginLeft = "5px";
              span.style.fontSize = "12px";
              target.appendChild(span);
            }
          }
        };

        const timer = () => {
          createDisplay();

          const span = document.getElementById('aneas');

          // Prompt only once
          if (lot === null) {
            lot = parseInt(prompt("Minimum lot? Enter 0 for ARB monitoring."));
            mode = lot === 0 ? "ARB" : "ARA";
            console.log("Monitoring mode:", mode, "Target lot:", lot);
          }

          if (span) {
            const d = new Date();
            const h = d.toLocaleTimeString();

            let rat = "N/A";
            if (mode === "ARA") {
              if (curBid != null) {
                rat = (curBid / lot).toFixed(1);
                if (curBid < lot) {
                  const audio = new Audio('https://abhilash.site44.com/images/codepen/audio/audio.mp3');
                  audio.play();
                  console.log("ARA alarm triggered: BID lot below target");
                }
              }
            } else if (mode === "ARB") {
              if (curBid != null && curBid > 0) {
                const audio = new Audio('https://abhilash.site44.com/images/codepen/audio/audio.mp3');
                audio.play();
                console.log("ARB alarm triggered: New BID detected after ARB");
              }
            }

            span.textContent = mode + " at " + h + ", ratio: " + rat;
          }

          setTimeout(timer, 5000);
        };

        timer();
      })();
    `;
    document.documentElement.appendChild(script);
})();