📰 Latest: HaasOnline Academy Is Back — Structured Education for Smarter Trade Bots
Account
Visual HaasScript Essentials

Introduction Visual HaasScripts

Introduction to Visual HaasScripts

Visual HaasScript is the same trading engine as code-based HaasScript, presented as a node-based canvas instead of a text editor. You place nodes, connect them with colored wires, and the platform generates the trading logic. No code required.

Because both editors share the same underlying engine, every command available in code exists as a node in the visual editor. Custom commands you write in code can be used as nodes in a visual script, and vice versa. The representation differs — the behavior does not.

The Canvas

When you open the visual editor, you see a dark grid where nodes are placed. Each node represents a HaasScript command.

Anatomy of a Node

  • Header — the node name at the top, color-coded by category
  • Inputs — connection points on the left side. Values flow into the node here.
  • Outputs — connection points on the right side. The node's result flows out here.

Some inputs and outputs can also be configured inline on the node itself, such as fixed text values or dropdown selections.

Required vs Optional Connections

Input and output points use two shades of grey to indicate whether a connection is mandatory:

  • Light grey — a working connection is required. An error will be produced if not connected.
  • Dark grey — the connection is optional. Leave it unconnected if you do not need it.

This lets you ignore parameters that are not relevant to your setup without cluttering the canvas.

Connection Colors

Wires between nodes are color-coded by the data type they carry:

Color Data Type Example
Orange Boolean True/false from a safety check
Blue Number A numeric value like price or percentage
Green Enum A signal like SignalLong or SignalShort
Teal ListNumber A collection of numeric values
Magenta String Text values
Yellow Dynamic A value whose type is determined at runtime

Matching colors across nodes makes the flow easier to trace. If you see an orange wire feeding into an orange input, you know a boolean is being passed where a boolean is expected.

When to Use Visual vs Code

Visual is a good fit when:

  • You are learning HaasScript and want to see how commands relate
  • You prefer visual logic over text
  • You are building strategies from pre-existing commands without heavy custom computation

Code is a better fit when:

  • You need loops, complex math, or conditional branching that is cumbersome to express as nodes
  • You are writing reusable custom commands
  • You want finer control over execution order

Both produce the same result — a trading script the platform executes identically. Choose the format that makes your logic clearest to you.