Hello everyone,
Here is a small breakout strategy.
Here, I tested with the following settings:
– Range (channel) defined between 09H at 9H30
– On the DAX, 15 minute timeframe
– We play the breakout of high / low of the range
– Stop Loss: the other side of the range
– Take Profit: equal to the stop loss
As you can see, the code is simple.
The backtest is positive, even if it is not optimal.
Indeed, the max drawdown of € 6,548 (for an initial bet of € 10,000), for a capital gain of 51.80% per year. is too high.
We can decrease the contract size by 2 (max drawdown of € 3,274 for a capital gain of 25.90% per year), but the capital growth curve is still quite irregular.
However, this strategy seems logical and reliable, so I think there is much way to improve it.
It also works on CAC40 (or may some other indices).
But paradoxically it doesn’t work well on forex (I wanted to write it for forex, in order to use it automatically).
Defparam cumulateorders = false
Defparam flatafter = 180000
n = 1
IF Time = 093000 THEN
haut = highest[2](high)
bas = lowest[2](low)
amplitude = haut - bas
achat = 0
vente = 0
ENDIF
if Time > 093000 AND Time <= 180000 THEN
IF achat = 0 THEN
buy n share at haut stop
ENDIF
IF vente = 0 THEN
sellshort n share at bas stop
ENDIF
ENDIF
If longonmarket THEN
achat = 1
ENDIF
IF shortonmarket THEN
vente = 1
ENDIF
set stop ploss amplitude
set target pprofit amplitude