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.
-
-
01/30/2017 at 9:01 AM #23014
Hi There
I have been trading a strategy on Forex but back-tested it on Dax with some surprising results.The strategy was originally developed for small accounts. I would like to start implementing it in live trading but would like some validation before taking it live.
The strategy is very basic :
Long Entrytweezer topbreak above bollinger band
Short EntryTweezer bottombreak below bollinger band
12345678910111213141516171819202122232425262728293031323334DEFPARAM CumulateOrders = FalseDEFPARAM preloadbars = 150// Position is closed at 20h00 PMDEFPARAM FlatAfter = 200000tweezerTop = ABS(High -(High[1]))<= High * 0.0025tweezerBottom = ABS(Low -(Low[1]))<= Low * 0.0025bullindicator = 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 1 CONTRACTS AT MARKETENDIF// Conditions to enter short positionsIF NOT ShortOnMarket and Bolishort THENSELLSHORT 1 CONTRACTS AT MARKETENDIFSET STOP PLOSS 10SET STOP PTRAILING 1001/30/2017 at 9:25 AM #23026Thanks Stanton to share it with us.
I see you are using 2 different kind of stoploss in the strategy :
123<span class="token keyword">SET STOP</span> <span class="token keyword">PLOSS</span> <span class="token number">10</span><span class="token keyword">SET STOP</span> PTRAILING <span class="token number">10</span>ProOrder will not accept them together, you’ll need to define if you want to use the trailing stop of the stoploss functionnality. I know it works under ProBacktest, but IG servers will not operate with these 2 different instructions at the same time.
Did you test the strategy in tick by tick mode already? (v10.3)
01/30/2017 at 9:45 AM #2303001/31/2017 at 8:51 AM #23193Hi There
Code has been optimize , thanks Nicolas for your trailing stop functionality.
Works well with AUDUSD can be optimized to work with most types of instruments.
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 STOPENDIF01/31/2017 at 9:35 AM #23198This kind of strategy is pretty most the start of many more improvements for a pure mean reversion based theory of the current price behaviour.
Since you are not with the trend, you bet on the price to revert to its mean, because it has too much derived from it, price break Bollinger bands .. blablabla 🙂 Scenarios that work well in ranging market (both sides) or in the same trend as a narrowed channel.
01/31/2017 at 7:15 PM #2331701/31/2017 at 7:42 PM #2332201/31/2017 at 7:53 PM #2332501/31/2017 at 8:55 PM #23343I’m not great at coding and may do stuff that’s a bit maverick 🙂 I rem’d out the exits and got a better equity curve – top curve below.
Then I amended as below and got the 2nd curve, less drawdown. Apologies if it’s counter your strategy, but may spark a few ideas? Curves below are with 0.6 spread; I need to check what AUD/USD spread is out of hours?
1234567891011IF 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 MARKETENDIFCheers
GraHal02/06/2017 at 1:53 PM #2410302/07/2017 at 10:27 AM #24178Ok, So i’m ITM 50$ atm but the SL is at 15$. Why is that and why is the trailing stop not working?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172//-------------------------------------------------------------------------// Main code : BB AUD/USD//-------------------------------------------------------------------------DEFPARAM 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/07/2017 at 11:10 AM #2418902/07/2017 at 11:58 AM #24197Hi There
Have optimized the bolibounce strategy for EUR/USD
You can use this and just optimise / use variables to find the right combination of stops and trailing for other forex pairs.
1234567891011121314151617181920212223242526272829303132333435363738//-------------------------------------------------------------------------// Main code : BB EURUSD 1H//-------------------------------------------------------------------------DEFPARAM CumulateOrders = False // Cumulating positions deactivatedDEFPARAM preloadbars = 150n = 2tweezerTop = 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 > CLOSEsmiind = SMI[14,3,5](close)Boll = 20Boldown = BollingerDown[Boll](close)Bolup = BollingerUp[Boll](close)BolliLong = (low < Boldown) and tweezerBottom and bullindicator and smiind < 45Bolishort = (high > Bolup) and tweezerTop and bearindicator and smiind > 45IF NOT LongOnMarket AND BolliLong THENBUY n CONTRACTS AT MARKETENDIF// Conditions to enter short positionsIF NOT ShortOnMarket and Bolishort THENSELLSHORT n CONTRACTS AT MARKETENDIFSET STOP pLOSS 10 pTRAILING 10Sorry ignore above cant do this on prorealcode
02/07/2017 at 1:23 PM #24206@Stanton Only way I can get same results as you above is with nil / zero spread and tick-tick unchecked.
Also isn’t the ploss 10 redundant as the ptrailing 10 would do the same job at 10 points loss and as soon as the TS starts to follow the price then the ploss is out of the game? Or am I missing something?
Cheers
GraHal02/07/2017 at 1:29 PM #24208 -
AuthorPosts
Find exclusive trading pro-tools on