Join waitlist
Strategies / Trend / KAMA Trend Filter With ATR Stop

KAMA Trend Filter With ATR Stop

The system buys when KAMA is rising, price is above SMA(200) and RSI(14) is above 50, and sells the long when KAMA is falling, price is below SMA(200) and RSI(14) is below 50. A stop sits 2.5 times ATR(14) from entry.

TrendLong onlySwingUSD/JPYDaily
3.91Profit factor
1,285,800Net profit USD
0.57%Win rate
1,935Trades
-281,260Max drawdown
665Avg trade

Best run of 41. USD/JPY, Daily, spread 1, from run pf:2026-10-10-USDJPY-D.tsv:1.

Entry rules, long

  1. The close is above the 200-period simple moving average.
  2. RSI(14) is above 50.
  3. No long position is already open.

Exit rules

  1. That exit also requires the close below the 200-period SMA and RSI(14) below 50.
  2. A protective stop sits 2.5 times ATR(14) from the fill price.

Test conditions

PeriodUp to 2026-10-10
InstrumentUSD/JPY, Daily
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily3.91 1,9350.571,285,800 USD-281,260
Nasdaq 10030 min1.35 1,45524.4718,041 EUR-4,052
S&P 50030 min1.26 1,46025.213,392 EUR-658
Nikkei 225Dailyn/a 6933.3362,406 USD-12,202
Nikkei 22530 minn/a 1,46523.0033,377 USD-11,676
Nikkei 2254 hoursn/a 18629.0333,019 USD-10,611
Silver4 hoursn/a 20625.2429,269 USD-25,041
Nikkei 2251 hourn/a 73325.5125,503 USD-16,369
Dow JonesDailyn/a 9334.4125,288 EUR-7,652
Nasdaq 100Dailyn/a 7639.4724,223 EUR-3,806
Nikkei 2255 minn/a 1,52221.6817,473 USD-11,108
Nikkei 22510 minn/a 1,53021.4416,172 USD-11,903
Nasdaq 1004 hoursn/a 23231.4714,644 EUR-4,959
DAX 40Dailyn/a 10629.2513,211 EUR-5,535
Dow Jones1 hourn/a 28726.1313,020 EUR-6,260
Nikkei 2252 minn/a 1,59520.8812,938 USD-8,424
Nasdaq 1001 hourn/a 96623.6012,554 EUR-5,504
Nasdaq 10015 minn/a 1,44424.5212,390 EUR-3,497
DAX 4030 minn/a 1,47623.7811,770 EUR-4,743
Dow Jones30 minn/a 58424.8311,513 EUR-6,081
DAX 404 hoursn/a 22131.6710,925 EUR-3,217
DAX 401 hourn/a 85026.1210,154 EUR-3,748
Dow Jones4 hoursn/a 7342.479,746 EUR-5,548
US Crude OilDailyn/a 8626.746,596 EUR-6,356
Nasdaq 1005 minn/a 1,49921.956,160 EUR-3,043
S&P 500Dailyn/a 9038.895,821 EUR-935
Nasdaq 1003 minn/a 1,44722.465,328 EUR-3,363
Nasdaq 10010 minn/a 1,47721.064,382 EUR-3,336
GoldDailyn/a 8525.883,871 EUR-1,260
Gold1 hourn/a 83224.762,988 EUR-1,101
S&P 5001 hourn/a 89927.472,917 EUR-797
S&P 5004 hoursn/a 23730.382,856 EUR-728
Gold30 minn/a 1,39724.052,068 EUR-1,453
Gold4 hoursn/a 23323.181,750 EUR-1,667
Gold5 minn/a 1,53221.611,715 EUR-634
S&P 50015 minn/a 1,46722.841,576 EUR-650
Gold15 minn/a 1,53920.011,383 EUR-826
Gold3 minn/a 1,51421.931,287 EUR-661
Gold10 minn/a 1,55620.311,105 EUR-806
S&P 50010 minn/a 1,49921.95920 EUR-676
Gold2 minn/a 1,52722.07804 EUR-625

Charts

Results by run

Top 10 of 41 runs. The full list is in the table above.

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// KAMA Trend Filter With ATR Stop
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE kama = 0

fastest = 2 / (5 + 1)
slowest = 2 / (50 + 1)

39 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

KAMAATRRSISMA
Longer historyRe-run on up to 1,000,000 barsUSD/JPY · Daily · older data 0.00 USD

USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.

USD/JPY · Daily

Bars available12,000
Net, standard 200,000-bar run1,285,800.00 USD
Net, long run1,285,800.00 USD
Net on the older data alone0.00 USD
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run KAMA Trend Filter With ATR Stop in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 41 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 3.91 over 1,935 trades.

How large was the drawdown?

The best run had a maximum drawdown of 281,260 USD at the tested position size, against a net result of 1,285,800 USD.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

EMA 8 21 RSI Filtered Bracket

Best run on the same market, USD/JPY.

1.09 PF · 6,194 trades

Trend Filtered RSI Cross

Also a trend strategy.

3.93 PF · 272 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs