Coming from Pine Script
A real import, the ideas side by side, and the names that translate.
This is a real run of the importer on a small Pine Script script. The result compiles. 8 lines were read: 5 carried over exactly, 2 were adapted and 2 came back as decisions for you.
//@version=5strategy("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)1
strategy "RSI Dip"2
market: EURUSD3
bars: 1h4
5
input len = 146
7
r = rsi(close, len)8
9
when crosses_above(r, 30):10
buy size: 1 lot, tag: "L"11
12
when crosses_below(r, 70):13
close_all tag: "L"14
15
plot ema(close, 200), color: orangeLine by line
| Status | Your line | What happened |
|---|---|---|
| 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 |
How the ideas translate
| In Pine Script | In AlgoBarsX |
|---|---|
strategy("RSI Dip", overlay=true) | strategy "RSI Dip" with market: and bars: stated. Pine takes both from the chart, so they come back as your decision. |
len = input.int(14, "RSI Length") | input len = 14 |
ta.rsi(close, len) | rsi(close, len) |
if cond, then strategy.entry(...) under it | when cond: with buy under it |
strategy.close("L") | close_all tag: "L" |
plot(x, color=color.orange) | plot x, color: orange |
var count = 0 | state count = 0 |
close[1] | close[1], exactly the same |
Tip. Pine does not say how big the position is, so the import uses one lot and hands the choice back to you. Replace it with
risk: 1% and a stop.Names the importer translates for you
| Their name | AlgoBarsX |
|---|---|
ta.sma | sma |
ta.ema | ema |
ta.rma | rma |
ta.wma | wma |
ta.hma | hma |
ta.vwma | vwma |
ta.dema | dema |
ta.tema | tema |
ta.rsi | rsi |
ta.cci | cci |
ta.roc | roc |
ta.mom | momentum |
ta.stdev | stdev |
ta.variance | variance |
ta.highest | highest |
ta.lowest | lowest |
ta.median | median |
ta.linreg | linreg |
ta.correlation | correlation |
ta.atr | atr |
ta.tr | true_range |
ta.mfi | mfi |
ta.obv | obv |
ta.vwap | vwap |
ta.barssince | bars_since |
ta.crossover | crosses_above |
ta.crossunder | crosses_below |
ta.cross | crosses |
ta.cum | cum |
ta.trix | trix |
ta.cmo | cmo |
math.abs | abs |
math.max | max |
math.min | min |
math.round | round |
math.floor | floor |
math.ceil | ceil |
math.sqrt | sqrt |
math.log | log |
math.exp | exp |
math.pow | pow |
math.sign | sign |
bar_index | bar.index |
syminfo.tickerid | market.symbol |
syminfo.ticker | market.symbol |
syminfo.mintick | market.point_size |
color.green | green |
color.red | red |
color.blue | blue |
color.orange | orange |
color.yellow | yellow |
color.purple | purple |
color.teal | teal |
color.gray | gray |
color.grey | gray |
color.white | white |
color.black | black |
color.lime | green |
color.maroon | red |
color.silver | gray |
color.aqua | teal |
strategy.long | long |
strategy.short | short |
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.