Hi, I modified prorealtime gapdetection indicator to a simple strategy basis for a long position.
Only 1 or 2 parameters and it gives interesting results with a simple stop of 1% for intraday or for daily a stop of 3%
the parameter has very small range i.e. 1-14 to optimise.
some stock/futures 5 min with 50.000 units backtest
p=1 unilever 81.89 % profitable with win/loss 1.8 in 497 trades.
p=1 tkh 71.67 % profitable with win/loss 1.54 473 trades
p=1 heineken 82,46% profitable with win/loss 1.48 496 trades
p=5 aex 5 min 84.44% profitable with win/loss 1.65 270 trades
Have a look and maybe it’s interesting enough to dig further !
//Strategy: GapCatcherLong
DEFPARAM CUMULATEORDERS = false
DEFPARAM PRELOADBARS = 1000
//DEFPARAM FLATBEFORE = 100000
//DEFPARAM FLATAFTER = 200000
//lasttime = 235900
//begintime = 000000
//endtime = 210000
Amplitude = 0
Detector = 0
p=5
// buy criteria
if close < dclose(p) then
if (abs((high-low[1]) / low[1]) > Amplitude) then
detector = 1
endif
endif
// sell criteria
if close > dclose(p) then
if (abs((low-high[1]) /high[1]) > Amplitude) then
detector = -1
endif
endif
// long entry
// if time >= begintime and time<=lasttime then
if not longonmarket and detector = 1 then
buy 1 lot at market
SET STOP %LOSS 1
endif
//endif
// long exit
if longonmarket and detector = -1 then
sell at market
endif
//If time >= endtime then
//if longonmarket then
//sell at market
//elsif shortonmarket then
//exitshort at market
//endif
//endif
//If dayofweek >= 5 and hour > 17 Then
//If longonmarket Then
//Sell at market
//ElsIf shortonmarket Then
//Exitshort at market
//EndIf
//EndIf
GRAPH detector coloured(300,0,0) AS "detector" //noting
GRAPH (positionperf*100) coloured(0,0,0,255) AS "PositionPerformance"