ZiBoll Indicator system
Forums › ProRealTime English forum › ProOrder support › ZiBoll Indicator system
- This topic has 19 replies, 4 voices, and was last updated 5 years ago by
Zigo.
-
-
02/28/2020 at 1:00 PM #120744
I made an MTF version for DAX €1, 5 minutes and added Nicolas’trailing stop code, trading hours, target profit and removed FlatBefore and FlatAfter:
_ZiBoll DAX mtf1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192// _ZiBoll DAX mtf//// https://www.prorealcode.com/topic/ziboll-indicator/#post-120704//defparam CumulateOrders = falseTIMEFRAME(4 hour,updateonclose) //4hTradingTime = OpenTime >= 090000 AND OpenTime <= 210000 //09:00 - 21:00p = 11 //11s = 0.3 //0.3// Computes the basic moving average from the low and from the highBollMALow = WeightedAverage[p](Low)BollMAHigh= Weightedaverage[p](High)// Computes the Standard Deviation (You can also take fx for colculate the "StdSTD[20](close)")//Compute the Special Bollinger Bands.//Instead of two times the STDDEV we calculate 0.5 times the STDDEV , and subtract it from the LowMA//For the upper value we take 0.5 times the STDDEV and add it to the HighMABupH = BollMaHigh + (s * STD[p](high)) //Boll+BdnL = BollMALow - (s * STD[p](low))//Boll-//Compare the results with the close of each candle//Lower than the close its -1//Higher than the close its +1//Between the two values equals the previous valuesif close < BdnL thenZHL=-1elsif close> Buph thenZHL=1elseZHL=ZHL[1]endif//First check the trend by means of the regressionslopezbsl=sin(LinearRegressionSlope[p](bdnl)+LinearRegressionSlope[p](buph))/2//The Boolean value of ZHLif zbsl > 0 thenif ZHL crosses over 0and TradingTime thenbuy 1 contract at marketendifelsif zbsl < 0 thenif zhl crosses under 0 and TradingTime thensellshort 1 contract at marketendifendifif longonmarket thenif zhl crosses under 0 thensell at marketendifelsif shortonmarket thenif zhl > 0 thenexitshort at marketendifendif// Stops en targetsset target pprofit 60 //60set stop ploss 23 //23//TIMEFRAME(default) //5 min//************************************************************************//trailing stop functiontrailingstart = 20 //20 trailing will start @trailinstart points profittrailingstep = 26 //26 trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF//************************************************************************02/28/2020 at 2:10 PM #120754I did a 5 min version also on the DJI, I thought I had posted results last night, but either I flicked to another screen before it got sent fully or the site was doing it’s security wiping of Logins?
All I did was optimise the 2 variables as below, so it may not be as predictable as Roberto DAX M5 version.
12p= 6 //11s= 1.7 //0.502/28/2020 at 2:31 PM #12075802/28/2020 at 4:06 PM #12076902/28/2020 at 4:13 PM #120771 -
AuthorPosts
Find exclusive trading pro-tools on
Similar topics: