ZiBoll Indicator system

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #120744 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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 mtf
    //
    // https://www.prorealcode.com/topic/ziboll-indicator/#post-120704
    //
    defparam CumulateOrders = false
    TIMEFRAME(4 hour,updateonclose)                                              //4h
    TradingTime = OpenTime >= 090000 AND OpenTime <= 210000   //09:00 - 21:00
    p = 11                                                    //11
    s = 0.3                                                   //0.3
    // Computes the basic moving average from the low and from the high
    BollMALow = 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 HighMA
    BupH = 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 values
    if close < BdnL then
    ZHL=-1
    elsif close> Buph then
    ZHL=1
    else
    ZHL=ZHL[1]
    endif
    //First check the trend by means of the regressionslope
    zbsl=sin(LinearRegressionSlope[p](bdnl)+LinearRegressionSlope[p](buph))/2
    //The Boolean value of ZHL
    if zbsl > 0 then
    if ZHL crosses over 0and TradingTime  then
    buy 1 contract at market
    endif
    elsif zbsl < 0 then
    if zhl crosses under 0 and TradingTime then
    sellshort 1 contract at market
    endif
    endif
    if longonmarket then
    if zhl crosses under 0 then
    sell at market
    endif
    elsif shortonmarket then
    if zhl > 0 then
    exitshort at market
    endif
    endif
    // Stops en targets
    set target pprofit 60   //60
    set stop   ploss   23   //23
    //
    TIMEFRAME(default)                                                           //5 min
    //************************************************************************
    //trailing stop function
    trailingstart = 20      //20  trailing will start @trailinstart points profit
    trailingstep  = 26      //26  trailing step to move the "stoploss"
     
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL      AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    //************************************************************************
    Pic1-1.jpg Pic1-1.jpg Pic2-1.jpg Pic2-1.jpg ZiBoll-DAX-mtf.itf
    #120754 quote
    GraHalGraHal
    Participant
    Legend

    I 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.

    p= 6 //11
    s= 1.7 //0.5
    Zigo-3.jpg Zigo-3.jpg Zigo-4.jpg Zigo-4.jpg
    #120758 quote
    ZigoZigo
    Participant
    Master

    ok

    #120769 quote
    NicolasNicolas
    Keymaster
    Legend

    Done.

    GraHal thanked this post
    #120771 quote
    ZigoZigo
    Participant
    Master

    Thank You Nicolas!

Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

ZiBoll Indicator system


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Zigo @zigo Participant
Summary

This topic contains 19 replies,
has 4 voices, and was last updated by ZigoZigo
6 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/20/2020
Status: Active
Attachments: 16 files
ProRealCode ProRealCode
Loading...