Bull and Bear indicator testing of Another ATR trailing stop
Forums › ProRealTime English forum › ProOrder support › Bull and Bear indicator testing of Another ATR trailing stop
- This topic has 2 replies, 2 voices, and was last updated 6 years ago by
soulintact.
-
-
09/25/2019 at 8:20 AM #108407
Good morning,
I am trying to create a Bull and Bear indicator test, based on Nicola’s recent indicator Another ATR trailing stop.
My idea was to be able to check several indicators, instead of just ATR. In variable optimization you have to set aaa from 1001 to 1064.
I receive no errors nor any changeable/meaningful results which is confusing. What am I missing in the code? Thanks!
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194//PRC_Testing multiple indicators,//Based on "PRC_Another indicator trailing stop | indicator by //Nicolas @ www.prorealcode.com | 24.09.2019//25.09.2019//Indicators 10.3if aaa = 1001 thenaaaa=AccumDistr(close)elsif aaa = 1002 thenaaaa=ADX[14]elsif aaa = 1003 thenaaaa=ADXR[14]elsif aaa = 1004 thenaaaa=AroonDown[14]elsif aaa = 1005 thenaaaa=AroonUp[14]elsif aaa = 1006 thenaaaa=AverageTrueRange[14](close)elsif aaa = 1007 thenaaaa=BollingerBandWidth[20](close)elsif aaa = 1008 thenaaaa=BollingerUp[20](close)elsif aaa = 1009 thenaaaa=BollingerDown[20](close)elsif aaa = 1010 thenaaaa=ChaikinOsc[3,10](close)elsif aaa = 1011 thenaaaa=ChandeKrollStopUp[10, 20, 3]elsif aaa = 1012 thenaaaa=ChandeKrollStopDown[10, 20, 3]elsif aaa = 1013 thenaaaa=Chandle[20](close)elsif aaa = 1014 thenaaaa=CCI[20](typicalPrice)elsif aaa = 1015 thenaaaa=Cycle(close)elsif aaa = 1016 thenaaaa=DEMA[21](close)elsif aaa = 1017 thenaaaa=DI[14](close)elsif aaa = 1018 thenaaaa=DIplus[14](close)elsif aaa = 1019 thenaaaa=DIminus[14](close)elsif aaa = 1020 thenaaaa=EaseOfMovement[14]elsif aaa = 1021 thenaaaa=EMVelsif aaa = 1022 thenaaaa=EndPointAverage[20](close)elsif aaa = 1023 thenaaaa=ExponentialAverage[20](close)elsif aaa = 1024 thenaaaa=ForceIndex(close)elsif aaa = 1025 thenaaaa=HistoricVolatility[20](close)elsif aaa = 1026 thenaaaa=LinearRegression[10](close)elsif aaa = 1027 thenaaaa=LinearRegressionSlope[10](close)elsif aaa = 1028 thenaaaa=MACDline[12,26,9](close)elsif aaa = 1029 thenaaaa=MACD[12,26,9](close)elsif aaa = 1030 thenaaaa=MassIndex[25]elsif aaa = 1031 thenaaaa=Momentum[12](close)elsif aaa = 1032 thenaaaa=MoneyFlow[21](close)elsif aaa = 1033 thenaaaa=Average[20](close)elsif aaa = 1034 thenaaaa=NegativeVolumeIndex(close)elsif aaa = 1035 thenaaaa=OBV(close)elsif aaa = 1036 thenaaaa=SAR[0.02,0.02,0.2]elsif aaa = 1037 thenaaaa=PositiveVolumeIndex(close)elsif aaa = 1038 thenaaaa=PriceOscillator[5,25](close)elsif aaa = 1039 thenaaaa=PVT(close)elsif aaa = 1040 thenaaaa=R2[10](close)elsif aaa = 1041 thenaaaa=ROC[12](close)elsif aaa = 1042 thenaaaa=RSI[14](close)elsif aaa = 1043 thenaaaa=Repulse[5](close)elsif aaa = 1044 thenaaaa=SARatdmf[0.02,0.02,0.2]elsif aaa = 1045 thenaaaa=SmoothedStochastic[14,3](close)elsif aaa = 1046 thenaaaa=STD[20](close)elsif aaa = 1047 thenaaaa=STE[10](close)elsif aaa = 1048 thenaaaa=AroonDown[14]elsif aaa = 1049 thenaaaa=Stochastic[14,3](close)elsif aaa = 1050 thenaaaa=SMI[14,3,5](close)elsif aaa = 1051 thenaaaa=Supertrend[3,10]elsif aaa = 1052 thenaaaa=TEMA[21](close)elsif aaa = 1053 thenaaaa=TimeSeriesAverage[20](close)elsif aaa = 1054 thenaaaa=TriangularAverage[20](close)elsif aaa = 1055 thenaaaa=TRIX[15](close)elsif aaa = 1056 thenaaaa=TR(close)elsif aaa = 1057 thenaaaa=Variation(close)elsif aaa = 1058 thenaaaa=Volatility[10,10]elsif aaa = 1059 thenaaaa=VolumeOscillator[5,25]elsif aaa = 1060 thenaaaa=VolumeROC[12]elsif aaa = 1061 thenaaaa=WeightedAverage[20](close)elsif aaa = 1062 thenaaaa=WilderAverage[20](close)elsif aaa = 1063 thenaaaa=Williams[14](close)elsif aaa = 1064 thenaaaa=WilliamsAccumDistr(close)//--------------------------------------------------------------------------------////Modified PRC_Another ATR trailing stop | indicator//24.09.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge// --- settings//p=14 //ATR periodmult=2 //multipliermode=1 //trailing stop mode (0=straight line// --- end of settingsindicator = aaaa * multonce trend=1if trend=1 thenhh=max(hh,close)ll=hhif indicator<indicator[1] thenhhlevel=hh-indicatorif hhlevel>ts thents=hhlevelendifendifr=0//g=168elsell=min(ll,close)hh=llif indicator<indicator[1] thenlllevel=ll+indicatorif lllevel<ts thents=lllevelendifendifr=255//g=0endifif close crosses over ts thentrend=1if mode>0 thents=llendifelsif close crosses under ts thentrend=-1if mode>0 thents=hhendifendifBullScalp = (r[1]>0 and r=0) or trend=1BearScalp = (r>0 and r[1]=0) or trend=-1endif09/25/2019 at 8:49 AM #108410You are building an indicator that doesn’t fit on price.
The original indicator is a trailing stop line computed with the price +/- ATR values (which is a price value), while you try to make a line with price +/- RSI value?! , that doesn’t make sense, since RSI is a normalized oscillator (a value between 0 to 100%).. and the problem is the same with almost all other indicator you tried.
So, starting from your idea, you have 2 options:
- make a price indicator with indicator that reflect price values (such as STD, STE, ..)
- make a similar trailing stop indicator but adapted on oscillator: instead of the price value, use the oscillator one (but that should make some adaptation of the initial code)..
1 user thanked author for this post.
09/25/2019 at 8:57 AM #108412Thanks Nicola for your prompt reply!
No wonder… A bit too much Abracadabra from my part.
As you suggested, making a similar trailing stop indicator but adapted on oscillator: instead of the price value, seems to be a great idea.
I have no idea how to do that, but I will dive in to it. If someone gets impatient, please join with some code suggestions, thanks!
-
AuthorPosts
Find exclusive trading pro-tools on