Skip to content

Utility Scripts

Scripts across the platform for SSL management, debugging, Pine Script workflows, and auditing.


tradingview-strategy Scripts

Located in tradingview-strategy/scripts/.

issue-cert.sh -- Issue SSL Certificate

Issues a Let's Encrypt SSL certificate for ictedgefund.com using Certbot in Docker.

Prerequisites: DNS A record must point to the server's public IP before running.

bash scripts/issue-cert.sh

What it does:

  1. Runs certbot certonly via Docker Compose with webroot validation
  2. Requests certificates for both ictedgefund.com and www.ictedgefund.com
  3. Copies fullchain.pem and privkey.pem from the Certbot container to nginx/certs/
  4. Reloads the Nginx container to pick up the new certificate

Configuration: The email address defaults to admin@ictedgefund.com but can be overridden with the CERTBOT_EMAIL environment variable.

renew-cert.sh -- Renew SSL Certificate

Renews the existing Let's Encrypt certificate and reloads Nginx.

bash scripts/renew-cert.sh

What it does:

  1. Runs certbot renew --quiet via Docker Compose
  2. Copies renewed certificates to nginx/certs/
  3. Reloads Nginx

Cron setup (recommended):

0 3 * * 1 cd /path/to/tradingview-strategy && bash scripts/renew-cert.sh

This checks for renewal every Monday at 3:00 AM. Certbot only renews if the certificate is within 30 days of expiry.

read-bias-cells.js -- Debug Bias AI Table Cells

A diagnostic script that dumps the raw internal table cell primitives from the Bias AI indicator. Useful for verifying color mappings and cell structure.

node scripts/read-bias-cells.js

What it does:

  1. Imports evaluate() from tradingview-mcp/src/connection.js
  2. Executes JavaScript in the TradingView page context to access the Bias AI study's internal graphics collection
  3. Extracts each table cell's row, col, text (t), background color (bc), and text color (tci)
  4. Prints each cell with its ARGB background color in 0x hex format

Requires: TradingView Desktop running with CDP on port 9222 and a chart with Bias AI loaded.

Example output:

row: 0 col: 0 text: "PDH"             bg: 0xff2196f3
row: 0 col: 1 text: "5892.50"         bg: none
row: 1 col: 0 text: "PDL"             bg: none

audit.py -- Indicator Audit Report

Python script that reads JSON audit data from stdin and produces a formatted report covering all 4 ICT indicators.

node src/scan.js --audit | python scripts/audit.py

Report sections:

  1. Bias AI: Table presence, label count, line count
  2. Session Hunt AI: Signal labels with prices, extension lines (swept vs active), box/macro counts
  3. OB AI: ATR banner data (instrument, risk, stops, quantity), OB counts by direction and freshness, FVG count
  4. SMT Divergences: Label and line counts, detects missing labels when lines exist

Each section ends with an OK/ISSUE status flag.


tradingview-mcp Scripts

Located in tradingview-mcp/scripts/.

pine_pull.js -- Pull Pine Script Source

Downloads Pine Script source code from a TradingView indicator into a local file.

node scripts/pine_pull.js

Connects via CDP and extracts the Pine Editor content for the currently selected indicator.

pine_push.js -- Push Pine Script Source

Uploads a local Pine Script file back to the TradingView Pine Editor.

node scripts/pine_push.js

Writes the file content into the Pine Editor and optionally triggers compilation.

launch_tv_debug.bat -- Launch TradingView (Windows)

Batch script that starts TradingView Desktop with CDP debugging enabled:

"C:\Program Files\TradingView\TradingView.exe" --remote-debugging-port=9222

Run this once before using any MCP tools. A console window remains open while TradingView is running.

launch_tv_debug.vbs -- Launch TradingView (Windows, Silent)

VBScript wrapper that launches TradingView without a lingering console window:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """C:\Program Files\TradingView\TradingView.exe"" --remote-debugging-port=9222", 1, False

Preferred for automated workflows and startup scripts.

launch_tv_debug.sh -- Launch TradingView (Linux/macOS)

Shell script for non-Windows platforms:

#!/bin/bash
tradingview --remote-debugging-port=9222 &

The & backgrounds the process so the terminal is returned immediately.


ictedge-mcp Scripts

Located in ictedge-mcp/ root directory.

win-focus.vbs -- Window Focus (VBScript)

The primary window activation script used by the tv_focus_window tool. Uses VBScript's AppActivate to bring a window to the foreground by partial title match.

Called programmatically by focus-window.js via:

cscript.exe //nologo win-focus.vbs "SI1!"

win-focus.ps1 -- Window Focus (PowerShell)

Legacy/reference alternative to the VBScript approach. Uses user32.dll P/Invoke (SetForegroundWindow, ShowWindow) for window activation. Not actively used by the MCP tool -- the VBScript approach was chosen for simplicity and reliability.