# Your old scripts are welcome here.

> AlgoBarsX reads six other trading languages. Paste a script, and it comes back as readable AlgoBarsX with a note on every line: exact, adapted, or your call.

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

## Pick your language.

- **From Pine Script** For scripts written for TradingView. A real example, how each idea translates, and what to check. [Convert from Pine Script](https://algobarsx.com/convert/pine-script/)
- **From MQL4 and MQL5** For scripts written for MetaTrader. A real example, how each idea translates, and what to check. [Convert from MQL4 and MQL5](https://algobarsx.com/convert/mql/)
- **From NinjaScript** For scripts written for NinjaTrader. A real example, how each idea translates, and what to check. [Convert from NinjaScript](https://algobarsx.com/convert/ninjascript/)
- **From EasyLanguage** For scripts written for TradeStation. A real example, how each idea translates, and what to check. [Convert from EasyLanguage](https://algobarsx.com/convert/easylanguage/)
- **From thinkScript** For scripts written for thinkorswim. A real example, how each idea translates, and what to check. [Convert from thinkScript](https://algobarsx.com/convert/thinkscript/)
- **From Python** For scripts written for pandas and friends. A real example, how each idea translates, and what to check. [Convert from Python](https://algobarsx.com/convert/python/)

## How it works.

1. **Paste or upload** Paste your code, or pick a file such as `.pine`, `.mq4`, `.mq5`, `.cs`, `.els` or `.py`.
2. **Get a note on every line** Exact means carried over as is. Adapted means changed, with a note saying how. Your call means a choice is handed back to you.
3. **Read it back, then test** The compiler describes the result in plain English. Compare that with what your old script did.

## See one.

A real run of the importer (8 lines: 5 exact, 2 adapted, 2 your call).

```
//@version=5
strategy("RSI Dip", overlay=true)
len = input.int(14, "RSI Length")
r = ta.rsi(close, len)
if ta.crossover(r, 30)
    strategy.entry("L", strategy.long)
if ta.crossunder(r, 70)
    strategy.close("L")
plot(ta.ema(close, 200), color=color.orange)
```

becomes

```algobarsx
strategy "RSI Dip"
    market: EURUSD
    bars: 1h

input len = 14

r = rsi(close, len)

when crosses_above(r, 30):
    buy size: 1 lot, tag: "L"

when crosses_below(r, 70):
    close_all tag: "L"

plot ema(close, 200), color: orange
```

- Exact: `strategy("RSI Dip", overlay=true)` — strategy() became the script header
- Exact: `len = input.int(14, "RSI Length")` — input() became an input
- Exact: `r = ta.rsi(close, len)` — a calculation was carried over
- Your call: `strategy.entry("L", strategy.long)` — strategy.entry() had no size of its own, so it became one lot: set the size or risk you want
- Adapted: `if ta.crossover(r, 30)` — an if that places orders became a rule
- Exact: `strategy.close("L")` — strategy.close() became close_all
- Adapted: `if ta.crossunder(r, 70)` — an if that places orders became a rule
- Exact: `plot(ta.ema(close, 200), color=color.orange)` — plot() became plot
- Your call: `strategy(...)` — Pine scripts carry no market or bar size, so EURUSD on 1h was filled in: set the ones you want

> **Always read an import before you run it.** No converter is perfect, and some shapes of code import better than others. An import that does not compile says so. Test before you deploy.

## 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.
