DMI Trend Filter
DMI Trend Filter is a strategy that trades EURJPY on 1-hour bars. It holds at most 1 open trade and reverses on an opposite signal.
core language
strategy "DMI Trend Filter"market: EURJPYbars: 1hmax_open: 1opposite: reverseinput adx_floor = 25d = dmi(14)trending = d.adx > adx_floorwhen trending and crosses_above(d.plus, d.minus):buy risk: 1%, stop: psar(), target: 3Rwhen trending and crosses_above(d.minus, d.plus):sell risk: 1%, stop: psar(), target: 3Rplot psar(), style: circles, color: yellowDMI Trend Filter is a strategy that trades EURJPY on 1-hour bars. It holds at most 1 open trade and reverses on an opposite signal.
You can change one input: adx_floor (default 25).
It calculates d as the directional movement (length 14) and trending as whether d.adx is above adx_floor.
When trending and d.plus crosses above d.minus, it buys at market, risking 1% of the balance, with a stop at the parabolic SAR and with a target 3R from the entry.
When trending and d.minus crosses above d.plus, it sells at market, risking 1% of the balance, with a stop at the parabolic SAR and with a target 3R from the entry.
On the chart, it plots the parabolic SAR.