Stop Loss / Take Profit

Today I did some optimizations on Stop loss and Take Profit with the Omar_MACD strat.

Obviously the trending strategy will close out its own positions when the market turns against it, so strictly speaking a stop loss may not be necessary. However, in the case of flash crashes or perhaps network problems, I would feel more comfortable if a stop loss was set.

Previous (brief) testing of stop loss simply lead to significant losses. However, today, for the period of Jan 1st 2012 to June 8th 2013, introducing a trailing stop loss of 180pips did yield slightly more PnL gain than having no stop loss. Results below:

NO STOP LOSS STATISTICS   STOP LOSS
STATISTICS
 
Total profit/loss

18,452.79

Total profit/loss

18,692.86

Total profit of all trades

78,706.30

Total profit of all trades

79,910.70

Total loss of all trades

60,253.50

Total loss of all trades

61,217.84

Balance statistics:   Balance statistics:  
Start balance

7,000.00

Start balance

7,000.00

Final balance

25,452.79

Final balance

25,692.86

Minimal balance

5,615.82

Minimal balance

5,615.82

TRADES STATISTICS   TRADES STATISTICS  
Number of trades closed

252

Number of trades closed

255

Number of profit trades 111 (44.0%) Number of profit trades 111 (43.5%)
Number of loss trades 141 (56.0%) Number of loss trades 144 (56.5%)

What’s interesting to note here is the number of loss trades went up when the stop loss was introduced but no more winning trades were introduced… so for some reason after closing out trades, new trades were introduced that simply lead to more losses. Looking into this I identified one case.

In the above picture, we can see that

  • the stop loss was executed (AUD/JPY on 07/06/2013 @ 92.343) and then
  • a new trade was opened (in the loop – AUD/JPY on 07/06/2013 11:00:00 @ 92.332) which
  • was closed out later at a 175pip loss (AUD/JPY on 07/06/2013 14:00:00 @ 92.494)

Another instance of this occurrence meant a 266 pip loss.

Idea: This situation can probably be avoided by making sure we do not open positions in the opposite direction as the gradient of the fast line (slow line – test??). So it should be possible to

Trying to optimize the take profit was very confusing. Certainly, the strategy could be fine tuned/optimized such that it made more money, however, the results did not show any consistency. A snapshot of the best results below, all for the same final balance, show the stop parameter values all over the place (half of them don’t even have the Stop Order set).

I’m not convinced that optimizing the take profit/limit values this way is acceptable. It is simply fine tuning it to produce the perfect profit that would only work on those price trends. Regardless, I think I need to fix the problem mentioned above before I can optimize stop loss.

Moving along, backtesting using the current optimal parameters against a longer timeframe (FXCM’s tools are limited to 42 months) showed something rather concerning. From June 2010 to about March 2011, it shows non-stop losses. Using a balance of only $7000 would mean I get margin called. This is really worrying and I need to examine this loss area more to figure out what went wrong.

Quick backtesting shows that it is possible to optimize the formula to make money in this market, mostly by preventing whipsaw and only entering trades for longer trends. However, this does not provide optimal performance when the market is more volatile (2012 and 2013 for example).

There probably is no perfect strategy that can work in all market conditions. If I am able to identify when this strategy is failing and possibly run a different strategy that is profitable during this market, that would be ideal.

Question: How do I identify that this market is loss making. Need to investigate the losses more?

Posted in Backtesting, Money Management, Optimization, Research and tagged , , , , , , , .

Leave a Reply

Your email address will not be published. Required fields are marked *