# Coming from Python

> A real import, the ideas side by side, and the names that translate.

Source: https://algobarsx.com/docs/from-python/

This is a real run of the importer on a small Python script. The result compiles. 5 lines were read: 4 carried over exactly, 1 were adapted and 0 came back as decisions for you.

```algobarsx
import pandas_ta as ta

df["fast"] = ta.ema(df["close"], length=20)
df["slow"] = ta.ema(df["close"], length=50)
df["rsi"] = ta.rsi(df["close"], length=14)
df["long"] = (df["fast"] > df["slow"]) & (df["rsi"] < 70)
```

```algobarsx
indicator "Imported Python script"
    pane: price

fast = ema(close, 20)
slow = ema(close, 50)
rsi_value = rsi(close, 14)
long = fast > slow and rsi_value < 70
```

## Line by line

| Status | Your line | What happened |
| --- | --- | --- |
| Exact | `df["fast"] = ta.ema(df["close"], length=20)` | a calculation carried over |
| Exact | `df["slow"] = ta.ema(df["close"], length=50)` | a calculation carried over |
| Adapted | `df["rsi"] = ta.rsi(df["close"], length=14)` | rsi is the name of a built-in here, so it became rsi_value |
| Exact | `df["rsi"] = ta.rsi(df["close"], length=14)` | a calculation carried over |
| Exact | `df["long"] = (df["fast"] > df["slow"]) & (df["rsi"] < 70)` | a calculation carried over |

## How the ideas translate

| In Python | In AlgoBarsX |
| --- | --- |
| `df["fast"] = ta.ema(df["close"], length=20)` | fast = ema(close, 20) |
| `ta.rsi(df["close"], length=14)` | rsi(close, 14) |
| `(a > b) & (c < 70)` | a > b and c < 70 |
| `a column named rsi` | renamed to rsi_value, so it does not hide the function |
| `df["close"].shift(1)` | close[1] |
| `df["high"].rolling(20).max()` | highest(high, 20). Rolling calculations come back as a decision, so you pick the function. |

> **Tip.** A data-frame script has no orders in it, so it comes back as an indicator. Add `when` rules to turn it into a strategy.

## Names the importer translates for you

| Their name | AlgoBarsX |
| --- | --- |
| `mom` | [`momentum`](https://algobarsx.com/docs/ref-fn-momentum/#ref-momentum) |
| `natr` | [`atr`](https://algobarsx.com/docs/ref-fn-volatility/#ref-atr) |
| `willr` | [`williams_r`](https://algobarsx.com/docs/ref-fn-momentum/#ref-williams-r) |

> **Read every import before you run it.** Compare the plain-English description with what your original did, settle each decision, and backtest before you deploy.
