EricParticipant
Master
I dont know if this is the first version (DAX 4 Hours)
but it seems to work on 1 hour
and maybe with the new walk forward test it can be even better? (200K history)
its the original version i have only change the min lotsize (positionsize) from 10 to 1 contract
// Pathfinder DAX 4H, 8-22, 2 points spread
// DAX breakout system triggered by daily, weekly and monthly high/low crossings
// code-parameter
DEFPARAM CUMULATEORDERS = true
// trading window
ONCE StartTime = 80000
ONCE EndTime = 220000
// money management
ONCE PositionSize = 1
// trading parameter
ONCE sl = 3
ONCE tp = 1.5
// calculate weekly high/low
If DayOfWeek < DayOfWeek[1] then
weeklyHigh = Highest[BarIndex - lastWeekBarIndex](DHigh(1))
lastWeekBarIndex = BarIndex
ENDIF
// calculate monthly high/low
If Month <> Month[1] then
monthlyHigh = Highest[BarIndex - lastMonthBarIndex](DHigh(1))
monthlyLow = Lowest[BarIndex - lastMonthBarIndex](DLow(1))
lastMonthBarIndex = BarIndex
ENDIF
// calculate signalline with multiple smoothed averages
firstMA = WilderAverage[5](close)
secondMA = TimeSeriesAverage[10](firstMA)
signalline = TimeSeriesAverage[5](secondMA)
// position management during trading window
IF Time >= StartTime AND Time <= EndTime THEN
// filter criteria because not every break is profitable
c1 = close > Average[200](close)
c2 = close < Average[200](close)
c3 = close > Average[50](close)
c4 = close < Average[50](close)
// long position conditions
l1 = signalline CROSSES OVER monthlyHigh
l2 = signalline CROSSES OVER weeklyHigh
l3 = signalline CROSSES OVER DHigh(1)
l4 = signalline CROSSES OVER monthlyLow
// long entry
IF ( l1 OR l4 OR l2 OR (l3 AND c2) ) THEN // cumulate orders for long trades could be a performance booster
BUY PositionSize CONTRACT AT MARKET
ENDIF
// short position conditions
s1 = signalline CROSSES UNDER monthlyHigh
s2 = signalline CROSSES UNDER monthlyLow
s3 = signalline CROSSES UNDER Dlow(1)
// short entry
IF NOT SHORTONMARKET AND ( (s1 AND c3) OR (s2 AND c4) OR (s3 AND c1) ) THEN // no cumulation for short trades
SELLSHORT PositionSize CONTRACT AT MARKET
ENDIF
// stop and profit
SET STOP %LOSS sl
SET TARGET %PROFIT tp
ENDIF
I also want to adapt pathfinfed system with shorter timeframe. At the end i’d like to code an intraday system or at least close all trade friday evenining. But now, results with original system is better.
EricParticipant
Master
another thing
on demo it was 2 trades open but only one closed with profit at 12 250 (one still open)
on backtest both closed at 12 248
My live account had a simular dd. -455000 on Hangseng. In reality it was +10´……..
EricParticipant
Master
Second long closed on demo at 12 349 and backtest flat since 12 248
Profit since 24/3
Demo + 306 E
Backtest + 209 E