AlgoBarsX | A Trading Language You Can Read Out Loud | AlgoBars

AlgoBarsX

A trading language
you can read out loud.

Write a trading idea in a few short lines. The same lines draw on your chart, test on past prices, send your alerts and place your trades. Write it once. Use it everywhere.

Trading involves risk of loss. AlgoBarsX is software. It doesn’t give financial advice or predict results.

● Compiled, 0 errors
ema-cross.abx
1strategy "EMA Cross"
2market: EURUSD
3bars: 15m
4 
5input fast = 20
6input slow = 50
7 
8when crosses_above(ema(close, fast), ema(close, slow)):
9buy risk: 1%, stop: 25 pips, target: 2R
10 
11when crosses_below(ema(close, fast), ema(close, slow)):
12close_all
What this script says

EMA Cross trades EURUSD on 15-minute bars. When the fast EMA crosses above the slow EMA, it buys at market, risking 1% of the balance, with a stop 25 pips from the entry and a target at 2R. When it crosses back below, it closes all trades.

Generated from the compiled script. If the English is wrong, the code is wrong.
trend-ribbon.abx
1indicator "Trend Ribbon"
2pane: price
3 
4input fast = 20
5input slow = 50
6 
7fast_line = ema(close, fast)
8slow_line = ema(close, slow)
9 
10export up = fast_line > slow_line
11export strength = (fast_line - slow_line) / atr(14)
12 
13plot fast_line as fast, color: if up then green else red
14plot slow_line as slow, color: gray
What this script says

Trend Ribbon is drawn over the price chart. It calculates a fast and a slow EMA, whether the trend is up, and its strength measured in ATR, and shares “up” and “strength” with other scripts. The fast line turns green in an uptrend and red otherwise.

Generated from the compiled script. If the English is wrong, the code is wrong.
risk-guard.abx
1alert "Daily risk guard"
2check: every 1m
3repeat: every time
4cooldown: 4h
5 
6when history.today.pnl < -(2% of account.balance) or account.margin_level < 150%:
7notify "Daily P&L {history.today.pnl:$0.00}, margin level {account.margin_level:0}%"
What this script says

Daily risk guard checks every minute and waits 4 hours between alerts. When today’s closed P&L falls below −2% of the balance, or the margin level drops below 150%, it sends you a notification with both numbers.

Generated from the compiled script. If the English is wrong, the code is wrong.
Built-in functions
137
Automated engine tests
678
Bars a second in a backtest
195k
A month, every feature
$0

One script. Four places.

A rule means the same thing everywhere.

Every part of AlgoBars reads the same script, so a rule behaves the same on the chart, in a test, in an alert and in a live trade.

ema-cross.abxOne script
On the chart

Plots, levels, boxes and marks drawn straight from the script.

In the backtest

Orders fill by 24 written rules, checked against 37 exact test cases.

In your alerts
Daily risk guardDaily P&L −$203.26, margin 164%

How often it checks, repeats and stops is set in the script.

In live automation
BUY EURUSD · risk 1% · 2RConfirmed by broker

The same rules place and manage orders through your own broker account.

Sample data, for illustration.

Mistakes caught before anything runs

The compiler has your back.

AlgoBarsX checks every line before a single bar runs: wrong names, mixed-up units, a price where a distance should be. Each message says what’s wrong and how to fix it. Many fix in one click.

These are the compiler’s real messages. Each of its 50 diagnostic codes is stable: a code is never reused for a different meaning.

ema-cross.abx3 errors
1strategy "EMA Cross"
2market: EURUSD
3 
4when crosses_above(emma(close, 20), ema(close, 50)):
5buy risk: 1%, target: 2R
6trail by: 25
  • E103
    A misspelled function

    “emma” isn’t a function. Did you mean ema?

  • E204
    A number with no unit

    25 what? Pick pips or points.

  • E305
    Risk with nothing to measure it from

    A percent-risk order needs a stop before it can be sized.

✓ Compiled, 0 errors. Ready to test.

Bring the scripts you already wrote

Paste it in. Get it back, checked.

AlgoBarsX reads scripts from other platforms, rebuilds them and checks that they work. Every line gets a note, and anything that can’t convert is flagged.

