Forums › ProRealTime English forum › ProOrder support › Discussing Matriciel EURUSD Dhigh Dlow › Reply To: Discussing Matriciel EURUSD Dhigh Dlow
12/16/2019 at 10:48 AM
#114960
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… :
EURCAD M30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
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 |