Hi All
I was playing with Nicolas’s bar counting strategy when I cam across some good results for the EURUSD.
Strategy:
EURUSD
1 Hour time frame
Count 3 bars in a direction
Trade in opposite direction
Exit on engulfing candle in opposite direction.
Its very simple but can definately be optimized to increase the amount of winning trades.
I tried to check for 3 bars then a reversal signal like a engulfing signal or harami but got no trades.
Any changes/improvements would be greatly appreciated.
// timeframe: h1
// instrument: FX
// pairs: EURUSD
DEFPARAM CumulateOrders = FALSE
//Need to to implement Muray math levels
Size = 1 //position size
StopLoss = 20 //stoploss in points
//TakeProfit = 10 //takeprofit in points
Xcandlesticks = 3 //consecutive bullish or bearish candlesticks to open a new position
//InverseTrading = 0 //(0=false ; 1=true) trade in the same direction of the candlesticks pattern or not
//CumulateOrder = 0 //(0=false ; 1=true) cumulate or not a new trade if the current candlestick is in the same trend as the pattern
// ------------
//detecting patterns
bearpattern = summation[Xcandlesticks](close<open)=Xcandlesticks
bullishpattern = summation[Xcandlesticks](close>open)=Xcandlesticks
BullishEngulfing= OPEN[1] > CLOSE[1] AND CLOSE > OPEN AND CLOSE[1] >= OPEN AND CLOSE >= OPEN[1]
bearishengulfing = CLOSE[1] > OPEN[1] AND OPEN > CLOSE AND OPEN[1] >= CLOSE AND OPEN >= CLOSE[1]
//bullishharami = close[1]< open[1] and close > open AND close < open[1] AND open > close[1]
//bearishharami = close[1]> open[1] and close < open AND close > open[1] AND open < close[1]
buysignal = bearpattern
sellsignal = bullishpattern
// Conditions to enter long positions
IF NOT LongOnMarket AND buysignal THEN
BUY Size CONTRACTS AT MARKET
ENDIF
// Conditions to exit long positions
If LongOnMarket AND bearishengulfing THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
IF NOT ShortOnMarket AND sellsignal THEN
SELLSHORT Size CONTRACTS AT MARKET
ENDIF
// Conditions to exit short positions
IF ShortOnMarket AND BullishEngulfing THEN
EXITSHORT AT MARKET
ENDIF
set stop ploss StopLoss
// Stops and targets : Enter your protection stops and profit targets here
Hi Stanton, thanks for sharing your new strategy.
Seems interesting but I think you did not included the spread into your backtests. I get very different results and a loosing strategy, sorry mate. That’s why I moved your post from the library pending review list to a new forum topic instead.
Hi Nicolas
I used a spread of 0.6 pips.
I see with a spread of 2 its a loosing strategy.
On IG is the spread not 0.6 pips
| Spot EUR/USD |
$1 |
0.6 |
0.95 |
1.5% |
You should enlarge your spread at least to 1 pip because of slippage and execution speed, and see how it performs in backtests.