What you paste Pine Script
1//@version=5
2strategy("EMA Cross", overlay=true)
3fast = input.int(20, "Fast")
4slow = input.int(50, "Slow")
5if ta.crossover(ta.ema(close, fast), ta.ema(close, slow))
6strategy.entry("Long", strategy.long)
7if ta.crossunder(ta.ema(close, fast), ta.ema(close, slow))
8strategy.close("Long")
What you get back ema-cross.abx
1strategy "EMA Cross"
2market: EURUSD
3bars: 1h
4 
5input fast = 20
6input slow = 50
7 
8when crosses_above(ema(close, fast), ema(close, slow)):
9buy size: 1 lot, tag: "Long"
10 
11when crosses_below(ema(close, fast), ema(close, slow)):
12close_all tag: "Long"

7 lines: 4 exact · 2 adapted · 2 decisions for you

  • Exactfast = input.int(20, "Fast")input() became an input
  • Adaptedif ta.crossover(…)an if that places orders became a rule
  • Your callstrategy.entry("Long", strategy.long)had no size of its own, so it became one lot: set the size or risk you want
Pine ScriptMQL4 and MQL5NinjaScriptEasyLanguagethinkScriptPython: backtrader, freqtrade, pandas

Pine Script, MQL, NinjaScript, EasyLanguage and thinkScript are trademarks or products of their respective owners and are named only to describe compatibility. AlgoBars is not affiliated with, sponsored by or endorsed by any of them.

Risk is part of the grammar

One order, fully managed.

Percent, pips, R and dollars are real units here. Your stop, target and trade plan sit right under the order they belong to, so the whole plan is in one place.

Filled. The stop sits 1R below the entry.

1buy risk: 0.5%, stop: lowest(low, 10) - 5 points, target: 3R:
2breakeven at: 1R
3partial 50% at: 2R
4trail by: atr(14) * 1.5, after: 2R
5exit after: 60 bars

Mechanics only. A made-up path measured in R, not a result or a forecast.

The language

Simple on top. A full language underneath.

Size an order by what you are willing to lose

State the risk as a percent of the balance or as money, with the stop and the target. Position size follows from them, rounded down to the lot step. If the broker's minimum lot would carry more than you asked for, the trade is marked “above requested risk”.

1buy risk: 1%, stop: 25 pips, target: 2R
2sell risk: $200, stop: highest(high, 10) + 2 pips, target: lowest(low, 50)

Name every confirmation

List what a setup needs, give each condition a name, and require all of them or at least some number. The backtest report then breaks trades down by which confirmations agreed.

1confirmations long_setup:
2trend: ema(close, 50) > ema(close, 200)
3momentum: rsi(close, 14) between 55 and 70
4volume: volume > sma(volume, 20) * 1.5
5structure: break_of_structure(direction: up)
6require: at least 3

Setups that happen in steps

A sequence waits for its steps in order, inside a bar limit, and resets if the idea is invalidated. Later steps can refer to the bar where an earlier step happened.

1sequence liquidity_grab within 30 bars:
2step sweep: low < lowest(low, 20)[1]
3step reclaim: close > sweep.high
4step retest: low <= reclaim.close and close > reclaim.close
5reset_if: close < sweep.low

Say when a rule may fire, on the rule

Every 4th time, skip the first 3, at most 2 a day, a 30-minute cooldown, once, inside named sessions, or between clock times in a named time zone. No counters to build by hand.

1when setup.passed every 4th within sessions london, new_york:
2when starts(setup.passed) skip first 3 max 2 per day cooldown 30m:
3when grab.completed from 08:00 to 11:00 Europe/London:

Market, limit, stop and Smart Orders

Pending orders can expire after a number of bars or a length of time. Size in lots or by risk. Opposite signals can be ignored, close the open trade, reverse it or hedge, and pyramiding and a minimum distance between entries are header settings.

1buy limit: lowest(low, 5), size: 1 lot, expires: 10 bars
2buy stop: high + 2 pips, risk: 0.5%, stop_loss: low - 2 pips, target: 2R, ghost: true

Set the limits where everyone sees them

Caps on open trades, trades per side, total risk, daily loss and drawdown sit in the header. When the daily limit is reached, open trades close, pending orders are cancelled and new entries wait for the next UTC day. A drawdown limit pauses the deployment until you resume it.

