High risk reward ratio strategy need EA

Hi pipsteve, useless23, and all,

Flush with my success with High Risk Reward Ratio V6 (HRRR_V6) I thought I would see if similar code changes would work on HRRR_V7.

Version seven (V7) was designed to open two consecutive orders if the market is trending and take advantage of a continuing trend. Also as one trade hits its Take Profit (TP) the other trade is already heading towards its own TP. In this way you get a leap frogging action as the trend continues. There is nothing like watching two trades reach their TP at more or less the same time.

The problem with V6 was that although it backtested well on EURJPY daily data, with a profit of $3892.04 risking only $1.00 a pip over the last eighteen months, it probably didn’t make Holy Grail status as it only traded 63 times. The expectancy was great at 0.47 but only 63 trades was two low to be Holy Grail.

I did a few quick tests on lower timeframes but daily was best.

So, sticking with EURJPY, I prefer Yen pairs EUR and USD as I believe they trend better than other pairs. I modified V7 with the same code changes as V6, so that the EA only trades once a day on daily charts or six times a day on four hour charts etc, etc.

Wow!!! could this be the Holy Grail of trading systems…

Regards, Trader9.

P. S. What about V8 that was designed to open three trades in any one direction.

Hi Trader,

Good work. I wish to be clear on what it is you’ve tested. Let me know if any of the conditions are wrong or need amending.

  1. For long positions 6ema (shift 1) must be above 26ema.
  2. For short positions 6ema must be below 26ema.
  3. If long we buy the value given by the 6ema shift 1.
  4. If short we sell the value given by the 6ema shift 1.
  5. STOP loss is 2xatr or previous bar low whichever is greater.
  6. Profit target is 2x stop loss (4xatr)

Did you use a trailing stop in your testing?

Hi useless23,

I have attached the strategy tester results for testing every tick and this contains all the parameters used for D1 EURJPY. I think the ones you have relate to the original system. I have now split buy & sell trades and each has its own TS and TP.

FastMAPeriod=1.
FastMaShift=0.
SlowMAPeriod=7.
LongTrailBreakEvenStop=75.
ShortTrailBreakEvenStop=5. Bit odd this low value but I guess it relates to only moving once a day.
LongTakeProfit=235.
ShortTakeProfit=245.
MinStopMultiple=2, this means if going long the StopLoss is either below the last bar low or 2*ATR(14) whichever is the greater. The stop is trailed, but only once a day on D1 data i.e daily chart.

StrategyTester_HRRR_V6_EURJPY_Tick.htm.zip (7.78 KB)

I have not heard from pipsteve, but if he is happy I could post the V6 EA here.

Early tests on version V7A show a marked improvement of 132 trades and 4944.60 profit for D1 on EURJPY, but the draw down was a lot worse. V7 will open up to two consecutive trades in any one direction and V8 three trades, but that is still being tested.

Also V7A looks like it would trade on lower timeframes as I made a mistake and ran it on H4 EURJPY and got 6156 profit on 94 trades and a low drawdown of only 488. 79 profitable trades giving 84.04% win.

All pretty exciting stuff, but the biggest improvement is that every tick testing results equal the Open prices only results so testing can be a lot quicker. Also I use 5pip steps for testing stops and take profit so I don’t over optimise.

Hope this helps, Trader9.

Hi Trader,

Were you moving averages 1EMA and 8EMA?

Hi useless23,

Sorry, they were EMA. The original parameters you had were for EURUSD I think, I prefer USDJPY and EURJPY as they tend to trend a little better at times. I know pipsteve was experimenting with weighted MA’s as well.

Pipsteve was using daily charts and the equity curve is smoother on the higher timeframes with lower drawdowns.

The biggest problem seems to be as the market goes from long to short or back again, as this system can have bad whipsaw losses.

Have a great weekend.

Regards, Trader9.

Hi pipsteve,

I have made many improvements to your High Risk Reward Ratio EA.

The first was to encompass all the operational code within the trade cycle. Now all trading operations update only once per chart period.

