Smoothed Bollinger% Strategy Daily_Topic

Viewing 15 posts - 16 through 30 (of 92 total)
  • Author
    Posts
  • #60752 quote
    Alberto
    Participant
    Average

    Thank you very much. Here I attach an AUD/USD optimised cross (tick by tick).
    I’m from Italy too, not from Sweden.

    Smoothed-Bollinger-B-AUDUSD.itf Smoothed-Bollinger-B-AUDUSD.png Smoothed-Bollinger-B-AUDUSD.png
    #60864 quote
    Tedvin
    Participant
    Average

    Hi and thanks for this strategy ALE. Nice and solid foundation to keep working from and adapt to more markets etc.

    Just a though regarding the minstop, correct me if wrong. I guess the variable minstop is supposed to be set in pips, but there is no pointsize multiplier in the row “if MAXPRICEtradeprice(1)>=MINSTOP then“. Makes no difference in the indexes since pipsize is 1, but if used on currency pairs this might distort the results. I see that in the posted eurusd version of the strategy this error has not been detected, so the if condition above is never true, which makes the trailing stop consistently being set to minimum according to row “PREZZOUSCITA = MAXPRICE – MINSTOP*pointsize“.

    Above comment applies to short as well as long part of the trailing stop.

    Best Regards, Tedvin

    Nicolas thanked this post
    #60961 quote
    ALE
    Moderator
    Master

    Hello Tedvin,

    Yes I’m agree!

    Thanks

    ALe

    #60966 quote
    ALE
    Moderator
    Master

    @Alberto,

    also if I’ll never use on real account the following optimization I’ve attached anothe version for AUD/USD

    Smoothed-Bollinger-c-AUDUSD.itf
    #61027 quote
    Alberto
    Participant
    Average

    Thank you for your optimised AUD/USD. I’ll try to search a better version, but I think this cross is a hard one. I don’t like the declining curve at the end.

    Are you running this automated strategy live with any asset?

    #61131 quote
    ALE
    Moderator
    Master

    Hello Alberto,
    I’m busy with others but I could consider major market like Nasdaq, Dax  etc. in real

    #61236 quote
    T-rader
    Participant
    Average

    Hello

    I´ve been testing this code on some different fx pairs and some other markets and have gotten some amazing results. Is this code really legit? I see that many of the trades are closed within the first bar (0 bar). But tested with t-b-t this shouldn´t be a problem.

    Can´t see anything that looks non legit except for the result… What do you think?

    You can see some of my backtest down below. I´ve optimized on the latest 5-10 years and the rest is OOS.

    Skärmavbild-2018-02-01-kl.-21.07.05.png Skärmavbild-2018-02-01-kl.-21.07.05.png Skärmavbild-2018-02-01-kl.-20.10.01.png Skärmavbild-2018-02-01-kl.-20.10.01.png
    #61244 quote
    Alberto
    Participant
    Average

    Are you sure you were testing them tick by tick? In ProRealTime the tick-by-tick test starts from 2010, whereas your screenshots start previously.

    #61250 quote
    T-rader
    Participant
    Average

    I´m getting the same result in tick by tick.

    #61254 quote
    T-rader
    Participant
    Average

    Sorry for dubbel posting but here´s the code for aud/Usd for example. Optimized from 2010-07-20 to 2018-02-01 (see the line in the picture). 1988-2010 is all oss.

    
    DEFPARAM CumulateOrders =  FALSE
    ONCE avgEnterEnabled      = 2   //Moving Average Entry Filter - 0 OFF, 1 ON
    ONCE trailingStopType     = 1    // Trailing Stop - 0 OFF, 1 ON
    ONCE takeprofit           = 1.2  // Take Profit %
    ONCE stoploss             = 0.9  // Stop Loss %
    ONCE trailingstoplong     = 23    // Trailing Stop Atr Relative Distance
    ONCE trailingstopshort    = 9    // Trailing Stop Atr Relative Distance
    ONCE barlong              = 1    // Exit Time Long
    ONCE barshort             = 3    // Exit Time Short
    ONCE atrtrailingperiod    = 380  // Atr parameter Value
    ONCE minstop              = 3 // Minimum Trailing Stop Distance
    
    // MOVING AVERAGE - Parameter
    ONCE avgLongPeriod          = 200 // 100
    // Smoothed Bollinger %b indicator - Parameters
    ONCE period                 = 3
    ONCE TeAv                   = 1
    ONCE SveEnterLongThreshold  = 35
    ONCE SveEnterShortThreshold = 65
    
    // TRAILINGSTOP
    //----------------------------------------------
    atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pipsize)
    trailingstartl = round(atrtrail*trailingstoplong)
    trailingstartS = round(atrtrail*trailingstopshort)
    if trailingStopType = 1 THEN
    TGL =trailingstartl
    TGS=trailingstarts
    if not onmarket then
    MAXPRICE = 0
    MINPRICE = close
    PREZZOUSCITA = 0
    ENDIF
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close)
    if MAXPRICE-tradeprice(1)>=TGL*pointsize then
    if MAXPRICE-tradeprice(1)>=MINSTOP then
    PREZZOUSCITA = MAXPRICE-TGL*pointsize
    ELSE
    PREZZOUSCITA = MAXPRICE - MINSTOP*pointsize
    ENDIF
    ENDIF
    ENDIF
    if shortonmarket then
    MINPRICE = MIN(MINPRICE,close)
    if tradeprice(1)-MINPRICE>=TGS*pointsize then
    if tradeprice(1)-MINPRICE>=MINSTOP then
    PREZZOUSCITA = MINPRICE+TGS*pointsize
    ELSE
    PREZZOUSCITA = MINPRICE + MINSTOP*pointsize
    ENDIF
    ENDIF
    ENDIF
    if onmarket and PREZZOUSCITA>0 then
    EXITSHORT AT PREZZOUSCITA STOP
    SELL AT PREZZOUSCITA STOP
    ENDIF
    ENDIF
    //--------------------------------------------------------------------------------------------------
    // FILTER SETTINGS
    //--------------------------------------------------------------------------------------------------
    //MOVING AVERAGE
    longAvg  = Average[avgLongPeriod] (close)
    avgFilterEnterLong  = (close>longAvg OR NOT avgEnterEnabled)
    avgFilterEnterShort = (close<longAvg OR NOT avgEnterEnabled)
    
    //Smoothed Bollinger %b indicator
    haOpen = ((Open[1]+High[1]+Low[1]+Close[1])/4 + (Open[2]+High[2]+Low[2]+Close[2]))/2
    haC = ((Open+High+Low+Close)/4 + haOpen + Max(high,haOpen) + Min(low,haOpen)) /4
    TMA1 = tema[TeAv](haC)
    TMA2 = tema[TeAv](TMA1)
    Diff = TMA1-TMA2
    ZlHA = TMA1+Diff
    percb = (tema[TeAv](ZLHA)+2*STD[period](tema[TeAv](ZLHA))-weightedaverage[period](tema[TeAv](ZLHA))) / (4*STD[period](tema[TeAv](ZLHA)))*100
    SveFilterEnterLong  = (percb < SveEnterLongThreshold  )
    SveFilterEnterShort = (percb > SveEnterShortThreshold )
    
    // STRATEGY
    //--------------------------------------------------------------------------------------------------
    
    IF NOT LongOnMarket AND avgFilterEnterLong AND SvEFilterEnterLong THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    
    IF NOT ShortOnMarket AND avgFilterEnterShort AND SveFilterEnterShort THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
     
    IF  POSITIONPERF<0 THEN
    IF LongOnMarket AND BARINDEX-TRADEINDEX(1)>= barLong THEN
    SELL AT MARKET
    ENDIF
    ENDIF
    
    IF POSITIONPERF<0 THEN
    IF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort  THEN
    EXITSHORT AT MARKET
    ENDIF
    ENDIF
    
    SET STOP %LOSS stoploss
    SET TARGET %PROFIT Takeprofit
    ///GRAPH TGL
    
    Skärmklipp15.png Skärmklipp15.png
    #61304 quote
    Alberto
    Participant
    Average

    Compliments for your optimisation. Much better than mine. I’ve tried it and I get more or less the same results.

    I’m optimising other assets, but it’s a little difficult. There are a lot of variables to set in advance.

    #61306 quote
    Nicolas
    Keymaster
    Master

    Good job guys! Nice to see you are using OOS validation for your optimized variables settings.


    @ale
    congratulations for the strategy

    ALE thanked this post
    #61369 quote
    T-rader
    Participant
    Average

    Thanks Alberto and Nicolas.

    The only problem I´ve noticed so far is that the code dosen´t seem to like to have a open position over the weekend. As you can see in the picture below the code is turning it self off.

    Does anyone have an idea of what the problem could be?

     

    Cheers

    Skärmavbild-2018-02-03-kl.-19.20.15.png Skärmavbild-2018-02-03-kl.-19.20.15.png
    #61372 quote
    ALE
    Moderator
    Master

    This problem is over  this strategy, i’d like to know why

    #61401 quote
    Nicolas
    Keymaster
    Master

    @T-rader

    First time it does that?

Viewing 15 posts - 16 through 30 (of 92 total)
  • You must be logged in to reply to this topic.

Smoothed Bollinger% Strategy Daily_Topic


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ALE @aleale Moderator
Summary

This topic contains 91 replies,
has 15 voices, and was last updated by robertogozzi
5 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/07/2018
Status: Active
Attachments: 22 files
Logo Logo
Loading...