deleted_account

3 bars patterns - DAX intraday trading 1 hour

Category: Strategies By: deleted_account Created: April 18, 2017, 1:33 PM
April 18, 2017, 1:33 PM
Strategies
12 Comments
3 bars patterns - DAX intraday trading 1 hour

Simple 1H strategy on DAX (1EUR)
The aim of this strategy is to take a position after a succession of 3 consecutive candles of the same color. Strict hourly conditions allow the strategy to enter into position only at predetermined fixed times:

  • buy orders only at 12:00
  • sell orders only at 16:00

Trades are automatically closed at the end of the day.
 

// DAX (1E) - IG MARKETS
// TIME FRAME 1H
// SPREAD 2.0 PIPS

DEFPARAM CumulateOrders = False
DEFPARAM FLATBEFORE = 100000
DEFPARAM FLATAFTER = 210000

// LONG
IF (time = 120000 and close > open and close[1] > open[1] and close[2] > open[2]) THEN
 BUY 1 CONTRACTS AT MARKET
 SET STOP pLoss 30
 SET TARGET pPROFIT 45
ENDIF

// SHORT
IF (time = 160000 and close < open and close[1] < open[1] and close[2] < open[2]) THEN
 SELLSHORT 1 CONTRACTS AT MARKET
 SET STOP pLoss 30
 SET TARGET pPROFIT 45
ENDIF

 

Download
Filename: 3-bars-patterns-DAX.itf
Downloads: 499
deleted_account
deleted_account New
Currently debugging life, so my bio is on hold. Check back after the next commit for an update.
Author’s Profile

Comments

bjoern
9 years ago
#

Oh ok, with the initial posted parameters it is positive

victormork
9 years ago
#

btw this strategy has an edge on Bund 1h as well

bjoern
9 years ago
#

With the same parameters? For me the results are negative

victormork
9 years ago
#

yes! It's not like you want to put it on live but when I for example take the version I have for DAX and put it on Bund without changing any values it's still holding up pretty good which is always nice to see :)

bjoern
9 years ago
#

Added a range filter for entering positions. Performance seems to be much better, even with tick-by-tick data.

// DAX (1E) - IG MARKETS
// TIME FRAME 1H
// SPREAD 2.0 PIPS

DEFPARAM CumulateOrders = False
DEFPARAM FLATBEFORE = 100000
DEFPARAM FLATAFTER = 210000

sum = abs(open-close)+abs(open[1]-close[1])+abs(open[2]-close[2])

// LONG
IF (time = 120000 and close > open and close[1] > open[1] and close[2] > open[2] and sum > 40 and sum < 220) THEN
BUY 1 CONTRACTS AT MARKET
SET STOP pLOSS 100
SET TARGET pPROFIT 200
ENDIF

// SHORT
IF (time = 130000 and close < open and close[1] < open[1] and close[2] < open[2] and sum > 40 and sum < 220) THEN
SELLSHORT 1 CONTRACTS AT MARKET
SET STOP pLOSS 100
SET TARGET pPROFIT 200
ENDIF

 

Nicolas
9 years ago
#

Thanks!

manel
9 years ago
#

Hi bjoern. Many thanks for posting the attached strategy. I would however point out that the results shown include "zero bar" trades so will not be as reliable. Upon using tick by tick backtesting the overall profit is reduced by around 20%. This means that the strategy is still positive so looks promising and is probably worthy of more work and refinement.

Kind Regards 

bjoern
9 years ago
#

You are absolutely right, thank for your comment. Already working on an optimization while using tick-by-tick data

victormork
9 years ago
#

Alright. Anyway I like the simplicity of your code!

bjoern
9 years ago
#

Thanks!!!

 

victormork
9 years ago
#

Hi! I don't have as much history as you do but what about adding a moving average to the code? Improves the return the last 4 years.

// LONG
IF (time = 120000 and close > open and close[1] > open[1] and close[2] > open[2]and close > average[100]) THEN
BUY 1 CONTRACTS AT MARKET
SET STOP pLoss 40
SET TARGET pPROFIT 50
ENDIF

// SHORT
IF (time = 160000 and close < open and close[1] < open[1] and close[2] < open[2] and close < average[100]) THEN
SELLSHORT 1 CONTRACTS AT MARKET
SET STOP pLoss 40
SET TARGET pPROFIT 50
ENDIF

 

bjoern
9 years ago
#

Thanks for commenting! In general I try to avoid using moving averages, but yes, performance is slightly better!

ProRealCode ProRealCode
Loading...