EMA Cross

EMA Cross is a strategy that trades EURUSD on 15-minute bars.

core language

ema-cross.abx
1strategy "EMA Cross"
2market: EURUSD
3bars: 15m
4
5input fast = 20
6input slow = 50
7
8when crosses_above(ema(close, fast), ema(close, slow)):
9buy risk: 1%, stop: 25 pips, target: 2R
10
11when crosses_below(ema(close, fast), ema(close, slow)):
12close_all
Watch it run · EURUSD · 15m bars
entrystoptargetexit

Sample data. Not a result. The real AlgoBarsX engine ran this exact script on made-up bars, and this replays what it drew and did. It shows no profit or loss, and it says nothing about how the script would do in a real market.

Replay of this script on 150 sample bars: 1 trade.

What this script says

EMA Cross is a strategy that trades EURUSD on 15-minute bars.

You can change 2 inputs: fast (default 20) and slow (default 50).

When the EMA of the close over fast bars crosses above the EMA of the close over slow bars, it buys at market, risking 1% of the balance, with a stop 25 pips from the entry and with a target 2R from the entry.

When the EMA of the close over fast bars crosses below the EMA of the close over slow bars, it closes all trades.

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

Create my free account