For instance on a four hour charts which I have found to be the most profitable especially on USDJPY, GBPUSD and EURJPY in that order, trades are opened, stops trailed, exits checked, additional orders placed or old limit orders not filled, closed, once every four hours.

Because of this backtesting in the MT4 strategy tester using Open prices only for optimisation, usually produces very, very similar results with Every tick testing.
So backtesting time is reduced to a minimum, as every tick testing only needs to be run once to confirm parameters did work on historical data.

Results using H4 GBPUSD open prices only testing on data Jan 2013 to date, 1000 acc, 0.1 lot size.

This is the original version that opens a single trade in either direction
V6AA - Gain 3136 on 165 trades 117 wins (70.91%) average win 53.56 average loss -65.22.

This uses all the same logic as V6AA but in a sustained trend will open up to two trades in any one direction.
V7AA - Gain 5008 on 130 trades 85 wins (65.38%) average win 99.22 average loss -76.08.

This uses all the same logic as V6AA but in a sustained trend will open up to three trades in any one direction.
V8AA - Gain 5445 on 239 trades 119 wins (49.76%) average win 97.52 average loss -51.33.

Thats, it.

Regards, Trader9.

hi, trader009:
any chance you could post this EA here? THX.

P.S. I’ve also sent you a PM.

Hi zhangshuo,

The EA goes in your Experts folder.
High_Risk_Reward_Ratio_V6AA.ex4.zip (68.8 KB)
The Includes file goes in your includes folder.
IncludeExample.mqh.zip (2.85 KB)
Test report for H4 EURJPY
StrategyTester_HRRR_V6AA_EURJPY_H4.htm.zip (18.3 KB)

I did reply to your PM, but was unable to attach the EA. An explanation of all the external parameters is in my PM to you.

I welcome all feedback.

Regards, Trader9.

hi, trader:
thank you very much for your reply and PM. So basically I just add the EA and other files into the correct folder and attach the EA to a 4-hour chart, it’s good to go?
Also what improvements (if any) did you make with regard to the strategy behind this EA, cos I don’t think you’re sticking with the original one by pipjsteve. Care explain that here? THX

Hi All,

Here is a chart of the four hour EURJPY showing the V8A version of this EA in action.


This EA will place up to three trades in any direction. This of course was the perfect trade with all three trades hitting the TP and getting in right at the start of the trend.

Profit on this one trade was an amazing 3 trades x $393.96 on a $1000.00 account using 2% of equity on every trade. A gain of 118% in the second week of the test period Jan 2013.

In MT4 strategy tester using open prices only for which this EA is designed to work, this EA made $10,638.97 gross profit with 216 trades, 112 (51.85%) profitable trades with an average profit of $179.74 and average loss of -$91.27. Drawdown was $1296.66(13.29%).

This EA seems to work in two different ways when tested in the strategy tester.

It should have a fast and a slower moving average and then when the fast is above the slower place buy limit orders at the close level of each previous bar which it hopes will become market orders after a small pullback in the next bar. This is then trailed to the take profit or stopped out at some point.

However, the strategy tester in testing all options sometimes comes up with a combination of a faster slow moving average that the fast. This at first would appear to be wrong, and it is, but the results are better than any normally faster and slower combination. This is because in this situation the buy limit is triggered early right at the start of the trend when you get a higher close but the EMA’s haven’t yet crossed. Or often on a short pullback in the trend and thus the trade gets in at a better price.

In the chart here you can see this in action and all three trades maximize there potential by getting in at the beginning of the trend and hitting the take profit. Three perfect trades.

Regards, Trader9.

So, just let me get this straight, you’re using a 4ema and a 6ema.

long positions:

  1. 4ema is BELOW 6ema.
  2. There is a higher close.
  3. You buy a retrace to the 6ema

Is that about right?

Hi zhangshuo,

