Simulated Trading
Forums › ProRealTime English forum › ProOrder support › Simulated Trading
- This topic has 52 replies, 7 voices, and was last updated 3 years ago by zilliq.
Tagged: equity curve, simulated trades
-
-
12/28/2020 at 9:14 PM #155486
I do not get it.
Please, could we include this code in the first Vectorial?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122// ROBOT VECTORIAL DAX// M5// SPREAD 1.5// by BALMORA 74 - FEBRUARY 2019DEFPARAM CumulateOrders = falseDEFPARAM Preloadbars = 50000//VARIABLESCtimeA = time >= 080000 and time <= 220000CtimeB = time >= 080000 and time <= 220000ONCE BarLong = 950 //EXIT ZOMBIE TRADE LONGONCE BarShort = 650 //EXIT ZOMBIE TRADE SHORT// TAILLE DES POSITIONSONCE PositionSizeLong = 1ONCE PositionSizeShort = 2//STRATEGIE//VECTEUR = CALCUL DE L'ANGLEONCE PeriodeA = 10ONCE nbChandelierA= 15MMA = Exponentialaverage[PeriodeA](close)ADJASUROPPO = (MMA-MMA[nbchandelierA]*pipsize) / nbChandelierAANGLE = (ATAN(ADJASUROPPO)) //FONCTION ARC TANGENTECondBuy1 = ANGLE >= 45CondSell1 = ANGLE <= - 37//VECTEUR = CALCUL DE LA PENTE ET SA MOYENNE MOBILEONCE PeriodeB = 20ONCE nbChandelierB= 35lag = 5MMB = Exponentialaverage[PeriodeB](close)pente = (MMB-MMB[nbchandelierB]*pipsize) / nbchandelierBtrigger = Exponentialaverage[PeriodeB+lag](pente)CondBuy2 = (pente > trigger) AND (pente < 0)CondSell2 = (pente CROSSES UNDER trigger) AND (pente > -1)//ENTREES EN POSITIONCONDBUY = CondBuy1 and CondBuy2 and CTimeACONDSELL = CondSell1 and CondSell2 and CtimeB//POSITION LONGUEIF CONDBUY THENbuy PositionSizeLong contract at marketSET TARGET %PROFIT 4.25ENDIF//POSITION COURTEIF CONDSELL THENSellshort PositionSizeShort contract at marketSET TARGET %PROFIT 1.25ENDIF//VARIABLES STOP SUIVEURONCE trailingStopType = 1 // Trailing Stop - 0 OFF, 1 ONONCE trailingstoplong = 7.5 // Trailing Stop Atr Relative DistanceONCE trailingstopshort = 4 // Trailing Stop Atr Relative DistanceONCE atrtrailingperiod = 25 // Atr parameter ValueONCE minstop = 0 // Minimum Trailing Stop Distance// TRAILINGSTOP//----------------------------------------------atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pipsize)/1000trailingstartl = round(atrtrail*trailingstoplong)trailingstartS = round(atrtrail*trailingstopshort)if trailingStopType = 1 THENTGL =trailingstartlTGS=trailingstartsif not onmarket thenMAXPRICE = 0MINPRICE = closePREZZOUSCITA = 0ENDIFif longonmarket thenMAXPRICE = MAX(MAXPRICE,close)if MAXPRICE-tradeprice(1)>=TGL*pointsize thenif MAXPRICE-tradeprice(1)>=MINSTOP thenPREZZOUSCITA = MAXPRICE-TGL*pointsizeELSEPREZZOUSCITA = MAXPRICE - MINSTOP*pointsizeENDIFENDIFENDIFif shortonmarket thenMINPRICE = MIN(MINPRICE,close)if tradeprice(1)-MINPRICE>=TGS*pointsize thenif tradeprice(1)-MINPRICE>=MINSTOP thenPREZZOUSCITA = MINPRICE+TGS*pointsizeELSEPREZZOUSCITA = MINPRICE + MINSTOP*pointsizeENDIFENDIFENDIFif onmarket and PREZZOUSCITA>0 thenEXITSHORT AT PREZZOUSCITA STOPSELL AT PREZZOUSCITA STOPENDIFENDIF//EXIT ZOMBIE TRADEIF POSITIONPERF<0 THENIF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort THENEXITSHORT AT MARKETENDIFENDIFIF POSITIONPERF<0 THENIF LongOnMarket AND BARINDEX-TRADEINDEX(1)>= barlong THENSELL AT MARKETENDIFENDIFAlso, I think Vectorial would be interesting.
12/28/2020 at 10:01 PM #155491Simulating trades in strategies like that vectorial version that exits mid candle with trailing stops as well is a whole new nightmare of coding… and the benefit will likely be very small to negative.
I have more interesting fish to fry right now! 🙂
12/29/2020 at 9:58 AM #155509Ok Vonasi.
My system is not Vectorial.
My system only uses a closure:
SET STOP% LOSS 1.5
You just have to include this closure in Vectorial, and later include your code to calculate the real operations and the simulated operations under this circumstance.
12/29/2020 at 11:10 AM #15553212/29/2020 at 11:50 AM #15553712/29/2020 at 12:21 PM #155545What is the objective of this
The objective is to stop Fran55 from keep asking for it! I have pointed out several times that it is not a path worth following!
1 user thanked author for this post.
12/29/2020 at 12:57 PM #15555012/29/2020 at 5:06 PM #155585 -
AuthorPosts
Find exclusive trading pro-tools on