No martingale, no grid.
The strategy tries to make a few pips in the high volatility chaos around support/resistance levels. The idea is that institutional traders will try to stop out technical traders (reversal and also breakout) leading to a statistically higher volatility at important price levels.
The strategy is mainly designed for EURUSD (H1).For live performance please take a look at my signals (the new version with reduced risk only started September 2017). For tick data backtests including execution delay please see the comment section.
You need a broker with low spread, good execution and without minimum stop distance for this strategy to work. The strategy will always use chart data from the H1 timeframe no matter what chart you set it to.
Trade on your own risk. I highly recommend not to risk more than 1% of your account per trade.
- magic - individual magic number for the strategy. If zero, it also handles manual trades.
- orderComment - Comment that will be visible in the Trade tab.
- pipInPoints - for 5-digit brokers, this should be 10, for 4-digit brokers 1.
- allowBuy - allow buy orders. For USDJPY sell orders were better.
- allowSell - allow sell orders.
- lotType - "fixed" or "increasing", where the lot size is calculated automatically.
- fixLots - fixed lot size in case lotType = fixed.
- lotStep - How much the lot size should be increased every equityPerStep (if lotType = increasing).
- equityPerStep - How much equity is needed for one lot step (if lotType = increasing).
- slippage - maximum allowed slippage.
- maxOpenPostionsPerDirection=2 - there will always only be one pending order in each direction. But if this value is 2 it will allow to also open a pending order when there is already one filled.
- entrySensitivity - higher value would lead to more trades, but probably less profitable ones.
- minSecondsBetweenModify - minimum time interval between modification of pending orders.
- minMinutesBetweenNewPendings - minimum time interval between opening of pending orders.
- clearLevelsOnSunday - If true the memory of levels will be cleared every Sunday. This was better in backtest, but it might miss a few trade opportunities.
- stopLoss - maximum stop loss used.
- takeProfit - take profit for trade exit. But usually the strategy will exit via trailing stop.
- trailingStop - trailing stop in pips.
- trailingStart - when to start the trailing stop.
- trailingStep - step size to modify the stop loss.
- useIncrementalTrailing - additional stop loss modification.
- useBreakEven - whether to use breakeven option or not.
- breakEvenAt - when to set the breakeven stop loss.
- breakEvenTo - how many pips above/below the entry price the breakeven stop loss should be placed.
- closeAfterMaxTradeDuration - close after a given trade duration.
- maxTradeDurationMinutes - maximum duration (if closeAfterMaxTradeDuration=true).
- closeOnFastReversal - close if the price moves fast against the position.
- fastPips - Pip move per second (if closeOnFastReversal=true).
- tradeHoursMondayGMT - which hours to trade on Monday (list of values between 0-23 separated by comma ",").
- tradeHoursTuesdayGMT - which hours to trade on Tuesday.
- tradeHoursWednesdayGMT - which hours to trade on Wednesday.
- tradeHoursThursdayGMT - which hours to trade on Thursday.
- tradeHoursFridayGMT - which hours to trade on Friday.
- startHourGMT - when to start trading (GMT).
- endHourGMT - when to stop trading (GMT).
- fridayEndHourGMT - when to stop trading (GMT) on Fridays.
- skipWeekend - whether to skip Saturday and Sunday.
- closeFilledPositionsOnFriday - whether to close all positions on Friday.
- fridayCloseHourGMT - when to close open positions (if closeFilledPositionsOnFriday=true).
- nightStartHourGMT - to define night start time (for minMinutesBetweenNewPendingsNight).
- nightEndHourGMT - to define night end time.
- minMinutesBetweenNewPendingsNight - If you decided to also use it during nights, you can increase the minimum time between opening of new pending orders during night time.
Image credit: Yuri_B
- Added parameter orderComment so that users can specify the comment themselves.
1. Negative trailingStart values are now allowed, so EURUSD_C.set can be used. See comment section for setting files.
2. users can now set for every single hour during the week whether to trade or not. But in my view this can lead to over-optimization, so I don't filter any hours myself.
tradeHoursMondayGMT - which hours to trade on Monday (list of values between 0-23 separated by comma ",").
tradeHoursTuesdayGMT - which hours to trade on Tuesday.
tradeHoursWednesdayGMT - which hours to trade on Wednesday.
tradeHoursThursdayGMT - which hours to trade on Thursday.
tradeHoursFridayGMT - which hours to trade on Friday.
1) There was a small visual bug that did not show the trade number in the stats window.
2) clearLevelsOnSunday will now reduce the lookback time so that it only uses most recent levels.
With clearLevelsOnSunday=true and entrySensitivity=10 it should trade exactly as version 1.5 did (more conservative).
The new version should be a bit more balance and have more entries.
Also there were some visual changes.
If this parameter is true, it will clear the memory of old levels every Sunday. Interestingly, this is more profitable in backtest, because intra-week levels seem to be more important. But it also means that you might miss a few trade opportunities. So now you can decide whether to use or not:
clearLevelsOnSunday = true
Percentage risk calculation can lead to very high lot sizes when you use a small SL. So I prefer to use a solution, where the lot size just depends on the equity:
equityLotStep = 0.01
equityPerStep = 500
Usually the EA only looks back a small time interval and remembers the important levels. The memory is reset if you turn the EA off and on again, which could lead to missing trade entries.
Now on initiation the EA will have a greater lookback period. This way turning the EA on/off should not miss trades anymore.
Also I added some parameters:
entrySensitivity = 10
If it is higher, the strategy will have more trades, but probably will smaller profit factor.
maxOpenPostionsPerDirection = 2
There is always only ONE pending order allowed in each direction. But with maxOpenPostionsPerDirection =2, it will allow to open a pending order if there is already one filled, so maximum filled positions will be 2.
closeOnFastReversal = false
fastPips = 0.5
The EA montiors the price movement per second. If closeOnFastReversal=true and the price moves more than fastPips against the position, it will be closed. This increases the profit factor in backtests, but not sure whether it is good in live trading.
closeFlliedPositionsOnFriday - in case you want to close not only pending orders but also filled positions on Friday (at fridayCloseHourGMT).
allowBuy, allowSell - in case you only want one direction. Might be good on safe haven instruments.
These parameters are added, so the risk during a night is reduced. The EA has to wait minMinutesBetweenNewPendingsNight to open a new pending order after opening the last one.
nightStartHourGMT = 20
nightEndHourGMT = 4
minMinutesBetweenNewPendingsNight = 120