J.Participant
Average
I currently don’t have access to my IG demo account for some reason, but I’m pretty sure that this were not the results I was getting.
I will notify you when I gain back my access.
I applied live strategy with no partial closure this week : 1 winning deal.
Hi, i’ve turned partial closure off and slightly optimized for EURCAD and M30. Too good to be true, but i share it (running in demo mode from this morning). Indeed take care of drawdown… :
DEFPARAM CumulateOrders = False
DEFPARAM PRELOADBARS = 10000
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
Horaire = time >= 000000 and time <= 220000
PositionsizeA = 1
PositionsizeV = 1
MM = Average[56,3](totalprice)
Newhighest=max(DHigh(0), DHigh(1))
Newlowest=min(DLow(0), DLow(1))
Milieu = (Newhighest+Newlowest)/2
Surachat = average[10,4]((Newhighest+Milieu)/2)
Survente = average[10,4]((Newlowest+Milieu)/2)
CA = (MM > Surachat) and (close crosses over Milieu)
CV = (MM < Survente) and (close crosses under Milieu)
// Long Entries
IF Horaire AND CA AND not daysForbiddenEntry AND NOT SHORTONMARKET THEN
BUY PositionsizeA CONTRACTS AT MARKET
ENDIF
IF LONGONMARKET THEN
SELL AT TRADEPRICE +540*pointsize LIMIT
ENDIF
// Short Entries
IF Horaire AND CV AND not daysForbiddenEntry AND NOT LONGONMARKET THEN
SELLSHORT PositionsizeV CONTRACTS AT MARKET
ENDIF
IF SHORTONMARKET THEN
EXITSHORT AT TRADEPRICE - 50*pointsize LIMIT
ENDIF
//MFE
//trailing stop
trailingstop = 40
//resetting variables when no trades are on market
if not onmarket then
MAXPRICE = 0
MINPRICE = close
priceexit = 0
endif
//case SHORT order
if shortonmarket then
MINPRICE = MIN(MINPRICE,close) //saving the MFE of the current trade
if tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
priceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price level
endif
endif
//case LONG order
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade
if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price level
endif
endif
//exit on trailing stop price levels
if onmarket and priceexit>0 then
EXITSHORT AT priceexit STOP
SELL AT priceexit STOP
endif
//SET TARGET pPROFIT 46
SET STOP pLOSS 200
Sorry there is a mistake line 29 of my code 540 must be 50
Second week live : winning position again.
Second week live : winning position again.
How much pips ? Can you share the equity curve ?
Live report after 4 weeks :
PaulParticipant
Master
Interesting code Matriciel. I had a go with your strategy.
@juju333 eurcad is good tip!
I made some adjustments. Removed the time limit and it now basically has a big stoploss, a trailing stop and it reverses on opposite signal.
Besides that, added a trend detection system (tds) and this can be switched off if it’s too much.
Optimised is period 1,2,3. The tds filter is then optimised over the best results.
With “select” can you pick which settings you want to use. Just make sure the timeframe 15/30min matches.
Awesome Paul !
That’s really encouraging. I was wondering what spread do you use for the backtests because i don’t manage to reproduce the curves as on your screenshots.
PaulParticipant
Master
Hi, the spread is set to 1.5 for both strategies.
Bonjour,
Avez vous réussi à ajouter la stratégie dans Pro Order avec les clôtures partielles ? @Nicolas nous avons besoin de ton aide l’idée est super intéressante mais nous calons tous avec les sorties partielles pour intégrer dans pro order.
merci 🙂
Hello,
Have you managed to add the strategy in Pro Order with partial closings? @nicolas we need your help the idea is super interesting but we all stall with partial releases to integrate into pro order.
thanks
Florian Legeard – English only in the English speaking forums please. If you wish to discuss a subject in French then please use the French speaking forums.
Partial closure will come after version 11 with IG. I will know more about this by the end of next week.
Hi all,
i have just tried to backtest this strategy over the last 12 months, unfortnately, there is no single trade execution. Do you have any clue what might be wrong in my Setup?
Thanks 🙂