On the chart
Plots, levels, boxes and marks are drawn straight from the script.
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 does not give financial advice or predict results.
strategy "EMA Cross"market: EURUSDbars: 15minput fast = 20input slow = 50when crosses_above(ema(close, fast), ema(close, slow)):buy risk: 1%, stop: 25 pips, target: 2Rwhen crosses_below(ema(close, fast), ema(close, slow)):close_allindicator "Trend Ribbon"pane: priceinput fast = 20input slow = 50fast_line = ema(close, fast)slow_line = ema(close, slow)export up = fast_line > slow_lineexport strength = (fast_line - slow_line) / atr(14)plot fast_line as fast, color: if up then green else redplot slow_line as slow, color: grayalert "Daily risk guard"check: every 1mrepeat: every timecooldown: 4hwhen history.today.pnl < -(2% of account.balance) or account.margin_level < 150%:notify "Daily P&L {history.today.pnl:$0.00}, margin level {account.margin_level:0}%"What this script says
EMA Cross is a strategy that trades EURUSD on 15-minute bars.
You can change 2 inputs: fast (default 20) and slow (default 50).
When the EMA of the close over fast bars crosses above the EMA of the close over slow bars, it buys at market, risking 1% of the balance, with a stop 25 pips from the entry and with a target 2R from the entry.
When the EMA of the close over fast bars crosses below the EMA of the close over slow bars, it closes all trades.
Trend Ribbon is an indicator drawn over the price chart.
You can change 2 inputs: fast (default 20) and slow (default 50).
It calculates fast_line as the EMA of the close over fast bars, slow_line as the EMA of the close over slow bars, up as whether fast_line is above slow_line and strength as (fast_line minus slow_line) divided by the 14-bar ATR. It shares up and strength with scripts that use it.
On the chart, it plots fast_line as fast and plots slow_line as slow.
Daily risk guard is an alert that checks every 1 minute, can fire every time its condition is met and waits 4 hours between alerts.
When today's closed profit or loss is below minus 2% of the account balance or the margin level is below 150%, it sends the notification "Daily P&L {history.today.pnl:$0.00}, margin level {account.margin_level:0}%".
Generated from the compiled script, not written by hand. If the English is wrong, the code is wrong.
Every part of AlgoBars reads the same script. So a rule means the same thing on the chart, in a test, in an alert and in a live trade.
Plots, levels, boxes and marks are drawn straight from the script.
Orders fill by 24 written rules. We check them against 37 exact test cases.
How often it checks, repeats and stops is set right in the script. No extra forms.
The same rules place and manage orders through your own broker account. You stay in control of it.
AlgoBarsX checks every line before a single bar runs. Wrong names, mixed-up units, a price where a distance should be: it catches them all. Each message says what is 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.
Paste a script from another platform. AlgoBarsX reads it, rebuilds it and checks that it works. Every line gets a note. If something can't convert, it tells you.
//@version=5strategy("EMA Cross", overlay=true)fast = input.int(20, "Fast")slow = input.int(50, "Slow")if ta.crossover(ta.ema(close, fast), ta.ema(close, slow))strategy.entry("Long", strategy.long)if ta.crossunder(ta.ema(close, fast), ta.ema(close, slow))strategy.close("Long")strategy "EMA Cross"market: EURUSDbars: 1hinput fast = 20input slow = 50when crosses_above(ema(close, fast), ema(close, slow)):buy size: 1 lot, tag: "Long"when crosses_below(ema(close, fast), ema(close, slow)):close_all tag: "Long"fast = input.int(20, "Fast")input() became an inputif ta.crossover(ta.ema(close, fast), …)an if that places orders became a rulestrategy.entry("Long", strategy.long)strategy.entry() had no size of its own, so it became one lot: set the size or risk you wantPine 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.
Indicators, stats, market structure and drawing tools are built in. Each one is explained right in the editor as you type.
Measured on the engine: about 105,000 bars a second through ten indicators, 195,000 through a full backtest, and roughly a million 1-minute bars a second when resolving the price path inside bars.
Percent, pips, R and dollars are real units here. Your stop, target and trade plan sit right under the order they belong to. The whole plan is in one place.
buy risk: 0.5%, stop: lowest(low, 10) - 5 points, target: 3R:breakeven at: 1Rpartial 50% at: 2Rtrail by: atr(14) * 1.5, after: 2Rexit after: 60 barsMechanics only. A made-up path measured in R, not a result or a forecast.
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”.
buy risk: 1%, stop: 25 pips, target: 2Rsell risk: $200, stop: highest(high, 10) + 2 pips, target: lowest(low, 50)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.
confirmations long_setup:trend: ema(close, 50) > ema(close, 200)momentum: rsi(close, 14) between 55 and 70volume: volume > sma(volume, 20) * 1.5structure: break_of_structure(direction: up)require: at least 3A 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.
sequence liquidity_grab within 30 bars:step sweep: low < lowest(low, 20)[1]step reclaim: close > sweep.highstep retest: low <= reclaim.close and close > reclaim.closereset_if: close < sweep.lowEvery 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.
when setup.passed every 4th within sessions london, new_york:when starts(setup.passed) skip first 3 max 2 per day cooldown 30m:when grab.completed from 08:00 to 11:00 Europe/London: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.
buy limit: lowest(low, 5), size: 1 lot, expires: 10 barsbuy stop: high + 2 pips, risk: 0.5%, stop_loss: low - 2 pips, target: 2R, ghost: trueCaps 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.
strategy "Language Tour"markets: EURUSD, GBPUSDmax_open: 3max_open_per_side: 2max_daily_loss: 3%max_drawdown: 10%trade_only: within sessions london, new_yorkHigher 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.
h4 = bars(bars: 4h)gold = bars(XAUUSD, bars: 15m)recent_high = intrabar(1m).high.max()spread_z = zscore(log(close_of(EURUSD) / close_of(GBPUSD)), 100)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.
strategy "Tick Scalper"market: XAUUSDbars: 1mevaluate: tickmax_open: 1input max_stretch = 2.0when crosses_above(close, vwap()) once per bar cooldown 2 bars:buy risk: 0.5%, stop: 30 points, target: 1.5R, ghost: trueon tick:if not bar.confirmed and close < vwap() - atr(14) * max_stretch:close_all side: longBalance, 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.
alert "Margin and exposure"check: every 5mrepeat: onceexpires: 30dwhen account.free_margin < 20% of account.equity or positions.len >= 8:notify "Free margin {account.free_margin:$0} with {positions.len} open positions"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.
alert "RSI bullish divergence"check: every 15mrepeat: once per barshow_on_chart: trueinput rsi_length = 14input lookback = 30momentum_now = rsi(close, rsi_length)lower_low = low < lowest(low, lookback)[1]higher_rsi = momentum_now > lowest(momentum_now, lookback)[1]when lower_low and higher_rsi and was(momentum_now < 30, within: 5 bars):notify "Bullish RSI divergence on {market.symbol}: RSI {momentum_now:0.0}"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.
indicator "Trend Ribbon"pane: priceinput fast = 20input slow = 50fast_line = ema(close, fast)slow_line = ema(close, slow)export up = fast_line > slow_lineexport strength = (fast_line - slow_line) / atr(14)plot fast_line as fast, color: if up then green else redplot slow_line as slow, color: grayRun 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.
on fill(order):log "filled {order.size}"on session open "new_york":log "New York is open"on exit(trade):log "{trade.tag} closed at {trade.r:0.00}R"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.
fast_line = ema(close, 20)slow_line = ema(close, 50)plot fast_line, color: if fast_line > slow_line then green else red, width: 2fill fast_line, slow_line, color: green.fade(80)profile rows: 24, range: session, side: rightdashboard position: top_right, rows: [["Trend", "{bar.direction}"]]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.
use library "Quant Toolkit" v2 as qtenum Regime: trending, ranging, volatilefn swing_strength(len: int) -> number:up = highest(high, len) - closedown = close - lowest(low, len)return (down - up) / atr(14)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.
A bar never sees a later bar. Our tests change the future and check that the past did not move.
The same script, inputs and bars give the same result, to the last digit.
A 4-hour value shows up only after its candle closes. A 5-minute rule can't peek early.
Indicators update on every bar, even inside a step that did not run. Readings are never stale.
When the test account has nothing left, the backtest ends at that bar and says so. It never reports trades made with money that was already gone.
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 does not guarantee future results.
The language is one part. The Terminal around it keeps your work, explains your results and runs the script where you choose.
How it went, what it cost and how the trades behaved, then breakdowns by the rule that opened each trade, how it ended, which confirmations agreed, side, tag and month. Drawdown, MAE and MFE, and the spread of results in R are included.
Each run is saved with the code that produced it. Bring back an earlier build and compare it with what came after, so trying an idea never costs you the last one.
Generated strategies are assembled from pieces of the language that are known to compile, then compiled and backtested. One is handed back only once it has actually traded, and the same seed gives the same script. It is a draft to study, not a recommendation.
Save a script as an .abx file. An open file carries its code. A sealed file runs on someone else's account without showing the code, yet still states its name, what it trades, its inputs and its plain-English description.
A trade exists only once your broker confirms it, and an instruction is never sent twice. After a restart the runner picks up where it left off, with open trades, their stops and half-finished setups intact.
Demo deployments fill orders under the same written execution rules as the backtest, so practice behaves the way the test did. Live prices, spread and broker execution still differ from both.
Type what you want in the editor. When it reads as a description and not as code, a Convert to AlgoBarsX button appears and writes the script for you to read and change.
Trades appear as they open and settle as they close, and the balance moves with them. If the account ran out, the replay stops where the test stopped, because nothing after that happened.
The market, the bar size and the trade size belong to the deployment, not the script. A strategy written for EURUSD on the hour can run on gold on five-minute bars by changing two fields. Demo or live is stated plainly.
Chart replay feeds bars to the same runner a live deployment uses and fills orders under the same rules, so what appears on the chart is what the script would have done.
Before you change a script that is already running, the Terminal tells you what the edit would change once it is live. The explanation comes before the change, never after.
Strategies, indicators and alerts built with AlgoBarsX show their script from the card, ready to open in the Terminal and edit. Sealed ones say so, and still show their description.
Every feature is free. Backtests are free and unlimited. You get 250 free strategy build credits every month. Credits only pay for AI: when AI builds a script for you, AI analysis, and auto-trading on outside brokers. Top up only if you want more.
Create your free accountNo. AlgoBarsX reads like a trading plan. Every script is also turned back into plain English, so you can check it says what you meant. Or let the AI write it for you.
No, and you should not expect them to. Backtests are hypothetical. They use past prices and leave out spread, fees, swaps and slippage. Past performance does not guarantee future results.
No. AlgoBars is software, not a broker. It connects to your own account at a supported broker. We never hold, manage or touch your money. We do not give financial, investment or trading advice.
Yes. Bring Pine Script, MQL4 and MQL5, NinjaScript, EasyLanguage, thinkScript or Python. Each line is marked: copied exactly, changed with a note, or left for you to decide.
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.
$0 a month, with every feature unlocked. You get 250 free strategy build credits every month. Writing, importing and testing your own scripts is free. Credits only pay for AI use, including auto-trading on outside brokers. No credit card needed. Not a trial.
The checker, backtester and importer are built and covered by 678 automated tests. While AlgoBarsX is in beta, some features may still change.
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.
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.
Open the Terminal. Paste a script or pick one of 61 examples. Read back exactly what it does.
Create your free account $0 a month · Free unlimited backtests · No credit card Trading involves significant risk of loss and is not suitable for everyone.