R
Ritish LabsAI Trading Bot · Part 5
Auction Retest Pro
AI Trading Bot · Part 5 Workbook

Build and run your AI trading bot on a Windows VPS.

One clean sequence from an empty VPS to a running local dashboard: MT5, Node.js, Codex, environment setup, and the complete build prompt.

12 guided stepsFollow one checkpoint at a time without jumping between tools.
Windows VPSMT5 and the dashboard run together in the signed-in desktop session.
One master promptCopy the complete project brief when your environment is ready.
Setup roadmap

Follow this sequence exactly.

Finish each step before moving forward. Commands can be copied directly from the workbook.

01

Get a Windows VPS

Choose a Windows VPS with enough RAM and CPU for MetaTrader 5, Python, Codex and a browser. Keep the machine available continuously if you want the scheduler to run 24/7.

02

Log in to the VPS

On your computer, open Remote Desktop, enter the VPS IP address, and sign in with the Windows username and password provided by your VPS company.

03

Download and sign in to MetaTrader 5

Install MT5 inside the VPS, open it, and sign in to the trading account you want the application to read. Keep the terminal running.

Open the official MT5 download page

04

Download Node.js

Install the current Node.js LTS release for Windows. Accept the standard installer options, then reopen Command Prompt so the new commands are available.

Open the official Node.js download page

05

Install the Codex CLI

Open Command Prompt and install Codex globally.

npm install -g @openai/codex
06

Run Codex and sign in

Run Codex in Command Prompt. Choose the device-code sign-in flow, open the displayed verification URL in your browser, and enter the code shown in the terminal.

codex
07

Start Codex with build permissions

From the empty project folder where you want the bot created, start Codex with the following command.

codex --ask-for-approval never --sandbox danger-full-access
Important: this mode gives Codex unrestricted access to the current machine without confirmation prompts. Use it only on a dedicated VPS with no unrelated or sensitive files, and run it from the intended project folder.
09

Create your Telegram bot

Open Telegram and search for the verified @BotFather account. Send /newbot, choose a display name and a unique username ending in bot, then securely save the HTTP API token BotFather gives you.

Open your new bot from the link, tap Start, and send /start. To obtain your chat ID, open https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates in the VPS browser and copy the number shown inside message.chat.id.

Save as TELEGRAM_BOT_TOKENSave as TELEGRAM_CHAT_ID
Keep both values private: never post the bot token in comments, screenshots, GitHub, or public messages. If it is exposed, revoke it immediately through BotFather and generate a new token.
10

Set the required .env values

After the project is built, open its .env file and add your own credentials and local paths. Paste the Telegram token and chat ID saved in the previous step. Never share this file publicly.

DEEPSEEK_API_KEYMT5_PATHTELEGRAM_CHAT_IDTELEGRAM_BOT_TOKEN
11

Ask Codex to run the app

Tell Codex in plain English: “Run the app, fix any startup errors, and tell me the local dashboard address.” Keep the terminal open while it starts the application.

12

Open the local dashboard

Copy the localhost address Codex provides and open it in the browser inside the VPS. The default requested by the build brief is http://127.0.0.1:8765. Begin in Preview or Sim mode before connecting execution.

Copy-ready build brief

Part 5 master prompt

Loading the master prompt…

Start with Preview or Sim mode. Do not enable demo or live execution until you have reviewed the generated project, configured the correct MT5 account, and completed controlled testing.

Copied