Coming from EasyLanguage

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

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

What you paste · EasyLanguage
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;
What you get back
1strategy "Imported EasyLanguage strategy"
2market: EURUSD
3bars: 1h
4
5input FastLen = 20
6input SlowLen = 50
7
8state FastAvg = 0
9state SlowAvg = 0
10
11FastAvg = ema(close, FastLen)
12SlowAvg = ema(close, SlowLen)
13
14when crosses_above(FastAvg, SlowAvg):
15buy size: 1 lot
16
17when crosses_below(FastAvg, SlowAvg):
18close_all side: long

Line by line

StatusYour lineWhat happened
ExactFastAvg = XAverage ( Close , FastLen ) ;a calculation carried over
ExactSlowAvg = XAverage ( Close , SlowLen ) ;a calculation carried over
ExactBuy next bar at market ;an order at market carried over
AdaptedIf FastAvg crosses over SlowAvg then Buy next bar at market ;a condition that places orders became a rule
AdaptedSell next bar at market ;sell closed the open position, which became close_all on that side
AdaptedIf FastAvg crosses under SlowAvg then Sell next bar at market ;a condition that places orders became a rule
Your callthe script headerEasyLanguage carries no market or bar size, so EURUSD on 1h was filled in: set the ones you want

How the ideas translate

In EasyLanguageIn AlgoBarsX
Inputs: FastLen(20);input FastLen = 20
Variables: FastAvg(0);state FastAvg = 0
XAverage(Close, FastLen)ema(close, FastLen)
Average, WAveragesma, 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
CurrentBarbar.index
Tip. EasyLanguage variables become state values. Where one is simply recalculated every bar, you can delete the state line and keep the assignment.

Names the importer translates for you

Their nameAlgoBarsX
averagesma
xaverageema
waveragewma
stddevstdev
standarddevstdev
truerangetrue_range
avgtruerangeatr
absvalueabs
maxlistmax
minlistmin
squarerootsqrt
expvalueexp
powerpow
ceilingceil
linearregvaluelinreg
cclose
oopen
hhigh
llow
vvolume
currentbarbar.index
barnumberbar.index
pi3.14159265
rangebar.range
avgpriceohlc4
medianpricehl2
typicalpricehlc3
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.

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account