DAX 5 min Graph error?
Forums › ProRealTime English forum › ProOrder support › DAX 5 min Graph error?
- This topic has 3 replies, 2 voices, and was last updated 6 years ago by
Stefanb.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
12/22/2019 at 6:51 AM #115356
Hi
I modified a code I found here on the forum so the code is not mine!
I can’t start algao live.
I receive an “graph” error message that cannot be used in automatic trading mode.
Can anyone help me how I can get the code live 🙂
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144DEFPARAM CumulateOrders = falseDEFPARAM Preloadbars = 50000//TRADING TIMECtimeA = time >= 080000 and time <= 180000CtimeB = time >= 080000 and time <= 180000// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 3 OR OpenDayOfWeek = 4 OR OpenDayOfWeek = 0 OR OpenDayOfWeek = 0 OR OpenDayOfWeek = 0//POSITION SIZEPositionSize = 0.5HLS = 11 // Hour of Long ExitHSS = 11 // Hour of Short Exit//STRATEGYONCE PeriodeA = 10ONCE nbChandelierA= 15ONCE PeriodeB = 20ONCE nbChandelierB= 35ONCE lag = 1.5MMA = Exponentialaverage[PeriodeA](close)ADJASUROPPO = (MMA-MMA[nbchandelierA]*pipsize) / nbChandelierAANGLE = (ATAN(ADJASUROPPO))MMB = Exponentialaverage[PeriodeB](close)pente = (MMB-MMB[nbchandelierB]*pipsize) / nbchandelierBtrigger = Exponentialaverage[PeriodeB+lag](pente)//BUY CONDITIONSCondBuy1 = ANGLE >= 35CondBuy2 = (pente > trigger) AND (pente < 0)CondBuy3 = average[100](close) > average[100](close)[1]CONDBUY = CondBuy1 and CondBuy2 and CondBuy3 and CTimeA//SHORT CONDITIONSCondSell1 = ANGLE <= - 40CondSell2 = (pente CROSSES UNDER trigger) AND (pente > -1)CondSell3 = average[20](close) < average[20](close)[1]CONDSELL = CondSell1 and CondSell2 and CondSell3 and CtimeB//POSITION LONGUEIF CONDBUY AND not daysForbiddenEntry THENbuy PositionSize contract at marketSET STOP %LOSS 2ENDIF//POSITION COURTEIF CONDSELL AND not daysForbiddenEntry THENSellshort PositionSize contract at marketSET STOP %LOSS 2ENDIF// trailing stop atr [adjusted reset]once enablets=1once displayts=1if enablets then//once steps=0.05once minatrdist=3once atrtrailingperiod = 14 // atr parameter valueonce minstop = 10 // minimum trailing stop distanceif barindex=tradeindex thentrailingstoplong = 5 // trailing stop atr relative distancetrailingstopshort = 5 // trailing stop atr relative distanceelsif prezzouscita>0 thenif longonmarket thenif trailingstoplong>minatrdist thenif prezzouscita>prezzouscita[1] thentrailingstoplong=trailingstoplongelsetrailingstoplong=trailingstoplong-stepsendifelsetrailingstoplong=minatrdistendifendifif shortonmarket thenif trailingstopshort>minatrdist thenif prezzouscita<prezzouscita[1] thentrailingstopshort=trailingstopshortelsetrailingstopshort=trailingstopshort-stepsendifelsetrailingstopshort=minatrdistendifendifendif//atrtrail=averagetruerange[atrtrailingperiod]((close/10)*pipsize)/1000trailingstartl=round(atrtrail*trailingstoplong)trailingstarts=round(atrtrail*trailingstopshort)tgl=trailingstartltgs=trailingstarts//if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) then//or (longonmarket and condsell) or (shortonmarket and condbuy) thenmaxprice=0minprice=closeprezzouscita=0endif//if longonmarket then//and not condsell thenmaxprice=max(maxprice,close)if maxprice-tradeprice(1)>=tgl*pointsize thenif maxprice-tradeprice(1)>=minstop thenprezzouscita=maxprice-tgl*pointsizeelseprezzouscita=maxprice-minstop*pointsizeendifendifendif//If LongOnMarket AND Hour=HLS THEN//SELL AT MARKETENDIFif shortonmarket then//and not condbuy thenminprice=min(minprice,close)if tradeprice(1)-minprice>=tgs*pointsize thenif tradeprice(1)-minprice>=minstop thenprezzouscita=minprice+tgs*pointsizeelseprezzouscita=minprice+minstop*pointsizeendifendifendif//if onmarket and prezzouscita>0 thenexitshort at prezzouscita stopsell at prezzouscita stopendifif displayts thengraphonprice prezzouscita coloured(0,0,255,255) as "trailingstop atr"endifendifIF ShortOnMarket AND Hour=HSS THENEXITSHORT AT MARKETENDIF12/22/2019 at 6:52 AM #11535812/22/2019 at 7:50 AM #11536112/22/2019 at 8:03 AM #115362 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
Find exclusive trading pro-tools on
Similar topics: