# Bring your EasyLanguage scripts. Keep your work.

> You have spent years on your EasyLanguage scripts. You should not have to start again. Paste one in, and AlgoBarsX rewrites it and tells you what it did to every line.

Source: https://algobarsx.com/convert/easylanguage/

## A real example.

A real run of the importer (6 lines: 3 exact, 3 adapted, 1 your call).

```
Inputs: FastLen(20), SlowLen(50);
Variables: FastAvg(0), SlowAvg(0);
FastAvg = XAverage(Close, FastLen);
SlowAvg = XAverage(Close, SlowLen);
If FastAvg crosses over SlowAvg then Buy next bar at market;
If FastAvg crosses under SlowAvg then Sell next bar at market;
```

becomes

```algobarsx
strategy "Imported EasyLanguage strategy"
    market: EURUSD
    bars: 1h

input FastLen = 20
input SlowLen = 50

state FastAvg = 0
state SlowAvg = 0

FastAvg = ema(close, FastLen)
SlowAvg = ema(close, SlowLen)

when crosses_above(FastAvg, SlowAvg):
    buy size: 1 lot

when crosses_below(FastAvg, SlowAvg):
    close_all side: long
```

- Exact: `FastAvg = XAverage ( Close , FastLen ) ;` — a calculation carried over
- Exact: `SlowAvg = XAverage ( Close , SlowLen ) ;` — a calculation carried over
- Exact: `Buy next bar at market ;` — an order at market carried over
- Adapted: `If FastAvg crosses over SlowAvg then Buy next bar at market ` — a condition that places orders became a rule
- Adapted: `Sell next bar at market ;` — sell closed the open position, which became close_all on that side
- Adapted: `If FastAvg crosses under SlowAvg then Sell next bar at marke` — a condition that places orders became a rule
- Your call: `the script header` — EasyLanguage carries no market or bar size, so EURUSD on 1h was filled in: set the ones you want

## How the ideas translate.

| In EasyLanguage | In AlgoBarsX |
| --- | --- |
| `Inputs: FastLen(20);` | input FastLen = 20 |
| `Variables: FastAvg(0);` | state FastAvg = 0 |
| `XAverage(Close, FastLen)` | ema(close, FastLen) |
| `Average, WAverage` | sma, wma |
| `If a crosses over b then …` | when crosses_above(a, b): |
| `Buy next bar at market;` | buy. Market orders already fill at the next bar's open. |
| `Sell next bar at market;` | close_all side: long |
| `CurrentBar` | bar.index |

EasyLanguage variables become `state` values. Where one is simply recalculated every bar, you can delete the `state` line and keep the assignment.

## How to move a script.

1. **Paste or upload** Open the Terminal, choose Import, and paste your code or pick the file.
2. **Read every note** Each line is marked exact, adapted, or your call. Settle every “your call” before you go on.
3. **Read it back, then test** Check the plain-English description against what your old script did. Then run a test.

## What you gain.

- **It reads itself back** The compiler writes out what the script does in plain English.
- **Units are real** Percent, pips, R and money are types. Mix-ups are caught before anything runs.
- **One script everywhere** The same file draws, tests, alerts and trades.

> **Always read an import before you run it.** No converter is perfect, and some shapes of code import better than others. Other platforms leave things unsaid that AlgoBarsX makes you state, such as the market, the bar size and the trade size. Compare the plain-English description with what your old script did, and test before you deploy.

## Good questions.

**Will every script convert cleanly?** No. Simple, common shapes convert best. An import that does not compile says so, and every changed line carries a note. Always read the result.

**Do I lose my original?** No. Your old script is untouched. Lines that needed a choice keep the original as a comment.

**Is it free?** AlgoBars is $0 a month with no card. 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. Backtests are hypothetical and leave out spread, fees, swaps and slippage. AlgoBarsX is in beta.
