System stopped [defparam] by this code
Forums › ProRealTime English forum › ProOrder support › System stopped [defparam] by this code
- This topic has 20 replies, 4 voices, and was last updated 5 years ago by
GraHal.
-
-
09/17/2020 at 5:01 PM #14457909/17/2020 at 6:31 PM #14458209/18/2020 at 3:41 AM #14461009/18/2020 at 6:48 AM #14461309/18/2020 at 9:35 AM #144633
I tried it “True” and “False”, system still reject it immediately.
What happens if you delete defparam cumulateorders altogether?
If Algo still gets rejected then something else is causing Rejection?
09/18/2020 at 9:36 AM #14463409/19/2020 at 5:24 AM #14473609/19/2020 at 9:09 AM #144743You should post the code and tell us the instrument you are trading, in order to try to replicate the issue.
09/19/2020 at 11:54 AM #144750ran 3 hours
Try it on 3 hour timeframe and on 100 bars and let us know how you get on?
09/19/2020 at 12:18 PM #144753123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572defparam cumulateorders = truedefparam preloadbars = 10000once tradetype = 1 // [1]long/short [2]long [3]shortonce reenter = 1 // [1]on [0]off (off ignores positionperftype/value below)once positionperftype = 0 // [0]loss/gain [1]loss [2]gainonce positionperfvalue = 0.1 // % (0 or higher)once stochasticrsi = 1once sll = 1.6 // stoploss longonce sls = 1.8 // stoploss shortonce ptl = undefined // profit target longonce pts = undefined // profit target shortonce overnightposition = 1once weekendposition = 1// money managementMM = 0 // = 0 for optimizationif MM = 0 thenpositionsize=1 //ENDIFif MM = 1 thenENDIFENDIFif overnightposition=1 and weekendposition=1 thenctime = (time>=14000 and time=<240000 or time>=000000 and time<3500) and not (time>=120000 and time<130000 or time>=50000 and time<60000)elsif overnightposition=0 thenctime = (time>=044500 and time<220000) //and not (time>=153000 and time<163300)elsif overnightposition=1 and weekendposition=0 thenctime = ((dayofweek<5 and time>=044500 and time<230000) or (dayofweek=5 and time>=044500 and time<220000)) //and not (time>=153000 and time<163300)endifonce periodea = 33 //14once nbchandeliera = 14 //20once periodeb = 32 //29once nbchandelierb = 48 //41mma = exponentialaverage[periodea](close)adjasuroppo = (mma-mma[nbchandeliera]*pipsize) / nbchandelieraangle = (atan(adjasuroppo))mmb = exponentialaverage[periodeb](close)pente = (mmb-mmb[nbchandelierb]*pipsize) / nbchandelierbtrigger = exponentialaverage[periodeb](pente)cb1 = angle >= 34cs1 = angle <= -28cb2 = (pente crosses over trigger) and (pente >-6 and pente < 1)cs2 = (pente crosses under trigger) and (pente >-11 and pente < 9)//entrees en positioncondbuy = cb1 and cb2 //and low<>dlow(0) //and close<>lowcondsell = cs1 and cs2 //and high<>dhigh(0) //and close<>high//stochastic rsi | indicatorif stochasticrsi thenlengthrsi = 11 // 2 rsi periodlengthstoch = 2 // 6 stochastic periodsmoothk = 4 // 4 smooth signal of stochastic rsismoothd = 10 // 8 smooth signal of smoothed stochastic rsimyrsi = rsi[lengthrsi](totalprice)minrsi = lowest[lengthstoch](myrsi)maxrsi = highest[lengthstoch](myrsi)stochrsi = (myrsi-minrsi) / (maxrsi-minrsi)k = average[smoothk](stochrsi)*100d = average[smoothd](k)c13 = k>dc14 = k<dcondbuy = condbuy and c13condsell= condsell and c14elsec13=c13c14=c14endif// entry criteriaif ctime thenif (tradetype=1 or tradetype=2) thenif condbuy and not longonmarket thenbuy positionsize contract at marketif tradetype=1 thenset stop %loss sllset target %profit ptlelsif tradetype=2 thenset stop %loss sllset target %profit ptlendifendifendifif (tradetype=1 or tradetype=3) thenif condsell and not shortonmarket thensellshort positionsize contract at marketif tradetype=1 thenset stop %loss slsset target %profit ptselsif tradetype=3 thenset stop %loss slsset target %profit ptsendifendifendifif reenter thenif positionperftype=1 thenpositionperformance=positionperf(0)*100<-positionperfvalueelsif positionperftype=2 thenpositionperformance=positionperf(0)*100>positionperfvalueelsepositionperformance=((positionperf(0)*100)<-positionperfvalue or (positionperf(0)*100)>positionperfvalue)endifif (tradetype=1 or tradetype=2) thenif condbuy and longonmarket and positionperformance thensell at marketendifif condbuy[1] and not longonmarket thenbuy positionsize contract at marketif tradetype=1 thenset stop %loss sllset target %profit ptlelsif tradetype=2 thenset stop %loss sllset target %profit ptlendifendifendifif (tradetype=1 or tradetype=3) thenif condsell and shortonmarket and positionperformance thenexitshort at marketendifif condsell[1] and not shortonmarket thensellshort positionsize contract at marketif tradetype=1 thenset stop %loss slsset target %profit ptselsif tradetype=3 thenset stop %loss slsset target %profit ptsendifendifendifendifelseif longonmarket and condsell then//sell at marketendifif shortonmarket and condbuy then//exitshort at marketendifendif// break even stoponce enablebe = 1if enablebe thenonce besg = 0.89//0.25 //% break even stop gainonce besl = -0.001//0.75 //% break even stop level (+ or -)if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thenbenewsl=0endifif longonmarket thenif high-tradeprice(1)>=((tradeprice(1)/100)*besg)*pointsize thenbenewsl=tradeprice(1)+((tradeprice(1)/100)*besl)*pointsizeendifendifif shortonmarket thenif tradeprice(1)-low>=((tradeprice(1)/100)*besg)*pointsize thenbenewsl=tradeprice(1)-((tradeprice(1)/100)*besl)*pointsizeendifendifif barindex-tradeindex>1 thenif longonmarket thenif benewsl>0 thensell at benewsl stopendifif benewsl>0 thenif low crosses under benewsl thensell at marketendifendifendifif shortonmarket thenif benewsl>0 thenexitshort at benewsl stopendifif benewsl>0 thenif high crosses over benewsl thenexitshort at marketendifendifendifendifendif// trailing atr stoponce trailingstoptype1 = 1 // trailing stop - 0 off, 1 onif trailingstoptype1 thenonce tsincrements = 0.11 // set to 0 to ignore tsincrementsonce tsminatrdist = 1once tsatrperiod = 9 // ts atr parameteronce tsminstop = 20 // ts minimum stop distanceonce tssensitivity = 1 // [0]close;[1]high/lowif barindex=tradeindex thentrailingstoplong = 10 // ts atr distancetrailingstopshort = 8 // ts atr distanceelseif longonmarket thenif tsnewsl>0 thenif trailingstoplong>tsminatrdist thenif tsnewsl>tsnewsl[1] thentrailingstoplong=trailingstoplongelsetrailingstoplong=trailingstoplong-tsincrementsendifelsetrailingstoplong=tsminatrdistendifendifendifif shortonmarket thenif tsnewsl>0 thenif trailingstopshort>tsminatrdist thenif tsnewsl<tsnewsl[1] thentrailingstopshort=trailingstopshortelsetrailingstopshort=trailingstopshort-tsincrementsendifelsetrailingstopshort=tsminatrdistendifendifendifendiftsatr=averagetruerange[tsatrperiod]((close/10)*pipsize)/1000//tsatr=averagetruerange[tsatrperiod]((close/1)*pipsize) // (forex)tgl=round(tsatr*trailingstoplong)tgs=round(tsatr*trailingstopshort)if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thentsmaxprice=0tsminprice=closetsnewsl=0endifif tssensitivity thentssensitivitylong=hightssensitivityshort=lowelsetssensitivitylong=closetssensitivityshort=closeendifif longonmarket thentsmaxprice=max(tsmaxprice,tssensitivitylong)if tsmaxprice-tradeprice(1)>=tgl*pointsize thenif tsmaxprice-tradeprice(1)>=tsminstop thentsnewsl=tsmaxprice-tgl*pointsizeelsetsnewsl=tsmaxprice-tsminstop*pointsizeendifendifendifif shortonmarket thentsminprice=min(tsminprice,tssensitivityshort)if tradeprice(1)-tsminprice>=tgs*pointsize thenif tradeprice(1)-tsminprice>=tsminstop thentsnewsl=tsminprice+tgs*pointsizeelsetsnewsl=tsminprice+tsminstop*pointsizeendifendifendifif barindex-tradeindex>1 thenif longonmarket thenif tsnewsl>0 thensell at tsnewsl stopendifif tsnewsl>0 thenif low crosses under tsnewsl thensell at marketendifendifendifif shortonmarket thenif tsnewsl>0 thenexitshort at tsnewsl stopendifif tsnewsl>0 thenif high crosses over tsnewsl thenexitshort at marketendifendifendifendifendif// trailing stop percentageonce trailingstoptype2=1if trailingstoptype2 thenonce trailingpercent = 1once steppercent = (trailingpercent/10)*1if onmarket thentrailingstart = tradeprice(1)*(trailingpercent/100)trailingstep = tradeprice(1)*(steppercent/100)endifif not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thennewsl=0endifif longonmarket thenif newsl=0 and high-tradeprice(1)>=trailingstart thennewsl = tradeprice(1)+trailingstependifif newsl>0 and high-newsl>trailingstep thennewsl = newsl+trailingstependifendifif shortonmarket thenif newsl=0 and tradeprice(1)-low>=trailingstart thennewsl = tradeprice(1)-trailingstependifif newsl>0 and newsl-low>trailingstep thennewsl = newsl-trailingstependifendifif barindex-tradeindex>1 thenif longonmarket thenif newsl>0 thensell at newsl stopendifif newsl>0 thenif low crosses under newsl thensell at marketendifendifendifif shortonmarket thenif newsl>0 thenexitshort at newsl stopendifif newsl>0 thenif high crosses over newsl thenexitshort at marketendifendifendifendifendif// market resilienceonce mr=1if mr thenstarttime = 0 // 08h00 Pré Market EU (Cac, Dax, Footsie, ect...)endtime = 140000 // 09h00 Ouverture session européenneif intradaybarindex = 0 thenhh = 0ll = 0endifif time >= starttime and time < endtime thenif high > hh thenhh = highendifif low < ll or ll = 0 thenll = lowendifendiffib38 = hhfib0 = llfibobull200 = (fib38-fib0)*2.19+fib0fibobull162 = (fib38-fib0)*1.59+fib0fibobull124 = (fib38-fib0)*0.73+fib0fibobull100 = (fib38-fib0)*0.07+fib38fibobull76 = (fib38-fib0)+fib38fibobull62 = (fib38-fib0)*1.87+fib0fibobear62 = (fib0-fib38)*0.29+fib0fibobear76 = (fib0-fib38)+fib0fibobear100 = (fib0-fib38)*0.45+fib0fibobear124 = (fib0-fib38)*0.99+fib0fibobear162 = (fib0-fib38)*0.67+fib0fibobear200 = (fib0-fib38)*0.08+fib0fibobull200=fibobull200fibobull162=fibobull162fibobull124=fibobull124fibobull100=fibobull100fibobull76=fibobull76fibobull62=fibobull62fibobear62=fibobear62fibobear76=fibobear76fibobear100=fibobear100fibobear124=fibobear124fibobear162=fibobear162fibobear200=fibobear200if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thenflag1=0flag2=0flag3=0flag4=0flag5=0flag6=0flag7=0flag8=0flag9=0flag10=0flag11=0flag12=0endifif time>=0 thenif longonmarket thenif close crosses over fibobull62 thenflag1=1endifif flag1=1 thenif close crosses under (ll+fibobull62)/2 thensell at marketendifendifif close crosses over fibobull76 thenflag2=1endifif flag2=1 thenif close crosses under (hh+fibobull76)/2 thensell at marketendifendifif close crosses over fibobull100 thenflag3=1endifif flag3=1 thenif close crosses under (fibobull62+fibobull100)/2 thensell at marketendifendifif close crosses over fibobull124 thenflag4=1endifif flag4=1 thenif close crosses under (fibobull76+fibobull124)/2 thensell at marketendifendifif close crosses over fibobull162 thenflag5=1endifif flag5=1 thenif close crosses under (fibobull100+fibobull162)/2 thensell at marketendifendifif close crosses over fibobull200 thenflag6=1endifif flag6=1 thenif close crosses under (fibobull124+fibobull200)/2 thensell at marketendifendifendifif shortonmarket thenif close crosses under fibobear62 thenflag7=1endifif flag7=1 thenif close crosses over (hh+fibobear62)/2 thenexitshort at marketendifendifif close crosses under fibobear76 thenflag8=1endifif flag8=1 thenif close crosses over (ll+fibobear76)/2 thenexitshort at marketendifendifif close crosses under fibobear100 thenflag9=1endifif flag9=1 thenif close crosses over (fibobear62+fibobear100)/2 thenexitshort at marketendifendifif close crosses under fibobear124 thenflag10=1endifif flag10=1 thenif close crosses over (fibobear76+fibobear124)/2 thenexitshort at marketendifendifif close crosses under fibobear162 thenflag11=1endifif flag11=1 thenif close crosses over (fibobear100+fibobear162)/2 thenexitshort at marketendifendifif close crosses under fibobear200 thenflag12=1endifif flag12=1 thenif close crosses over (fibobear124+fibobear200)/2 thenexitshort at marketendifendifendifendifendif// display days in marketonce displaydim =0 // displays the number of days in market (activated graph)once maxdim =99 // maximum days in marketif displaydim thenif not onmarket thendim=0elseif onmarket and not onmarket[1] or (longonmarket and shortonmarket[1]) or (shortonmarket and longonmarket[1]) thendim=1endifendifif not opendayofweek=0 thenif onmarket thenif openday <> openday[1] thendim = dim + 1endifendifendifif onmarket and dim>=maxdim thensell at marketexitshort at marketendif//graph dim // display days in marketendifif not overnightposition thenif time>=215400 thensell at marketexitshort at marketendifendifif not weekendposition thenif (dayofweek=5 and time>=215400) thenexitshort at marketsell at marketendifHi Robertogozzi
This is the code and running in Hong Kong instrument with HK time.
It is based on Vectorial strategy and only adjusted the figures for HK. I have also ran in DJI, DAX, no such issue.
Sometimes, I used the strategy “Mother of Dragon” in Japan and Singapore instruments, also have this issue.
Thanks.
09/19/2020 at 1:00 PM #144755running in Hong Kong instrument
Which Hong Kong instrument?
Do you mean the Hang Seng Index?
09/19/2020 at 1:10 PM #144756Runs okay for me (no error message etc) on 10k bars on 3 H TF on the Hang Seng … see attached.
When you confirm what Instrument and TF and No of bars and Timezone you are having Issues with then I will run same on my Platform for you.
09/19/2020 at 1:22 PM #14475709/19/2020 at 1:24 PM #14475809/19/2020 at 1:31 PM #144759 -
AuthorPosts
Find exclusive trading pro-tools on