Wilko

As simple as it gets: EURUSD 2h ATR strength

Category: Strategies By: Wilko Created: October 5, 2017, 5:21 PM
October 5, 2017, 5:21 PM
Strategies
15 Comments
As simple as it gets: EURUSD 2h ATR strength

This is a really simple system in its base form. It has no filters or money management. I submit it only to show what can be done with VERY simple entry & exit rules. I’m pretty sure this could be developed further into an implementable system.

The basis is EUR/USD on 2h timeframe. It might work on other assets, I haven’t tried yet.

The system will initiate a long if there is a green body exceeding ATR(20)*2. It will exit the long on another green body exceeding ATR(20)*2, or on the 9th bar after entry, or if a short position is initiated.

The system will initiate a short if there is a red body exceeding ATR(20)*2. It will exit the short on another red body exceeding ATR(20))*2, or on the 9th bar after entry, or if a long position is initiated.

There you go, as simple as that. Good luck with your adaptations!

ATR = AverageTrueRange[14](close)

LongEntry = close - open > ATR * 2
LongExit = close - open > ATR * 2 OR BarIndex = TradeIndex + 8

ShortEntry = open - close > ATR * 2
ShortExit = open - close > ATR * 2 OR BarIndex = TradeIndex + 8

Maxpos = 1

// Conditions to enter long positions
IF CountOfLongShares < MaxPos AND LongEntry THEN
 BUY 1 CONTRACTS AT MARKET
ENDIF

// Conditions to exit long positions
If LongOnMarket AND LongExit THEN
 SELL AT MARKET
ENDIF

// Conditions to enter short positions
IF CountOfShortShares < MaxPos AND ShortEntry THEN
 SELLSHORT 1 CONTRACTS AT MARKET
ENDIF

// Conditions to exit short positions
IF ShortOnMarket AND ShortExit THEN
 EXITSHORT AT MARKET
ENDIF

 

Download
Filename: ATR-strength.itf
Downloads: 972
Wilko
Wilko Senior
As an architect of digital worlds, my own description remains a mystery. Think of me as an undeclared variable, existing somewhere in the code.
Author’s Profile

Comments

phanz
5 years ago
#

Hi all, Sorry revisiting an old post. This algo is simple, and simplicity is the ultimate sophistication. I am wondering if anyone has any adaptation of this strategy? I tried putting a bid on retracement instead of buying straight away at the next candle's opening. But because this strategy is momentum, pull back is shallow and missing key opportunities. If anyone has more thoughts on this, will appreciate if you can share. Tks.

JR1976
8 years ago
#

Simple and nice code , congrats !!! Seems work well with TIme frame 1 h

JanWd
9 years ago
#

Tried the code, nice concept, seems to work quit well for US/EUR 2hrs, Other markets seems not to fit very well, at least to what I tried.

Wilko
9 years ago
#

In answer to SAM: The Logic of the cover clause containing the same logic as the entry-clause is simply to hold the position until such time that another impulse (=1-bar movement larger than the ATR-hurdle) causes the system to exit. This idea came from watching the charts.

Wilko
9 years ago
#

In the IF-clause containing the BUY or SELLSHORT instruction you could add a line containing SET STOP..... etc.

Ricx
9 years ago
#

There is no SL to this system, right? If I want to add one, how would I add it?

Wilko
9 years ago
#

Hi Sam, Thank you for the comment. I ageee completely and do not find your question trivial. Please allow me to check the code and come back with an answer. I can spontaneously say that this is not the same as codes I have implemented (yes, I do run variations on this idea live on several markets). Let me have a look and revert with an explanation. Kind regards, Fredrik

SAM
SAM
9 years ago
#

Hy, thank-you for share-it... Ex-cuse me for the trivial question, I understood the condition LognEntry ,but why the condition "close -open>ATR*2 " is also in the condition "LongExit" ? thank-you Close - Open is the thame as LognEntry?

Francesco78
9 years ago
#

Great system, I love its simplicity. Thank you.

Wilko
9 years ago
#

Enjoy!

Wilko
9 years ago
#

If I remember correctly, best backtest results were achieved with ATR(21). Slightly worse with 14, but not materially

victormork
9 years ago
#

Thanks!

victormork
9 years ago
#

How does the backtest change with AverageTrueRange[14](close)? Better, worse, unchanged?

Inertia
9 years ago
#

Wilko
9 years ago
#

Just a quick note. The first line should read AverageTrueRange[20](close), not [14]

ProRealCode ProRealCode
Loading...