Bollinger break and return
- This topic has 3 replies, 2 voices, and was last updated 7 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
Forums › ProRealTime English forum › ProOrder support › Bollinger break and return
Hi Guys I’m brand new to this so please ignore any newb comments. I have my head around creating by Simplified Creation and have good results from my simple strategy but I want to refine this with programming to minimise losses. I am using the below to simply define a position by break in bol and then exiting 6 candles after. Testing 30min Aus200 is good and I’m really happy with the 1hr US Dollar, AUDUSD and EURUSD. Trading 20 units Aus200 $1 contract and 20 units on the FX Mini’s with 2k account.
Ideally I want to enter on the current candle but it appears this is not possible? If so then I think I just need to define the following candle is also outside Bol. At the moment of course I am entering on the next candle and often it will spike with that 30min/1hr candle and the entry on the next candle may be back in the band. All successful trades show the following candle is also outside bol to enter correctly. All backtested losses are from single spikes.
Finally, I would also like to define a value for how much over bol it goes before entering but can’t seem to get this working either
I appreciate any feedback or comments with my strategy.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
// Definition of code parameters DEFPARAM CumulateOrders = False // Cumulating positions deactivated // Conditions to enter long positions indicator1 = BollingerDown[20](close) c1 = (close CROSSES OVER indicator1) IF c1 THEN BUY 20 CONTRACT AT MARKET ENDIF // Conditions to exit long positions if intradaybarindex-tradeindex =6 then if longonmarket then sell at market elsif shortonmarket then exitshort at market endif endif // Conditions to enter short positions indicator3 = BollingerUp[20](close) c3 = (close CROSSES OVER indicator3) IF c3 THEN SELLSHORT 20 CONTRACT AT MARKET ENDIF // Conditions to exit short positions if intradaybarindex-tradeindex =6 then if longonmarket then sell at market elsif shortonmarket then exitshort at market endif endif |