A logical way of backtesting

 

I have a trend unfriendly (reversal) strategy which works well but fails well also. I have it coded by 90% but its in form of an indicator and not ready to run on strategy tester

If i want to know what caused failure, any optimization method or AI program may provide solution in a better way but I do not know how to think in a logical way to solve this problem by recognizing the cause which make my strategy to fail. I have ideas but Its very troublesome and time consuming work to do manual backtesting on each of ideas one by one, so please suggest me any way which help me solve the problem.


List of ideas i have:

1. I consider when price falls sharply, most of reversal strategy dont work, I consider this as a TP reversal level where price reverse because of profit booking. When price have to go in a trend direction it goes by creating swings and have pullbacks of more than 50%

2. I consider consolidation on tops and bottom as a factor to reduce failures on my strategy

3. I consider pullbacks

4. I consider price extension of previous swing XA

5. I consider engulfs on top and bottom

If you have any more ideas that I should include in my backtest, please inform.

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
What are the differences between the three modes of testing in MetaTrader 5, and what should be particularly looked for? How does the testing of an EA, trading simultaneously on multiple instruments, take place? When and how are the indicator values calculated during testing, and how are the events handled? How to synchronize the bars from different instruments during testing in an "open prices only" mode? This article aims to provide answers to these and many other questions.
 
Rodger Sen:

I have a trend unfriendly (reversal) strategy which works well but fails well also. I have it coded by 90% but its in form of an indicator and not ready to run on strategy tester

If i want to know what caused failure, any optimization method or AI program may provide solution in a better way but I do not know how to think in a logical way to solve this problem by recognizing the cause which make my strategy to fail. I have ideas but Its very troublesome and time consuming work to do manual backtesting on each of ideas one by one, so please suggest me any way which help me solve the problem.


List of ideas i have:

1. I consider when price falls sharply, most of reversal strategy dont work, I consider this as a TP reversal level where price reverse because of profit booking. When price have to go in a trend direction it goes by creating swings and have pullbacks of more than 50%

2. I consider consolidation on tops and bottom as a factor to reduce failures on my strategy

3. I consider pullbacks

4. I consider price extension of previous swing XA

5. I consider engulfs on top and bottom

If you have any more ideas that I should include in my backtest, please inform.

I would say there are multiple ways to approach this.

You could try with more technical analysis. iE use ichimoku system (not only the indicator) as this system has a strategy for trends. You could take a look at Wyckoff accumulation/distribution. Although you would need to soften it a bit to make it work.

Money and Risk management.
Trends are a shift of the range you are trading. Although not the best approach, but hedging your positions while trending would shift them to your new range area. But here you need to see if hedging is cheaper than closing or stop-loss-ing.

Position based management:
You could, after a certain amount of losses, come to the conclusion, you are in a trend market, and stop opening positions, but create virtual positions until one if them is positive again and then continue your trading live.

Since these are very dependent on the strategy you are using, you need to figure this out somehow, or combine multiple techniques.

I am sure there are other options available as well. These are just my first ideas.

Another option could be to do "reverse martingale". - Problem with martingale is, it focuses on losses instead of winning. if your strategy has an average consecutive win sequence, you could employ this to manage your sizing and risk. Here is what I mean:

First trade is a win, you risked .5% You take half your profit to finance the next positions risk. And you do that subsequent for the following positions, for as often as your average win sequence is. This way you will compound your profits by your risk factor and your gains could increase.

Since martingale has a win chance of about 36%, this will in reverse turn your losses to profits, and you could achieve a gain of around 64%, according to the statistical outcome.

But, all these techniques are specific to your trading systems statistics. You need to know that precisely, so that you can find the best counterfeit to the weaknesses.