1strategy "Language Tour"
2markets: EURUSD, GBPUSD
3max_open: 3
4max_open_per_side: 2
5max_daily_loss: 3%
6max_drawdown: 10%
7trade_only: within sessions london, new_york

Read other markets and other bar sizes

Higher bar sizes, other symbols, the 1-minute bars inside the current bar, and Renko, Heikin Ashi and X-Ray bars. A higher bar's value appears only once its candle has closed, and a script can ask how much data it actually has.

1h4 = bars(bars: 4h)
2gold = bars(XAUUSD, bars: 15m)
3recent_high = intrabar(1m).high.max()
4spread_z = zscore(log(close_of(EURUSD) / close_of(GBPUSD)), 100)

Run at the bar close, or on every tick

One header line switches a script to tick evaluation. Inside a forming bar prices are live while indicators hold their last closed value, so nothing repaints. When a backtest has no finer data for a bar, the run is labelled “approximate intrabar” and lists the bars affected.

1strategy "Tick Scalper"
2market: XAUUSD
3bars: 1m
4evaluate: tick
5max_open: 1
6 
7input max_stretch = 2.0
8 
9when crosses_above(close, vwap()) once per bar cooldown 2 bars:
10buy risk: 0.5%, stop: 30 points, target: 1.5R, ghost: true
11 
12on tick:
13if not bar.confirmed and close < vwap() - atr(14) * max_stretch:
14close_all side: long

Ask the account and the market directly

Balance, equity, margin, free margin and margin level, open positions and pending orders, today's and past results, plus each market's pip size, lot step, leverage tiers, sessions and next open. Useful for alerts that watch the account instead of the chart.

1alert "Margin and exposure"
2check: every 5m
3repeat: once
4expires: 30d
5 
6when account.free_margin < 20% of account.equity or positions.len >= 8:
7notify "Free margin {account.free_margin:$0} with {positions.len} open positions"

Alerts that carry their own rules

How often to check, whether to fire once, once per bar or every time, how long to wait between messages and when to expire are all written in the alert. Testing one shows the messages it would have sent and the ones it held back. Messages can include live values, and an alert can mark the chart where it fired.

1alert "RSI bullish divergence"
2check: every 15m
3repeat: once per bar
4show_on_chart: true
5 
6input rsi_length = 14
7input lookback = 30
8 
9momentum_now = rsi(close, rsi_length)
10lower_low = low < lowest(low, lookback)[1]
11higher_rsi = momentum_now > lowest(momentum_now, lookback)[1]
12 
13when lower_low and higher_rsi and was(momentum_now < 30, within: 5 bars):
14notify "Bullish RSI divergence on {market.symbol}: RSI {momentum_now:0.0}"

Write an indicator once, use it everywhere

An indicator exports named values. A strategy or alert pulls it in by name and version, sets its inputs, and reads those values like any other, so a filter you trust is written once and never copied.

1indicator "Trend Ribbon"
2pane: price
3 
4input fast = 20
5input slow = 50
6 
7fast_line = ema(close, fast)
8slow_line = ema(close, slow)
9 
10export up = fast_line > slow_line
11export strength = (fast_line - slow_line) / atr(14)
12 
13plot fast_line as fast, color: if up then green else red
14plot slow_line as slow, color: gray

React to what happens

Run code on start, bar close, tick, fill, exit, session open, day change and render. Text in quotes can include live values with a format, such as a trade's result in R to two decimals.

1on fill(order):
2log "filled {order.size}"
3 
4on session open "new_york":
5log "New York is open"
6 
7on exit(trade):
8log "{trade.tag} closed at {trade.r:0.00}R"

Draw what the script sees

Plots, fills, lines, boxes, labels, Fibonacci levels, pitchforks, channels, volume profiles, heatmaps, tables and dashboards, plus a free-form canvas for anything else. Colours fade and blend by name.

1fast_line = ema(close, 20)
2slow_line = ema(close, 50)
3plot fast_line, color: if fast_line > slow_line then green else red, width: 2
4fill fast_line, slow_line, color: green.fade(80)
5profile rows: 24, range: session, side: right
6dashboard position: top_right, rows: [["Trend", "{bar.direction}"]]

