Skip to main content

Code Editor interface

Open page: https://live.gunbot.com/code-editor/

Code Editor interface screenshot

The Code Editor is the advanced workspace for custom strategy work and file-level control. Its most interesting use is writing and maintaining JavaScript strategy files directly inside the app.

What you can do here

Use Code Editor to:

  • Create and edit custom strategy JavaScript files.
  • Open several strategy or configuration files in tabs.
  • Use snippets while writing strategy logic.
  • Inspect main config, AutoConfig, backups, state files, and AutoConfig variable files.
  • Save, reload, revert, or delete supported files from the browser.

This page is powerful because it gives direct file access. It also means mistakes can matter. Read the active tab name and file type before saving.

Strategy files

The Strategy Files section is where custom trading logic lives. You can create a new strategy file, write JavaScript, save it, then test or assign it through the rest of the workflow.

Use clear filenames and keep experimental files separate from files you rely on. A file named for the idea is easier to manage than a chain of test1.js, test2.js, and final-new.js.

Editor tabs

Files open in tabs. The active tab is the file that will be saved. Unsaved changes are shown before you leave or close a tab, which helps prevent accidental loss.

Use tabs to compare a strategy file with the config that references it, or to inspect a backup before changing the current file.

Config and inspection files

The editor can also show main config, AutoConfig, backup configs, state files, and AutoConfig variable files. Some of these are editable and some are read-only inspection files.

Read-only files are still useful. They can explain what the bot saw or stored without giving you a Save button.

Validation limits

The editor can catch syntax problems in JSON or JavaScript before saving. That does not prove a strategy is safe, profitable, or logically correct. It only means the file has the expected structure.

Treat strategy changes like code changes: save carefully, test with Backtesting or Simulator, and review the first live behavior on Chart.

How Code Editor fits the workflow

Use Code Editor when you need custom strategy logic or file-level inspection. Use Trading Settings to assign strategies to pairs, Backtesting to test ideas, Chart to inspect trades, and Debug Logs when the running bot reports errors.