Bollinger Bounce – Tweezer Strategy – Dax 1h
Forums › ProRealTime English forum › ProOrder support › Bollinger Bounce – Tweezer Strategy – Dax 1h
- This topic has 25 replies, 4 voices, and was last updated 7 years ago by GraHal.
-
-
02/07/2017 at 1:38 PM #24211
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
02/07/2017 at 2:00 PM #24216@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!? 🙂
02/07/2017 at 2:51 PM #2422102/07/2017 at 4:30 PM #2423212<span class="token keyword">SET STOP</span> <span class="token keyword">pLOSS</span> <span class="token number">10</span> <span class="token keyword">pTRAILING</span> <span class="token number">10</span>This kind of statement can’t be used in IG live trading FYI. But it does work for backtests for sure.
1 user thanked author for this post.
02/07/2017 at 7:00 PM #24258Ok, Great to have that sorted, but Nicolas, below, what is wrong with the SL/TSL ?
It does not work in live mode..
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869DEFPARAM CumulateOrders = False // Cumulating positions deactivatedDEFPARAM preloadbars = 150n = 1tweezerTop = ABS(High -(High[1]))<= High * 0.0075tweezerBottom = ABS(Low -(Low[1]))<= Low * 0.0075bullindicator = OPEN[1] > CLOSE [1] AND OPEN < CLOSEbearindicator = OPEN[1] < CLOSE [1] AND OPEN > CLOSEBoll = 20Boldown = BollingerDown[Boll](close)Bolup = BollingerUp[Boll](close)BolliLong = (low < Boldown) and tweezerBottom and bullindicatorBolishort = (high > Bolup) and tweezerTop and bearindicatorIF NOT LongOnMarket AND BolliLong THENBUY n CONTRACTS AT MARKETENDIF// Conditions to enter short positionsIF NOT ShortOnMarket and Bolishort THENSELLSHORT n CONTRACTS AT MARKETENDIF//trailing stop functiontrailingstart = 10 //trailing will start @trailinstart points profittrailingstep = 5 //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 STOPENDIF02/08/2017 at 11:09 AM #2429302/08/2017 at 11:14 AM #2429702/08/2017 at 11:26 AM #24301It 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.
02/09/2017 at 11:16 AM #2447402/11/2017 at 3:29 PM #24791To 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
1234567891011121314151617181920212223242526272829303132333435363738// Main code : GS BollBounceTweez AUDUSD 1H//-------------------------------------------------------------------------DEFPARAM CumulateOrders = False // Cumulating positions deactivatedDEFPARAM preloadbars = 150//DEFPARAM FlatAfter = 110000//DEFPARAM FlatBefore = 190000n = 1tweezerTop = ABS(High -(High[1]))<= High * 0.0075tweezerBottom = ABS(Low -(Low[1]))<= Low * 0.0075bullindicator = OPEN[1] > CLOSE [1] AND OPEN < CLOSEbearindicator = OPEN[1] < CLOSE [1] AND OPEN > CLOSEBoll = 20Boldown = BollingerDown[Boll](close)Bolup = BollingerUp[Boll](close)BolliLong = (low < Boldown) and tweezerBottom and bullindicatorBolishort = (high > Bolup) and tweezerTop and bearindicatorIF NOT LongOnMarket AND BolliLong and SMI[14,3,5](close) < 45 THENBUY n CONTRACTS AT MARKETENDIF// Conditions to enter short positionsIF NOT ShortOnMarket and Bolishort and SMI[14,3,5](close) > 45 THENSELLSHORT n CONTRACTS AT MARKETENDIFIf ExponentialAverage[30](close) crosses under ExponentialAverage[250](close) ThenSell at MarketEndifIf ExponentialAverage[5](close) crosses over ExponentialAverage[40](close) ThenEXITShort at MarketEndif02/12/2017 at 12:46 AM #24823Use 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.
1234567If ExponentialAverage[30](close) crosses under ExponentialAverage[240](close) ThenSell at MarketEndifIf ExponentialAverage[30](close) crosses over ExponentialAverage[240](close) ThenEXITShort at MarketEndif -
AuthorPosts
Find exclusive trading pro-tools on