Hma Ea - page 2

 

Consider a signal that always reaps a profit, eventually. Say that profit ranges between 15 to 21 pips per trade with a mean average of 18 pips. The drawdown mean average is 47 pips. Clearly then, a strategy that involved placing a stop loss beyond the drawdown mean average would ultimately yield a healthy sum. However this can not achieved unless these two values are known. How do find this information using strategy tester? One way to achieve this would be to manually note each trade as a signal was generated. Then calculate the number of pips in which it is +ve and in our favour and also the number of pips it is -ve and out of favour. We would also need to know whether or not each trade was successful or not. To define whether or not a trade is successful we need to know if the trade ever had a +ve effect on NAV. If this was ever the case then the trade could be considered successful. Defining an unsuccessful trade is slightly different. Barring the effect of the spread on NAV, an unsuccessful trade could only be considered such if it only ever produced a -ve effect on NAV. I wonder just how many trades only ever have a -ve effect on NAV?

 

As things stand, MT4's strategy tester only provides us with limited information about each trade. There is much more that we need to know in order to process each trade's data before we can make further progress with our strategies. Other than manually monitoring and calculating each trade as it happens, noting down the values and then using a spreadsheet to process same, I do not know of any other way to achieve what we need. Has anyone any thoughts about this?

 

What we need a more comprehensive strategy tester capable of evaluating each trade individually. A tester that is able to show us whether, given a signal generated by MQL code, a trade is successful and by what degree of success it attained.

 

Consider these 4 trades below, taken using a HMA strategy of executing a trade on a signal. According to the statistics, with '0' denoting a loss and a '1' denoting a win, the ratio of wins to losses is 1:3. Would this be considered a worthless strategy?

In each case, each trade at some point generated a +ve effect on NAV and so at some point in each trade the win to loss ratio as 4:0. It could equally be said that the win to loss ratio was at some point 0:4 as each trade at some point had either a +ve or -ve effect on NAV. However, as it is that we are trying to effect more +ve trades than -ve trades it could be argued that trading each signal is profitable.

 

These trades would show us that in order to profit by up to 54 pips, it's posssible that at any time a trade could cause a drawdown of up to -44 pips.

 

It's these figures that we need to know. Other than manually jotting down each trades pip range, how can we get these figures?

 

Is it possible to write columns to the strategy tester results tab? If it is then an EA could calculate both the +ve and -ve range in pips from entry and pass the results to the strategy tester which could display these columns in the results tab. The EA could also use this data to optimise the strategy.

 

I'll try to do something with this idea.

Now I made 1st step in this direction and I've developed TesterReport_v1.

which shows Balance and Equity.

Just try to attach this indicator during visual testing of HMAExpert_v1.1 (with VisualMode=1).

Files:
 

igorad, It's a interesting start although balance and equity can be seen from the results tab can it not? What's needed is the +ve and -ve range for each trade per signal irrespective of whether or not it was a winning trade or loosing trade. If we find that an EA frequently turns a +20 / +24 pip profit (based on it's +ve/-ve pip range) yet often closes and reverses the trade when not in profit, this opportunity will be easily missed.

 

Pip range visual aid

Here's an idea of how it could look on a chart. Using a separate window for the pip range, I have drawn a zero line to represent how the trade performs in relation to the trade entry. Long trades we want to see above the zero line and short trades we want to see below the zero line.

The first trade signals us to get long. From the chart diagram we can see that the long trade was almost always +ve (as shown by the white line) bar a small dip below the zero line. The trade ended inprofit. The extent to which our long trade goes against our favour is shown by it number of pips below the zero line it has dipped.

The second trade signals us to get short. From the diagram we can see that the short trade has had limited success so far, dipping above and below the zero line. The extent to which our short trade goes against our favour is shown by it number of pips above the zero line it has risen.

Files:
pip_range.gif  22 kb
Reason: