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.
// 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
Did you try running a little bit longer backtest? All your screenshots show only 1-2 month of test.
Here the results for a longer backtest. If you want to work more on this I would recommend exploring some filters. Your strategy is basically always in the market. Reducing this time might improve the result.
Thanks for that. Yes thats exactly what I need to learn