DATA INPUTS 0 selected
TIMEFRAMES 1 selected
AVAILABLE API
Data Access:
data["expr_name"] — expression value
bar.close/open/high/low
bar.volume / bar.frame
bar.symbol / bar.timestamp
history[i] — past closes (max 500)
Built-in Functions:
sma(history, period)
stdev(history, period)
highest(history, period)
lowest(history, period)
C++ Standard:
std::abs, sqrt, pow, log
std::max, min, round
std::vector, map, string
INDICATOR REFERENCE 130+
evaluate()
helpers
1
Docs
Output
Config

How It Works

Write your signal logic in the editor. Your code becomes the body of evaluate() — just return true (signal fires) or false (no signal).

Data Shopping List

Select expressions from the left panel. They become your inputs:

double rsi = data["RSI_14_5Min"]; double sma = data["SMA_200_1Hour"]; double trend = data["TrendObject_20_200"];

Bar Data

Latest bar from each selected timeframe:

bar.open bar.high bar.low bar.close bar.volume bar.frame bar.symbol bar.timestamp

Price History

history.size() // how many bars history.back() // latest close sma(history, 20) // 20-bar SMA stdev(history, 20) // std deviation highest(history, 10) // 10-bar high lowest(history, 10) // 10-bar low

Auto-Included (no need to add)

<iostream> <string> <map> <vector> <sstream> <cmath> <algorithm> <numeric> <deque> <cstring>

Helpers Tab — Your Code

In the helpers tab you can define:

// ① Extra includes (whitelisted) #include <set> #include <array> #include <tuple> #include <functional> #include <limits> #include <iomanip> // ② Your own structs/classes struct SignalState { double prevRsi = 0; double prevMacd = 0; int barCount = 0; }; static SignalState state; // ③ Helper functions double crossover(double prev, double curr, double prevSig, double currSig) { return (prev <= prevSig) && (curr > currSig); }

Helpers are placed at file scope, before evaluate(). Use static for state that persists across evaluations.

Tips

  • Use static variables to track state across bars
  • Check history.size() before using lookbacks
  • Your code runs once per EVAL (typically per bar close)
  • Keep logic fast — no loops over huge datasets
  • Banned: system() fork() fopen() malloc()

Architecture

Your code compiles to a standalone binary. GTS spawns it as a subprocess and communicates via pipe:

GTS → pipe: EXPR|RSI_14|28.5 GTS → pipe: BAR|5Min|O|H|L|C|Vol GTS → pipe: EVAL Binary → pipe: TRUE or FALSE

Latency: ~0.01ms per evaluation (85K+ evals/sec)

Ready C++ | evaluate() | Pipe Protocol Ln 1, Col 1 | 0 chars