Well there are a number of problems with using the strategy tester in MT4. In a perfect world one set of parameters that work on all pairs in all time frames would be nice. However, life is a little more complicated than that and some pairs trend better than others so are good for trend trading, USDJPY and EURJPY.

Other pairs are more volatile and are better for trading breakouts. So you need to carry out some form of testing to find what works with what. You can do a quick & dirty test using “open prices only” to get some ball park numbers for your EA’s parameters. But if you wanted to be sure that your prized EA was a winner then you have to test it on historic every tick data to be sure you stand a chance of it working at all in the future.

Optimising, using every tick takes about two weeks for every test on my PC, but Open prices only takes only a few minutes.

So to cut a long story short, the changes I made were to get the EA to test as well on every tick data as it had on open prices only data. So once you had your “ball park” parameters they would give similar results without waiting two weeks.

To that end in my previous posts I mentioned that letting trades complete was better than cutting them short. Example, you are in a long trade and there is a pullback and you get a short signal.
Normally most EA’s might open the short and close the long trade, but my testing has proved to me that often the short trade then failed and the trend continued with out you. So now I don’t always close all longs if I get a short signal.

Also I found that todays market is very volatile and a trailing stop can often get hit. So now I only trail my stops once on every new bar.

Also when we were developing this strategy we were opening a limit order and if it was not triggered we would update it with new entry value, stop and take profit values on the next bar. But unfortunately you can’t update the lot size, so it was decided to delete the limit order and create a new one on every new bar. As this system was for day bars then the number of cancelled orders was not to bad. I have found H4 is the best timeframe though.

So in order to achieve an EA that could be backtested quickly using open prices only I had to move all the trading code, trailing stops etc inside the trading code loop, so nothing happened between bars. Oh I did just add an exit check to close any trades if the moving averages had re-crossed, all within the trading loop. Which now only runs once every four hours on a H4 chart. Or once a day on a D1 chart.

There are other benefits to this approach. Say you were trailing your stop on a moving average normally. As the stock moves higher during the four hour period normally your stop would follow. Not so my stop, as it sits and waits for four hours before moving up. But during that four hours a spike takes out your stop and your trade, but not mine, as it was patiently waiting at a lower level for the bar to complete before moving up.

So in essence there are no real changes just modifications to make testing easier and the EA more robust.

Sorry for such a long answer.

Regards, Trader9.

Hi useless23,

Sorry, this must seem nuts to you. Grab a copy of the EA and try it out.

The actual long entry code is FastMA>SlowMA & Bid>FastMA & Bid>Low, so Bid is the current bid price and low is the previous bar low.

The initial long stop size is FastMA-Low (previous) + 1 pip or a multiple of the ATR(14) as found during testing. Whichever is the greater.

Entry price for the buy limit order is the FastMA value, automatically adjusted below any broker restrictions. Brokers won’t allow you to place trades very close the the Bid, Ask spread so they set a limit of how close you can get. This will adjust the price if need be.

Yes the fast EMA is 6 and the slow EMA is 4.

More nuts, but if you read the post with the chart on it is explained. Normally the limit orders are placed on the FastMA below the new bar open, broker permitting. If the new bar retraces a little and the Ask value dips to the entry price then you are long. If it does not then next bar you try again and so on.

Where the FASTMA is Slower than the SLOWMA then if FastMA>SlowMA & Bid>FastMA & Bid>Low and the EMA’s are reversed there is a very narrow opportunity to get in a limit order right at the start of a new trend. Also this condition can exist on a pull back in the trend. However, the normal limit order on every new bar won’t work in this situation.

This seems to be a fluke of the backtesting finding more profitable trading parameters for this style of trading.

Treat yourself to a free copy of the EA and try some backtesting.

Regards, Trader9.

hi, trader9, thx for your reply. But can you maybe explain with a couple of charts about long and short entry and exit, stop-loss, etc? THX

I am not understanding your strategy how you want to place orders…:frowning:

maqboolahed392

Please go back to the first post on this subject by pipsteve and all is explained.

Regards, Trader9.

Why’s that?