http://www.stevehopwoodforex.com/phpBB3 ... 211#p19211
For those of you new to all this, scooby-doo is a former pro trader with the big banks; the rest of us have been benefiting from his invaluable advice for a couple of years. squalou is a fantastic coder who has helped me out of a jam many times in recent years; you use his code every time you use the trading-hours function in my EA's (which reminded me that there was no appreciation in the shell code - I have put that right, sq).
scoobs is responsible for my favourite trend-spotting method. He stated that a 20 period D1 Rsi identifies a trend:
- Rsi > 55: trend is up. Look for trades when Rsl rises above 50.
Rsi < 45: trend is down. Look for trades when Rsl falls below 50.
Rsi in between these two numbers: market is ranging.
In broad terms, sq's indi shows areas that represented support or resistance at some stage in the past. The more recent the better, but as a market approaches its all-time hilo, these areas become fewer and further apart. Turquoise represents the next area of resistance; brown the most recent support.
It occurred to me a couple of weeks ago that I can use the indi in combination with Rsi trend-detection, so I came up with this:
- Identify a trend using Rsi.
Trade in the direction of the trend, using a break of the next resistance (buy) or support (sell) level shown by sq's indi.
Some detail:
- Trend indentification and trade setup: I want Rsi both to be trending and moving in the right direction. I cobbled together the 'Rsi trend display indi'. This is a multi-pair indi: you can see how to enter/delete pairs; ignore pair suffixes - the indi spots them. The bracketed figure is yesterday's Rsi; I need it to be lower than today for a buy trade, higher for a sell. When I see a trade setup available because there is a tradable trend, I look for the trade trigger by going to the individual chart and add the 'Everything' template.
D1 Daily S&R and the trade trigger: Looking at the attached pic, Rsi is telling me that there is a long trend in place. I wait until an H1 candle opens above the next resistance - you can see the buy trade that I took. You can also see the "Waiting to Buy" legend at the top right of the screen, and the dashed yellow line just above the top resistance line. I do not want to have to hang around the screen all day, nor do I want to have to check every hour, so this is where the EA's come in.
The EA's- Waiting to Buy is monitoring the chart for a candle opening above the next resistance line, (Use Waiting to Sell below the next support in a downtrend).
TradePrice is the input that you use to specify an exact price or:
DefaultPips draws the line this number of pips away from the market if TradePrice is set to zero. You can adjust this manually by selecting and moving the line; you will see the EA react to the move by changing the screen display.
The EA will prompt for confirmation that you require it to proceed when you first load it up, then on subsequent occasions such as platform restart or chart timeframe change.
The EA will turn itself off once it has sent a trade, so the safety feature is there to remind you that it is still running, should you forget.
Highest lowest ever indi: A number of pairs are close to their all-time hilo, so I do not want to be trading into that. This indi draws a solid, thick yellow line at these extremes.
MTF_Rsi indi: keeps the D1(20) Rsi visible all the time.
Trade exit: I am not using an initial stop loss. Whether or not I use a take profit depends on circumstances. If the next support/resistance is the all-time hilo, then this is my tp.- - manual closure for whatever reason. I will close any trade when Rsi retreats into a range.
- closure at a jumping stop loss. I will move the stop to lock in profits after a decent move in my favour.
News: I take little notice of this. News releases that were causing terror a few months ago cause barely a ripple these days; not even NFP causes much more than a release of pent-up energy into the markets that we need for trading.
Swap: This is a personal thing, but I do not want to be on the wrong side of the high-swap pairs. A trending pair will consolidate, sometimes for several days. This is OK if the pair pays decent swap (AUDUSD for example) but is an absolute so-and-so if it costs substantial swap. - Waiting to Buy is monitoring the chart for a candle opening above the next resistance line, (Use Waiting to Sell below the next support in a downtrend).
Do not uses this software on live accounts just yet. Granted, there is not too much to go wrong with the coding, but remember my signature. It is not a joke.
In addition to the Waiting EA's, I have created some trade-stacking software so that we can set up an EA to take the next x trades.
There are coding problems involved with using a single EA to send multiple trades at multiple levels that are not necessarily the same distance apart. I have addressed this by creating two scripts and an EA.
The scripts:
- These are:
- 1) Long trade stacker script.mq4
2) Short trade stacker script.mq4
- StackDistance is the distance in pips between lines as a default starter.
TradesToStack is the number of lines to create
There is a line colour input.
- 1) Long trade stacker script.mq4
- The line colours must match those of the scripts, so if you change the script line colours remember to change them in the EA as well.
TradeAtCandleOpen tells the EA to wait until the candle opens above (buy) or below (sell) the next trade line. If set to false, the EA wil trade immediately the market breeches the line.- TimeFrame is the time frame for the candle that must open before a trade is sent. The default is the H1, as posited earlier in this post. Change this to 0 to mean 'current chart TF'.
In conclusion
So, there you go folks; I cannot think of anything else to add for now. I do not guarantee this will work for you. I do not guarantee that it will always work for me, but it has made a great start. Also, it strikes me that you can use sq's indi as the trigger, whatever is your setup.
I do not envisage being able to automate this; it is purely a manual strategy with some automation to help get the trades in on time.