The 13th Worrier Automated v1.5 based on Thomas Geislers Indicator idea. (13th Worrior)
Forums › ProRealTime English forum › ProOrder support › The 13th Worrier Automated v1.5 based on Thomas Geislers Indicator idea. (13th Worrior)
- This topic has 19 replies, 4 voices, and was last updated 5 years ago by
Szeles.
-
-
10/05/2020 at 10:31 AM #145793The 13th worrior based on Thomas Geisler`s Indicator idea123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110//the 13th V1.5 /////////////by Joe Szeles////////////////////////IDEA BASED ON:// The13thWarrior_V1.1// 06.09.2020 (Release 1.1)// Thomas Geisler// Sharing ProRealTime knowledge// https://www.prorealcode.com/library/////Defparam cumulateorders = falsepositionsize=2myOBVn = 5myCandle = 1//Heikin AshiONCE haOpen = OPENONCE haClose = CLOSEN = 0IF BARINDEX = 0 THENhaOpen = OPENhaClose = CLOSEELSIF N = 0 THENhaClose =(OPEN+HIGH+LOW+CLOSE)/4haOpen =(haOpen[1]+haClose[1])/2ENDIFonce tradetype = 1 // [1]long&short;[2]long;[3]shortmm6= average[299]mm5= average[120]mm4= average[10]mm3= average[7]mm2= average[4]mm1= average[3]mm0= average[2]mm= average[1]//longtradelong = mm>mm0 and mm0>mm1 and mm1>mm2 and mm2>mm3 and mm3>mm4 and mm4>mm5 and mm5>mm6//shorttradeshort = mm<mm0 and mm0<mm1 and mm1<mm2 and mm2<mm3 and mm3<mm4 and mm4<mm5 and mm5<mm6//Candle-Colour from OBV and HAIF myCandle = 1 THENmyOBV = OBV(CLOSE)myAV = Average[myOBVn](myOBV)IF myOBV > myAV AND haClose > haOpen and (tradetype=1 or tradetype=2) and tradelong THENif not onmarket thenbuy positionsize contract at marketendifendifif myOBV < myAV AND haClose < haOpen and (tradetype=1 or tradetype=3) and tradeshort THENif not onmarket thensellshort positionsize contract at marketendifendifENDIF//%trailing stop functiontrailingPercent = .278 //org .26stepPercent = .0155//org .014if onmarket thentrailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailinstart points profittrailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stopendifIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart THENnewSL = tradeprice(1)+trailingstepENDIF//next movesIF newSL>0 AND close-newSL>trailingstep THENnewSL = newSL+trailingstepENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart THENnewSL = tradeprice(1)-trailingstepENDIF//next movesIF newSL>0 AND newSL-close>trailingstep THENnewSL = newSL-trailingstepENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFset stop loss 400set target profit 1600
4 users thanked author for this post.
10/05/2020 at 10:47 AM #146445Thanks for sharing your idea and yourcode.
Any suggestion about which TF’s and instruments are best best suited for this strategy?
HA candlesticks are used only for entry conditions, not for indicators nor trailing stop, is that correct?
10/05/2020 at 11:17 AM #146450Attached is one possibility … spread = 5, position size = 1
2 users thanked author for this post.
10/05/2020 at 6:18 PM #146496Strangely with 200K spead 5 and position size 1 it doesn’t give any trades before July 2016 ??
10/05/2020 at 6:26 PM #146501On a 2h system, there are probably not bars before that date if tick-by-tick option is selected. Try not selecting it.
10/05/2020 at 6:30 PM #146502Already done but the result is identical.
10/05/2020 at 6:57 PM #146506Yes, the same start for the 4h TF. It’s similar for many instruments, so I think that’s the limit.
1 user thanked author for this post.
10/06/2020 at 4:38 AM #14652410/06/2020 at 5:32 AM #146526I tried it for day trading in various x-seconds (2, 6 19, 24, 71) , but they need readjustment every 2 or 3 days. the ones i started 4 days ago still work, but they fail in the simulation at the current date. because of that I added a maximum for the strategy profit and trading time limitation in some versions, to lower the risk of loosing the gains. some gained 1000$ over night, but the bad trades are mostly really bad. the Friday crash was really bad and took all the gains from the days before. Also good results with HUF Hungary 12 cach (13thworrior v1.3 HUF 30min.itf)
10/06/2020 at 12:16 PM #146563It worked fine @ 39 seconds for days, when i simulate now it doesn`t work at all, except i move one second forward to 40 second time frame. strange psitionsize =2, spread =6, 40 second timeframe, DJ $1
Day to day trading Idea123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122////////v.3.3.c 2 sec DOW///////////////////////////////////////the 13th warriorDefparam cumulateorders = truepositionsize=2myOBVn = 5myCandle = 1//Heikin AshiONCE haOpen = OPENONCE haClose = CLOSEN = 0IF BARINDEX = 0 THENhaOpen = OPENhaClose = CLOSEELSIF N = 0 THENhaClose =(OPEN+HIGH+LOW+CLOSE)/4haOpen =(haOpen[1]+haClose[1])/2ENDIFonce positionsize = 1once tradetype = 1 // [1]long&short;[2]long;[3]short//========= STRATEGY ===================================mm6= average[299]mm5= average[120]mm4= average[10]mm3= average[7]mm2= average[4]mm1= average[3]mm0= average[2]mm= average[1]//long/////////////////////////////////////////////////////////////////////////c10=low<lowest[2](low[1])c11=close<low[1]tradelong = (c10 and c11) or (mm>mm0 and mm0>mm1 and mm1>mm2 and mm2>mm3 and mm3>mm4 and mm4>mm5 and mm5>mm6)//shortc20=high>highest[2](high[1])c21=close>high[1]tradeshort = (c20 and c21) or (mm<mm0 and mm0<mm1 and mm1<mm2 and mm2<mm3 and mm3<mm4 and mm4<mm5 and mm5<mm6)//Candle-Colour from OBV and HA//////////////////////////////////////////IF myCandle = 1 THENmyOBV = OBV(CLOSE)myAV = Average[myOBVn](myOBV)IF myOBV > myAV AND haClose > haOpen and (tradetype=1 or tradetype=2) and tradelong THENif not onmarket thenbuy positionsize contract at marketendifendifendifif myOBV < myAV AND haClose < haOpen and (tradetype=1 or tradetype=3) and tradeshort THENif not onmarket thensellshort positionsize contract at marketendifendif//%trailing stop function/////////////////////////////////////////////////////////////trailingPercent = .23 //org .26stepPercent = .015//org .014if onmarket thentrailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailinstart points profittrailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stopendifIF NOT ONMARKET THENnewSL=0ENDIF//manage long positions/////////////////////////////////////////////////////////////////////IF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart THENnewSL = tradeprice(1)+trailingstepENDIF//next movesIF newSL>0 AND close-newSL>trailingstep THENnewSL = newSL+trailingstepENDIFENDIF//manage short positions/////////////////////////////////////////////////////////////////IF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart THENnewSL = tradeprice(1)-trailingstepENDIF//next movesIF newSL>0 AND newSL-close>trailingstep THENnewSL = newSL-trailingstepENDIFENDIFIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF////////EXIT STRATEGY DAYTRADING - GRAB CASH AND RUN///////////////////x=250-rsi// max stop loss value in $$contractprofit = 3000 //maximum target profitset stop loss xset target profit contractprofit/3if strategyprofit >= contractprofit then //stop bot from trading and take profitsquitendif10/06/2020 at 1:08 PM #146571now it doesn`t work at all,
Maybe just no conditions that match your trigger conditions?
Anyway we are all best to steer clear of Non Standard Timeframes (TF) that don’t add up to 1 min (so 40 sec in non standard TF also) and 1 hour etc.
There is a big discussion topic on here about use of the 29 second TF if you need to be convinced?
1 user thanked author for this post.
10/06/2020 at 1:27 PM #146575There is a big discussion topic on here about use of the 29 second TF if you need to be convinced?
I
m convinced, I was experimenting with the code and was surprised about the results, but its too hard to replicate the results, so ill stay clear of these TF in real trades, thanks a lot.10/09/2020 at 3:37 AM #146800I couldn
t get it going on the standard timeframe , just works fine on the 11 minute and 6 minute time frame. but couldnt simulate longer than 2 months. anybody some ideas how to get it going on a standard timeframe??123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138///////v.3.1.d 19 sec DOW////////////////////////////////////the 13th warrior NIFTY 6min/////////////////Defparam cumulateorders = false//Money Management DOWMM = 1 // = 0 for optimizationif MM = 0 thenpositionsize=2ENDIFif MM = 1 thenONCE startpositionsize = 2accelerator=1.5 //goes parabolic in an extreme volatile marketONCE factor = 5 // factor of 10 means margin will increase/decrease @ 10% of strategy profit; factor 20 = 5% etcONCE margin = (close*.005) // tier 1 margin value of 1 contract in instrument currency; change decimal according to available leverageONCE margin2 = (close*.01)// tier 2 margin value of 1 contract in instrument currency; change decimal according to available leverageONCE tier1 = 55 // DOW €1 IG first tier margin limitONCE maxpositionsize = 550 // DOW €1 IG tier 2 margin limitONCE minpositionsize = 2 // enter minimum position allowedIF Not OnMarket THENpositionsize = round (startpositionsize + Strategyprofit/(factor*margin))*acceleratorENDIFIF Not OnMarket THENIF startpositionsize + Strategyprofit/(factor*margin) > tier1 thenpositionsize = round((((startpositionsize + (Strategyprofit/(factor*margin))-tier1)*(factor*margin))/(factor*margin2)) + tier1)*accelerator //incorporating tier 2 marginENDIFIF Not OnMarket THENif startpositionsize + Strategyprofit/(factor*margin) < minpositionsize THENpositionsize = round (minpositionsize) //keeps positionsize from going below allowed minimumENDIFIF (((startpositionsize + (Strategyprofit/(factor*margin))-tier1)*(factor*margin))/(factor*margin2)) + tier1 > maxpositionsize thenpositionsize = round (maxpositionsize)// keeps positionsize from going above IG tier 2 margin limitENDIFENDIFENDIFENDIFmyOBVn = 5myCandle = 1//Heikin AshiONCE haOpen = OPENONCE haClose = CLOSEN = 0IF BARINDEX = 0 THENhaOpen = OPENhaClose = CLOSEELSIF N = 0 THENhaClose =(OPEN+HIGH+LOW+CLOSE)/4haOpen =(haOpen[1]+haClose[1])/2ENDIFonce positionsize = 1once tradetype = 2 // [1]long&short;[2]long;[3]short//========= STRATEGY ===================================//longc10=low<lowest[2](low[1])c11=close<low[1]tradelong = c10 and c11//short////c20=high>highest[2](high[1])c21=close>high[1]tradeshort = c20 and c21//Candle-Colour from OBV and HAIF myCandle = 1 THENmyOBV = OBV(CLOSE)myAV = Average[myOBVn](myOBV)IF myOBV > myAV AND haClose > haOpen and (tradetype=1 or tradetype=2) and tradelong THENif not onmarket thenbuy positionsize contract at marketset stop loss 41+rsiset target profit 70+rsiendifendifif myOBV < myAV AND haClose < haOpen and (tradetype=1 or tradetype=3) and tradeshort THENif not onmarket thensellshort positionsize contract at marketset stop loss 43+rsiset target profit 70+rsiendifendifENDIF//%trailing stop function//////////////////////////////////////////////////////////trailingPercent = .19 //org .26stepPercent = .0155//org .014if onmarket thentrailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailinstart points profittrailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stopendifIF NOT ONMARKET THENnewSL=0ENDIF//manage long positions/////////////////////////////////////////////////////////////////////IF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart THENnewSL = tradeprice(1)+trailingstepENDIF//next movesIF newSL>0 AND close-newSL>trailingstep THENnewSL = newSL+trailingstepENDIFENDIF//manage short positions/////////////////////////////////////////////////////////////////IF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart THENnewSL = tradeprice(1)-trailingstepENDIF//next movesIF newSL>0 AND newSL-close>trailingstep THENnewSL = newSL-trailingstepENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF10/09/2020 at 3:38 AM #14680210/09/2020 at 9:47 AM #146835 -
AuthorPosts
Find exclusive trading pro-tools on