1 (edited by Popov 2016-03-11 11:49:30)

Topic: Filter non-linear balance pattern

Hi,

the usage of the "Filter non-linear balance pattern"-filter is a absolutely must for me since I only want strategies that are stable, especially since I generate on data from 1986 to 2016 and the systems should pass all market phases as stable as possible without cluttering up the strategy collection repository as it is only limited to 100 strategies.

I am, however, not sure if this filter always works correctly. As far as I understand it, if I enter "15" for it in the acceptance criteria page, it means that the equity curve can have a max deviation of 15% from the ideal straight line which connects start and end-balance.

Now have a look at this screenshot. The strategy with the red "?" still made it into the repository, despite of my setting of "15" for this filter, as you can see in the second screenshot. I´ve also drawn green lines (ideal equity curve) into the first 3 strategies. While strategy #2 and #3 seem to be OK and could indeed only deviate 15% from the ideal equity curve, strategy #1 clearly is deviating A LOT more than 15% from the ideal equity curve, do we agree? So is this a bug in the filter possibly?

http://s18.postimg.org/u691rtwgp/balance_pattern_01.jpg
http://s17.postimg.org/rgzn4xo8f/balance_pattern_02.jpg

Thank you:)

Re: Filter non-linear balance pattern

I cannot see the numbers well. Are you sure the deviation is more than 15%?

Re: Filter non-linear balance pattern

yes Popov, he is referring to the first graph with ? mark.  obviously more than 15%

Hannah

Re: Filter non-linear balance pattern

hannahis wrote:

yes Popov, he is referring to the first graph with ? mark.  obviously more than 15%

I don't see it so obvious.
I see the reference balance is somewhere about 1 100 000. 15% is going up to  1 265 000.

EDIT

Geektrader, try reducing the max deviation % in order to see at what value the strategy will disappear from the list.

Re: Filter non-linear balance pattern

I zoomed the image.

http://s8.postimg.org/ds47ewlth/screenshot_1445.png

The reference is about 1 072 000. Max acceptable value is 1 232 8000.
I see in the image that max balance is somewhere about 1 219 590.

It is 1% below the limit.

When you report bugs, please refer to facts!

6 (edited by geektrader 2016-03-11 10:09:50)

Re: Filter non-linear balance pattern

Uh? You calculate that from the BALANCE instead of the net profit of the actual strategy? That makes kind of few sense to me to be honest. We want to have a stable equity growth of the NET Profit of the strategy in my opinion, since we want to measure the strategy, not the overall balance growth as changing the initial deposit in the account settings would then also always affect that filter (which it does as I see).

I honestly never saw the stability calculated on the balance in any kind of trading platform. But OK, good to know you do it that way, it´s documented nowhere from what the deviation is calculated, so how should I know? If I´d have known this, I would have stick to the "facts". Should I report further bugs  / strange findings or is this stealing to much of your time?

Re: Filter non-linear balance pattern

The balance line pattern has no connection with the profit.
You can see the formula in the AccountStatistics.cs file at "C:\Program Files\Forex Strategy Builder Pro\User Files\Code" folder.

private double CalculateMaxSmoothBalanceDeviationPercent(IBacktester backtester)
{
    var firstBar = backtester.Strategy.FirstBar;
    var bars = backtester.DataSet.Bars;
    const int checkPoints = 100;
    var netBalance = NetMoneyBalance;
    double startBalance = backtester.Profile.InitialAccount;
    double maxDeviationPercent = 0;

    for (var i = 1; i <= checkPoints; i++)
    {
        var bar = (int) (firstBar + i*((bars - firstBar)/(checkPoints + 1.0)));
        var checkPointBalance = backtester.MoneyBalance(bar);
        var targetBalance = startBalance + i*(netBalance - startBalance)/(checkPoints + 1.0);
        var deviationPercent = Math.Abs((targetBalance - checkPointBalance)/targetBalance);
        if (maxDeviationPercent < deviationPercent)
            maxDeviationPercent = deviationPercent;
    }

    return maxDeviationPercent;
}

8 (edited by geektrader 2016-03-11 10:38:07)

Re: Filter non-linear balance pattern

OK, great, but not everyone is a coder here I guess and it should be documented how this filter works. Maybe you could also simply change it to use the net profit of the strategy instead of the balance for the next update? Would make a lot more sense, since it wouldn´t be affected by balance changes the user might do in the account settings and then wonder why the filter out of sudden doesn´t filter anymore like it did before with another initial balance.

Re: Filter non-linear balance pattern

It is described in the Acceptance Criteria article in the user guide.

The balance line pattern and the Net profit are completely different criteria that can work together. This is the exact example in the guide.

Re: Filter non-linear balance pattern

Yes, I see that, but why not just use the net profit / equity growth of the strategy gains instead of the whole account balance? This would make the filter independent from the initial balance the user sets in the account settings.

Re: Filter non-linear balance pattern

I agree, can we have another type of non-linear filter that measures deviation from the ideal linear graph, it would be useful to search for stability and consistency in EA's performance. 

As a layman (without referring to the guide), I would have made the same assumption as Geektrader too.

Hannah

Re: Filter non-linear balance pattern

Yes, filter could be renamed to "Filter non-linear equity curve pattern" and be based on net profit instead of balance. That would be nice and not confusing anymore and we can change the account balance in the settings and can still keep the same % for the filter, as it will not be affected by the initial balance anymore.

Re: Filter non-linear balance pattern

Hi Mr. Popov,

I´ve tried to change the filter to 1% in the strategy repository to filter strategies that don´t match the non-linear balance pattern AFTERWARDS. I´ve checked "Strategies fulfil Acceptance Criteria", and set the filter to 1%, still it filters nothing in the repository. It seems like the filter has no effect in the repository on already generated strategies at all, even if the "Strategies fulfil Acceptance Criteria" is checked. Can you confirm this as a bug?

Re: Filter non-linear balance pattern

You are right. It looks like the Non-liner balance pattern doesn't work for the Collections. I'll check it.

Re: Filter non-linear balance pattern

Thanks. I´ve been trying hard, but can´t seem to get it to work there. Then again it might be another fault I am doing that I am missing. But good to hear you are looking into it.

16 (edited by geektrader 2017-05-28 23:37:07)

Re: Filter non-linear balance pattern

Popov wrote:

You are right. It looks like the Non-liner balance pattern doesn't work for the Collections. I'll check it.

I am just trying the latest version on my new computer and noticed that this sitll does not seem to be fixed after over a year since I´ve reported this bug? The non-linear balance pattern works fine for strategy generating, but has no effect if used within the "Collections", although "Strategies fulfil Acceptance Criteria" is set there. Can you please fix this?