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:
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
You must be logged in to post a comment.
btw this strategy has an edge on Bund 1h as well
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 :)
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
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
Alright. Anyway I like the simplicity of your code!
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
Oh ok, with the initial posted parameters it is positive