Hi,
attached a simple DOW breakout strategy. It works fine in the last 2 years. But i think it would be more profitable to add one or 2 variables into ist. But i don´t want to over-fitting this strategy, i want to keep it simple. Only the lots of loosers in a row are negetive. It needs a 2nd variable. New ideas are welcome. 🙂
TF 15m / 1€ pipsize
DEFPARAM CumulateOrders = true // Kumulieren von Positionen deaktiviert
// referenzzeit
refstartzeit=153000
refendzeit = 154500
offset=15
entry= 154500
lastentry=160000
feierabend=2200000
takeprofit=1000
stoploss=175
pos=1
if time = refstartzeit then
reflow = Low
lowlimit = reflow - offset
refhigh = High
highlimit = refhigh + offset
inmarket = 0
c1 = 0
c2 = 0
endif
if time > refstartzeit and time <= refendzeit then
if reflow > Low[0] then
reflow = Low
lowlimit = reflow - offset
endif
if refhigh < High[0] then
refhigh = High[0]
highlimit = refhigh + offset
endif
endif
//graph refhigh as "ref hoch"
//graph reflow as "ref tief"
//graph highlimit as "trigger long"
//graph lowlimit as "trigger short"
// graph c1 as "entrylong"
// graph c2 as "entryshort"
// Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
timeEnterBefore = time >= entry
// Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen nach einer bestimmten Uhrzeit
timeEnterAfter = time <= lastentry
// Verhindert das Trading an bestimmten Wochentagen
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
if inmarket = 0 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry then
if high > highlimit then
c1 = high
endif
IF c1 <> 0 THEN
BUY pos CONTRACT AT MARKET
inmarket = 1
ENDIF
if low < lowlimit then
c2 = low
endif
IF c2 and inmarket = 0 THEN
SELLSHORT pos CONTRACT AT MARKET
inmarket = 1
ENDIF
if inmarket = 1 then
// Stops und Targets
SET STOP pLOSS stoploss
SET TARGET pPROFIT takeprofit
endif
elsif time >= feierabend then
sell at market
exitshort at market
endif
Sry for my simple school-english. 🙂
Thanks for the strategy!
I think you have too many zeros in line 9: feierabend=2200000…
PaulParticipant
Master
Hi
I’ve adjusted your code into my layout. The results break completely if I use reentry as a basic test. Have to look into that a bit more, maybe bugged? So it’s off.
btw I wondered if the short criteria is handled well for c2 because c2 is untested. I used % (in pic 1% stoploss)
Anyway got some reasonable results with this for 100k, not for 200k bars. Here’s a pic. I will post the code later.
Hi Paul,
thx for your advise. In 200k looks realy not so good, maybe its possible to pimp it a little bit. The basic code was very simple.
& long/short pic + code
Weird … I don’t get any short trades over 100k bars??
PaulParticipant
Master
that’s probably because tradetype=2 and need to be set to 1
EricParticipant
Master
Why this big take profit 1 000 points (almost 4%)?
Cant be often that happens “in hours”?
PaulParticipant
Master
I prefer percentage instead of points, especially when markets once were much higher or lower.
if using cumulate orders = false and you copy this below (made little change) you see how many days a position is in market.
// display days in market
once displaydim =1 // displays the number of days in market (activated graph)
once maxdim =999 // maximum days in market
if displaydim then
if not onmarket then
dim=0
else
if onmarket and not onmarket[1] or (longonmarket and shortonmarket[1]) or (shortonmarket and longonmarket[1]) then
dim=1
endif
endif
if not opendayofweek=0 then
if onmarket then
if openday <> openday[1] then
dim = dim + 1
endif
endif
endif
if onmarket and dim>=maxdim then
sell at market
exitshort at market
endif
graph dim // display days in market
endif
Why this big take profit 1 000 points (almost 4%)?
Cant be often that happens “in hours”?
The idea behind this stragedy was, to let the trend run. And the best profit in the last 2 years was 1000 points, 11 times in 2020. The actual entry of 9/1 is now 640 points in front.