← All indicators and concepts

TradeX Script: write the indicator yourself

When the list of indicators stops, a formula starts. One line of arithmetic over the series we already have.

However many indicators we build in, it is never “all of them”. A list is finite; a formula is not. So every condition in the builder has one extra choice at the bottom of the indicator list: “Your own formula…”. You type something like ema(close, 20) - ema(close, 50) and it becomes a series like any other: you can compare it, cross it, take its speed, and read it on a slower timeframe.

You can use open, high, low, close, volume, hl2, hlc3 and ohlc4, every indicator in the library (rsi(14), atr(14), macd()…), and functions such as sma, ema, stdev, highest, lowest, crossover, barssince, valuewhen and iff. close[1] is the value one candle back.

Nothing you write runs on our server. The text is read into numbers, series and functions we know; there is no eval, no access to anything else, and there is a cap on the length and the number of steps. A formula that does not work out is refused when you save, not quietly ignored while your money is at stake.

The same code reads your formula in the live engine and in the backtest, and a test compares them candle by candle. That is on purpose: a backtest that reads your formula differently from the engine would be worthless.

In TradeXtool

Entry: ƒ volume / sma(volume, 20) is above 2, so you only enter when this candle trades at twice its usual volume.

Watch out

A formula makes it easy to invent something that fits the past. The more unusual the formula, the more you should distrust a good backtest: test it on other coins and another period before you believe it.

No indicator predicts the market on its own. Build the rule, then test it on years of history with fees included. Try TradeXtool free for 14 days.