Coming from Python
A real import, the ideas side by side, and the names that translate.
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.
import pandas_ta as tadf["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)1
indicator "Imported Python script"2
pane: price3
4
fast = ema(close, 20)5
slow = ema(close, 50)6
rsi_value = rsi(close, 14)7
long = fast > slow and rsi_value < 70Line 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 |
natr | atr |
willr | 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.