Forums › ProRealTime English forum › ProOrder support › Discussing the strategy VECTORIAL DAX (M5) › Reply To: Discussing the strategy VECTORIAL DAX (M5)
11/20/2019 at 10:19 AM
#113198
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
//------------------------------------------------------------------------- // Main code : Vectorial DJI 3M v6.0 +entFilt //------------------------------------------------------------------------- //------------------------------------------------------------------------- // Main code : Vectorial DJI 3M v6.0 //------------------------------------------------------------------------- //------------------------------------------------------------------------- // Main code : _Vectorial Dax V3 //------------------------------------------------------------------------- // ROBOT VECTORIAL DAX // M5 // SPREAD 1.5 // by BALMORA 74 - FEBRUARY 2019 DEFPARAM CumulateOrders = false DEFPARAM Preloadbars = 50000 T1 = 6 p1 = average[t1](close) p2 = average[t1*2](close) p3 = average[t1*6](close) p4 = average[t1*3](close) a1 = p1 > p2 and p2 > p3 and p3 > p4 a2 = p1 < p2 and p2 < p3 and p3 < p4 //VARIABLES CtimeA = time >= 080000 and time <= 180000 CtimeB = time >= 080000 and time <= 180000 // TAILLE DES POSITIONS PositionSizeLong = 1 PositionSizeShort = 1 //STRATEGIE //VECTEUR = CALCUL DE L'ANGLE ONCE PeriodeA = 10 ONCE nbChandelierA= 15 MMA = Exponentialaverage[PeriodeA](close) ADJASUROPPO = (MMA-MMA[nbchandelierA]*pipsize) / nbChandelierA ANGLE = (ATAN(ADJASUROPPO)) //FONCTION ARC TANGENTE CondBuy1 = ANGLE >= 35 CondSell1 = ANGLE <= - 40 //VECTEUR = CALCUL DE LA PENTE ET SA MOYENNE MOBILE ONCE PeriodeB = 20 ONCE nbChandelierB= 35 lag = 1.5 MMB = Exponentialaverage[PeriodeB](close) pente = (MMB-MMB[nbchandelierB]*pipsize) / nbchandelierB trigger = Exponentialaverage[PeriodeB+lag](pente) CondBuy2 = (pente > trigger) AND (pente < 0) CondSell2 = (pente CROSSES UNDER trigger) AND (pente > -1) //ENTREES EN POSITION CONDBUY = CondBuy1 and CondBuy2 and CTimeA CONDSELL = CondSell1 and CondSell2 and CtimeB //POSITION LONGUE IF CONDBUY and A1 THEN buy PositionSizeLong contract at market //SET Target %PROFIT 1 //SET STOP %LOSS 0.7 ENDIF //POSITION COURTE IF CONDSELL and a2 THEN Sellshort PositionSizeShort contract at market //SET Target %PROFIT 1.2 //SET STOP %LOSS 1 ENDIF //VARIABLES STOP SUIVEUR ONCE trailingStopType = 1 // Trailing Stop - 0 OFF, 1 ON ONCE trailingstoplong = 9 // Trailing Stop Atr Relative Distance ONCE trailingstopshort = 8 // Trailing Stop Atr Relative Distance ONCE atrtrailingperiod = 14 // Atr parameter Value ONCE minstop = 0 // Minimum Trailing Stop Distance // TRAILINGSTOP //---------------------------------------------- atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pipsize)/1000 trailingstartl = round(atrtrail*trailingstoplong) trailingstartS = round(atrtrail*trailingstopshort) if trailingStopType = 1 THEN TGL =trailingstartl TGS=trailingstarts if not onmarket then MAXPRICE = 0 MINPRICE = close PREZZOUSCITA = 0 ENDIF if longonmarket then MAXPRICE = MAX(MAXPRICE,close) if MAXPRICE-tradeprice(1)>=TGL*pointsize then if MAXPRICE-tradeprice(1)>=MINSTOP then PREZZOUSCITA = MAXPRICE-TGL*pointsize ELSE PREZZOUSCITA = MAXPRICE - MINSTOP*pointsize ENDIF ENDIF ENDIF if shortonmarket then MINPRICE = MIN(MINPRICE,close) if tradeprice(1)-MINPRICE>=TGS*pointsize then if tradeprice(1)-MINPRICE>=MINSTOP then PREZZOUSCITA = MINPRICE+TGS*pointsize ELSE PREZZOUSCITA = MINPRICE + MINSTOP*pointsize ENDIF ENDIF ENDIF if onmarket and PREZZOUSCITA>0 then EXITSHORT AT PREZZOUSCITA STOP SELL AT PREZZOUSCITA STOP ENDIF ENDIF |