Bollinger Bounce – Tweezer Strategy – Dax 1h

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #24211 quote
    StantonR
    Participant
    Senior

    Hi There

    Yes ignore the above code as it not working correctly.

    I am trying to figure out ptrailing as I have used it in a number of simulations on demo and the stoploss doesnt kick in it only acts a a trailing stop once you have reached 10 pips in profit.

    So I am not sure what it is doing still testing that.

    I have only been using PRT for 2 weeks now so still fumbling around.

    The strategy seems to be working nicely when it comes to entry points just cant work out a good exit strategy or stoploss ( Maybe that means the strategy sucks 🙂 )

    Thanks

    #24216 quote
    GraHal
    Participant
    Master

    @Stanton what about zero spread … results are unrealistic with no spread?

    Also I get big loss when I include tick-tick, results are unrealistic with no tick-tick?

    No not sucks … exits are more difficult to get right than entries in my opinion … keep at it! Maybe pick / copy good / working / successful exit conditions from another Strategy altother and paste into your code!? 🙂

    #24221 quote
    CN
    Participant
    Senior

    It does not suck, you are doing a great job StantonR! It gave me 50$ in profit today, thank you!!!

    As @grahal is saying, keep at it and yes, exits are the hardest!!

    #24232 quote
    Nicolas
    Keymaster
    Master
    SET STOP pLOSS 10 pTRAILING 10
    

    This kind of statement can’t be used in IG live trading FYI. But it does work for backtests for sure.

    CN thanked this post
    #24258 quote
    CN
    Participant
    Senior

    Ok, Great to have that sorted, but Nicolas, below, what is wrong with the SL/TSL ?

    It does not work in live mode..

    
    
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    DEFPARAM preloadbars = 150
    
    n = 1
    
    tweezerTop = ABS(High -(High[1]))<= High * 0.0075
    tweezerBottom = ABS(Low -(Low[1]))<= Low * 0.0075
    
    bullindicator = OPEN[1] > CLOSE [1] AND OPEN < CLOSE
    bearindicator = OPEN[1] < CLOSE [1] AND OPEN > CLOSE
    Boll = 20
    
    Boldown = BollingerDown[Boll](close)
    Bolup = BollingerUp[Boll](close)
    
    
    BolliLong = (low < Boldown) and tweezerBottom and bullindicator
    Bolishort = (high > Bolup) and tweezerTop and bearindicator
    
    IF NOT LongOnMarket AND BolliLong THEN
    BUY n CONTRACTS AT MARKET
    
    
    ENDIF
    
    // Conditions to enter short positions
    IF NOT ShortOnMarket and Bolishort THEN
    SELLSHORT n CONTRACTS AT MARKET
    
    ENDIF
    
    //trailing stop function
    trailingstart = 10 //trailing will start @trailinstart points profit
    trailingstep = 5 //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
    
    #24293 quote
    Nicolas
    Keymaster
    Master

    It does not work in live mode..

    What does not work exactly? Entries? or trailing stop?

    I do not see any stoploss in the strategy, only the trailing stop that will start once you reach 10 points profit.

    #24297 quote
    CN
    Participant
    Senior

    The trailing does not work. It sets itself 10pts down and stops there. Does not follow the movement.

    #24301 quote
    Nicolas
    Keymaster
    Master

    It works, please try to debug with GRAPH ! 🙂 this is the only instruction to debug variables, so please use it!

    Please find attached example of the “newSL” variable GRAPHed on chart in a backtest, you see that it moves correctly, at each new candlestick.

    GRAPH-stoploss.png GRAPH-stoploss.png
    #24474 quote
    CN
    Participant
    Senior

    Here is the stats atm in demo with full-size AUD/USD, realy realy big possibilitys if we get the stop sorted.

    Namnlös11.png Namnlös11.png
    #24791 quote
    GraHal
    Participant
    Master

    To keep the momentum up, I’ve done a bit on this AUD/USD 100,000 units @ 1H average spread 1.4 (from link below).

    http://www.myfxbook.com/forex-broker-spreads/IG-AUDUSD-real-spread/1768,11

    // Main code : GS BollBounceTweez AUDUSD 1H
    //-------------------------------------------------------------------------
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    DEFPARAM preloadbars = 150
    //DEFPARAM FlatAfter = 110000
    //DEFPARAM FlatBefore = 190000
    n = 1
    
    tweezerTop = ABS(High -(High[1]))<= High * 0.0075
    tweezerBottom = ABS(Low -(Low[1]))<= Low * 0.0075
    
    bullindicator = OPEN[1] > CLOSE [1] AND OPEN < CLOSE
    bearindicator = OPEN[1] < CLOSE [1] AND OPEN > CLOSE
    Boll = 20
    
    Boldown = BollingerDown[Boll](close)
    Bolup = BollingerUp[Boll](close)
    
    
    BolliLong = (low < Boldown) and tweezerBottom and bullindicator
    Bolishort = (high > Bolup) and tweezerTop and bearindicator
    
    IF NOT LongOnMarket AND BolliLong  and SMI[14,3,5](close) < 45 THEN
    BUY n CONTRACTS AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    IF NOT ShortOnMarket and Bolishort and SMI[14,3,5](close) > 45  THEN
    SELLSHORT n CONTRACTS AT MARKET
    ENDIF
    
    If ExponentialAverage[30](close) crosses under ExponentialAverage[250](close) Then
    Sell at Market
    Endif
    
    If ExponentialAverage[5](close) crosses over ExponentialAverage[40](close) Then
    EXITShort at Market
    Endif
    Tweez.jpg Tweez.jpg
    #24823 quote
    GraHal
    Participant
    Master

    Use below for exits if you think above is too optimised, but fear / down and greed / up are not ‘psychologically symmetrical activities’ so why would we expect symmetrical variables for EMA (any thoughts on that logic welcome)?

    Revised equity curve atached.

    If ExponentialAverage[30](close) crosses under ExponentialAverage[240](close) Then
    Sell at Market
    Endif
    
    If ExponentialAverage[30](close) crosses over ExponentialAverage[240](close) Then
    EXITShort at Market
    Endif
    Tweez-2.jpg Tweez-2.jpg
Viewing 11 posts - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.

Bollinger Bounce – Tweezer Strategy – Dax 1h


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
StantonR @stantonr Participant
Summary

This topic contains 25 replies,
has 4 voices, and was last updated by GraHal
9 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/30/2017
Status: Active
Attachments: No files
Logo Logo
Loading...