GTS Trading
Browsing as visitor. Read-only preview — sign in to save your work.
Quick Create — Type in natural language or formula NLP
RSI(14) < 30 SMA(50) > SMA(200) ATR > 100 EMA of RSI Close > BB Upper Indicators.RSI < 30 Close > SMA(200)

Generate with AI — describe the expression; AI builds it, validates it, loads it here

RSI 14 below 30 Close crosses EMA 200 Price move 5t / 10s EMA of RSI RSI + MACD combo

JSON Import — paste a full expression JSON object (advanced) JSON

click to expand / collapse
0 chars
⬅️ Left Side
Select an element type above
Operation
Compare
Math
Logic
Right Side ➡️
Select an element type above
Optional
Left Side
Right Side
Optional

Expression Preview

Build your expression above to see a preview here

Custom Code Operand C++

Lua Code Extension Lua

Checking Lua runtime availability...
What this builds: a Lua-backed expression that returns true or false. It is saved as a named expression (for example abc) and is then used exactly like any other expression — nothing is called from the code.
Procedure: select the expressions and bar frames this Lua expression may use, then write one Lua function named evaluate(). No class, inheritance, or special reference is needed. The runtime gives the function a ready-to-use gts object.
Code contract: read inputs with gts.bar("5Min") and gts.expr("DX_14_1m"), calculate your condition, then return only true or false.
Requested Expressions & Frames optional AI infers these from your code — set only to constrain
Code Review Workspace
Write code, test it with sample data, then submit it for review.
Most submissions are reviewed quickly. If something needs attention, you get clear feedback right away — adjust and resubmit, or ask the team to take a closer look.
Code Submission Status expand to view review progress
Code IDE Lua
Intervals
Loading...
No file open
No file Ctrl+Z undo · Ctrl+Y redo
API Reference — gts_base.lua Getters
How to write the Lua code: define one function: function evaluate(). The runtime provides gts automatically; do not call require(). Inside it, read only the inputs you selected above, such as gts.bar("5Min") for candle data or gts.expr("DX_14_1m") for a saved expression value. Calculate your condition and return true when the signal should fire, otherwise return false. You do not create a class, inherit anything, or connect to the server yourself. After submit, GTS reviews and validates the script, then makes the approved expression available for use.
Getter Returns Description
gts.bar() table Last received bar (any frame): {symbol, period, open, close, high, low, volume, date}
gts.bar("5Min") table Latest bar for a specific frame (not overwritten by other frames).
gts.bars() table All bars keyed by frame: {"1Min"=bar, "5Min"=bar, ...}
gts.symbol() string Current symbol name this script is handling.
gts.expr("name") number Expression value by name.
Auto-provisioned getters — no pre-selection needed; call :value()
getInd("RSI","30Min") handle Any indicator (RSI/EMA/MACD/ATR/...). getInd("RSI"):value() < 30
getCdl("ENGULFING","5Min","Bearish") handle Candle pattern (trend Bullish/Bearish); compare :value() > 0.
getPricePattern("BullFlag",10,"5Min") handle Chart pattern formation; :value() > 0 on OnFormationDone.
getAshi("DIRECTION","15Min") · getRenko("ON_BAR_CREATION","5Min",15) handle Heikin-Ashi / Renko bar fields.
getAccount("Balance") · getOpenPos("TotalUnits") · getLastPos("CurrentProfitTicks") handle Account & position metrics (no manual position loops).
getExt("FvgDetector","15Min") handle Extended/ICT indicators (200). Multi-output → pass a field. :value() > 0
getTickRev("TickRevEvent",10,"Bid") handle Tick-reversal bar (field, tickRevVal, direction). Fields: TickRevEvent, Direction, Close Price…
getFibo("TickRevRatioEvent",28,100) handle Fibonacci bar (field, tickRevRatio, minLenAB).
getTrend("FastPrice","5Min",9,21) handle Trend object (field, frame, fastSize, slowSize). Fields: FastPrice, SlowPrice, TrendSide…
getChannel("UpperChannel","5Min",20,5) handle Channel (field, frame, minWidth, doneTicks). Fields: UpperChannel, LowerChannel, CurrentLeg…
getPivot("Pivot Point","5Min") handle Pivot levels (field, frame). Fields: Pivot Point, Support 1-3, Resistance 1-3.
getQuote("Bid") handle Live quote. Fields: Bid, Ask, MidPrice, SpreadInTicks, TicksInPoint, OpenDate.
getFund("revenue","annual",0) handle Fundamentals (89): revenue, netIncome, epsBasic, operatingCashflow… (field, periodMode, offset).
getMove("Direction","5Min") handle Price move (field, frame). Fields: onPriceMove, Direction, getCurrentWidth/Speed/Duration.
getABC("Direction","AB",28,2) handle ABC wave (field, wave, tickRevVal, numElements). Fields: Direction, Distance, Start/End Price…
getConsensus("SignalA","SignalB") handle Composite score over real selected signal expressions; compare the score (e.g. :value() > 0.6).
getInd("RSI"):zscore():meandev(4) handle Unary history transforms chain on ANY getter: zscore(n) meandev(n) momentum(n) max(n) min(n) accel(n) pctrank(n) signmomentum(n). End with :value().
gts.has_bar() / has_bar("5Min") boolean True if any bar / specific frame bar has been received.
gts.has_expr("name") boolean True if expression has been received at least once.
gts.has_tick() boolean True if any tick has been received.
gts.has_open() / has_open(id) boolean True if any / specific open position exists.
gts.has_closed() / has_closed(id) boolean True if any / specific closed position exists.
gts.tick() table Last tick: {symbol, bid, ask, volume, date}
gts.current_open() table/nil First/only open position, or nil if none.
gts.last_closed() table/nil Most recently closed position (by closeDate), or nil.
gts.open_positions() table All open positions keyed by id.
gts.closed_positions() table All closed positions keyed by id.
gts.bar_count() / gts.tick_count() number Running counters of received bars and ticks.