A big ask

 

Attached are an expert advisor, mySARea.mq4 and the indicator it uses, myParabolic.mq4. The EA follows the rules of SAR (stop and reverse) with the addition of a fixed trailing stop. It was tested with EURUSD_M15.

I have three very great favours to ask of the gurus on this forum:

  1. Would you please cast your eye over the code and tell me if I have made some glaring mistakes. The code seems to work OK in Strategy Tester and live trading in a real money account. It seems to get itself confused in a demo account, where it doesn't return the correct value for SarStop.
  2. Would you please compile the code and test it with different settings for the fixed trailing stop, which is a two-edged sword. At times, it prevents a bigger loss or produces a bigger profit compared with using SAR stops only, and at other times it prevents a bigger profit.
  3. Most importantly, would you please suggest what filter I could use to prevent the EA from taking a position when the market is likely to be drifting? The SAR method is great in a trending market but deadly when the market whipsaws.
Thank you for a great forum, Helmut
Files:
mysarea.mq4  11 kb
 

Well I'm not a guru but here's what I've got thus far:

1)Does the demo have the same properties as the real account? I had to normalize double to get the below backtests done.

 

2)Only worked on Open-backtests 15-Eur/Usd. Pf: 1.26 and 9 trades from 1/1/2010 to today. I get alot of error 130 in Tick-backtests which means your stoploss are not compatible with my brokers. I also get allot of order modify error#1.

 

3)None - this approach never worked for me using SAR. SAR and DeMarker where among the first TA indicators I investigated simply because they're easier to code and understand. The best filter I can recommend to anyone is Time. The next one would maybe be Volume.

 
ubzen:

Well I'm not a guru but here's what I've got thus far:

1)Does the demo have the same properties as the real account? I had to normalize double to get the below backtests done.

2)Only worked on Open-backtests 15-Eur/Usd. Pf: 1.26 and 9 trades from 1/1/2010 to today. I get alot of error 130 in Tick-backtests which means your stoploss are not compatible with my brokers. I also get allot of order modify error#1.

3)None - this approach never worked for me using SAR. SAR and DeMarker where among the first TA indicators I investigated simply because they're easier to code and understand. The best filter I can recommend to anyone is Time. The next one would maybe be Volume.

Thank you, ubzen, for your quick response.

To 1) I discovered that the demo account was still running an older version of myParabolic, which explains why the numbers in Comment were different from the values on the chart.

To 2) I use FXOpen ECN/STP, which has very tight spreads and no problem with tight stop losses. The problem could be your broker.

To 3) I like DeMarker and shall give it a go. Finding a good filter that keeps the good trades and avoids the bad ones is not easy.

Keep up the good work, Helmut

 
I also use FxOpen, but I intend to use the dealing desk because of the fixed spreads. Are the Floating spreads and Commissions really worth the ECN? From my guess, the above EA is designed to work in Scalper form (tight SL and Tp) with bid/ask above or below SAR. Considering the spreads and commissions, did this really produce profitable results in your backtests? I know the ECN have 5-digits pricing but don't they also have Set sl and tp targets form current price?
 
ubzen:
I also use FxOpen, but I intend to use the dealing desk because of the fixed spreads. Are the Floating spreads and Commissions really worth the ECN? From my guess, the above EA is designed to work in Scalper form (tight SL and Tp) with bid/ask above or below SAR. Considering the spreads and commissions, did this really produce profitable results in your backtests? I know the ECN have 5-digits pricing but don't they also have Set sl and tp targets form current price?
No set sl and tp. You can even place pending orders of 1.0+ lots WITHIN the spread. Almost as good as being a market maker. Well worth the commission of 0.7 pips.
 
Cool 8)
 

EC

> The SAR method is great in a trending market but deadly when the market whipsaws.

IMHO SAR is the worst whipsawed indi - it doesnt help that its origins are for stop-loss movement not trade entry....

> suggest what filter I could use to prevent the EA from taking a position when the market is likely to be drifting?

IMHO - This is the hardest thing to do, particularly as a pure trend only happens for such a small part of market time...

Look at these

https://www.mql5.com/en/code/8328

https://www.mql5.com/go?link=http://forex.eazel.com/2006/05/31/vhf-indicator/

https://docs.mql4.com/indicators/iADX

You also might want to use the ATR as an additional filter to see if there might be follow through...

But.......

Most of all, good trends are so few in number, I suggest you look for almost anything else!
At least stop the EA trading at poor times of day (for the pair) and when the D1 20 ATR is simply too low for follow through

FWIW
-BB-

 
BarrowBoy:

You also might want to use the ATR as an additional filter to see if there might be follow through...

But.......

Most of all, good trends are so few in number, I suggest you look for almost anything else!
At least stop the EA trading at poor times of day (for the pair) and when the D1 20 ATR is simply too low for follow through

FWIW
-BB-

Thank you, BB

I'll study the articles you recommend.

SAR is not only a stop mechanism but also an entry signal (Stop and Reverse!).

When it's good, it's very good - yesterday caught 133 pips in one move.

When it's bad, it's very bad - I saw seventeen (17!) consecutive losses in back testing.

But I do look at the chart and when I suspect trouble I trigger the "stoptrading" option.

Better to miss out on a good trade than be locked into a bad one.

The problem is that it is difficult to mechanize the human thought processes.

Thanks again, Helmut

Reason: