# AlgoBarsX: write your trading rules in plain words

> AlgoBarsX is a simple coding language for traders, made by AlgoBars. You type a rule. It reads the rule back to you in plain English. Then you test it on past prices. It is free: $0 a month, no card needed, not a trial.

Source: https://algobarsx.com/

## What a rule looks like

```algobarsx
strategy "My First Rule"
    market: EURUSD
    bars: 15m

when crosses_above(ema(close, 20), ema(close, 50)):
    buy risk: 1%, stop: 25 pips, target: 2R
```

The compiler reads it back: "When the 20-bar EMA of the close crosses above the 50-bar EMA of the close, 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."

## Three steps

1. Write a rule. Type it yourself, or write what you want in plain English and press Convert to AlgoBarsX.
2. Read it back. AlgoBarsX turns your code into plain English. If the words are wrong, the code is wrong.
3. Test it, then run it. See how the rule did on past prices, watch the test play back trade by trade, then run the same script on a demo or live account.

## What you can build

Strategies, indicators, alerts, dashboards, risk tools and shared libraries, all in the same language. There are 137 built-in functions, 61 example scripts, 24 written rules for how orders fill, and 678 tests the language must pass.

## It catches mistakes before they run

The compiler checks names, types and units. Example: `stop: 25` gives the message "stop 25 has no unit. Did you mean 25 pips?" with one-click fixes.

## Bring your old scripts

Paste code from Pine Script, MQL4 and MQL5, NinjaScript, EasyLanguage, thinkScript or Python. AlgoBarsX rewrites it and gives a note on every line. Always read the result before you use it.

## Tests that do not cheat

- No peeking ahead. A rule can never see a future price.
- Same answer every time. Same script, same data, same result.
- When unsure, the stop wins. If one bar hits both the stop and the target and the data cannot show which came first, the test counts the stop.
- When the money is gone, the test stops.
- Tests do not include spread, fees, swaps or slippage. Real results will be different. A good test does not mean you will make money.

## Price

$0 a month. Every feature is open. 250 AI credits each month. Credits pay for AI, tests and auto trades.

## Important

Trading is risky and you can lose money. AlgoBars is software, not a broker or an adviser. It never holds your money and does not give advice. You must be 18 or older. AlgoBarsX is in beta.

## Learn more

- [Documentation](https://algobarsx.com/docs/) and the [list of every page for AI assistants](https://algobarsx.com/llms.txt)
- [Your first strategy](https://algobarsx.com/docs/first-strategy/index.md)
- [The cheat sheet](https://algobarsx.com/docs/cheat-sheet/index.md)
- [Create a free account](https://algobars.com/signup)