Simple on top, a full language underneath

Functions, your own types and enums, lists with filter and sort, loops, pattern matching and state that survives between bars. Libraries and indicators are versioned, and a script names the version it uses. There is one canonical layout: format a script twice and nothing changes.

1use library "Quant Toolkit" v2 as qt
2 
3enum Regime: trending, ranging, volatile
4 
5fn swing_strength(len: int) -> number:
6up = highest(high, len) - close
7down = close - lowest(low, len)
8return (down - up) / atr(14)

In code, Smart Orders are written as ghost : true.

Rules the engine holds itself to

A backtest is only useful if it can’t cheat.

Our tests check these rules on every build. They describe how the software works, not how any strategy will do.

137functions
61example scripts
678automated tests
195kbars/sec
What happens inside one bar
When a bar touches both the stop and the target, the engine walks the 1-minute bars inside it in order. When finer data can’t tell, the stop fills. Never the flattering answer.
No look-ahead
A bar never sees a later bar. Tests change the future and check that the past didn’t move.
Same answer every time
The same script, inputs and bars give the same result, to the last digit.
Higher timeframes stay honest
A 4-hour value appears only after its candle closes. A 5-minute rule can’t peek early.
A spent account stops the test
When the test account runs out, the backtest ends there and says so.
Costs are stated, not hidden
Backtest profit is the raw price move. Spread, fees, swaps and slippage are left out, so live results will differ.

Backtest results are hypothetical and based on historical data. Past performance doesn’t guarantee future results.

From first draft to a live account

The Terminal around the language.

A report that explains itself
Breakdowns by the rule that opened each trade, how it ended, confirmations, side, tag and month, plus drawdown, MAE, MFE and the spread of results in R.
Every run is kept
Each run is saved with the code that produced it, so trying an idea never costs you the last one.
Say it in plain English
Type a description and a Convert to AlgoBarsX button writes the script for you to read and change.
Share it open or sealed
An open .abx file carries its code. A sealed one runs on someone else’s account without showing it, but still states what it does.
Live runs wait for the broker
A trade exists only once your broker confirms it, and an instruction is never sent twice.
Edits to a live script are explained first
Before you change a running script, the Terminal tells you what the edit would change.

Questions

Simple answers.

Still unsure? Call +1 855-889-6969 or open the live chat. We’re here 24/7.

Do I need to know how to code?

No. AlgoBarsX reads like a trading plan, and every script is turned back into plain English so you can check it says what you meant. Or let the AI write it for you.

What does it cost?

$0 a month, with every feature unlocked. Writing, importing and backtesting your own scripts is free and unlimited. If the AI writes or analyses a script for you, you pay only its compute cost. No credits. Each MetaTrader 4, MetaTrader 5, cTrader or external broker account you connect is $97 a month or $1,000 a year.

Will live results match my backtest?

No, and you shouldn’t expect them to. Backtests are hypothetical: they use past prices and leave out spread, fees, swaps and slippage. Past performance doesn’t guarantee future results.

Does AlgoBars hold my money?

No. AlgoBars is software, not a broker. It connects to your own account at a supported broker and never holds your money. We don’t give financial, investment or trading advice.

Can I bring my existing scripts?

Yes: Pine Script, MQL4 and MQL5, NinjaScript, EasyLanguage, thinkScript or Python. Each line gets a note, and anything that can’t convert is flagged.

More questions

Everything else you asked.

Answers to the other questions people ask about this.

Is backtesting free?

Yes. Backtests are free and unlimited on every account. Test any market and bar size we have data for. Profit is the raw price move, with no spread, fees, swaps or slippage added.

Can I share a strategy without showing the code?

Yes. Save it as a sealed .abx file. Others can run it but can't read the code. It still shows its name, what it trades, its inputs and a plain-English summary, so no one runs it blind.

What happens if a live strategy restarts?

Nothing is lost. The runner saves your open trades, stops and half-done setups. After a restart it warms up the indicators and picks up where it stopped. A trade only counts once your broker confirms it.

Write it once. Use it everywhere.

$0 a month. Unlimited backtests. No card.

Every feature, free. No card. No catch. · AI at compute cost only · Trading involves risk