Average tester – are averages any good?

Forums ProRealTime English forum ProBuilder support Average tester – are averages any good?

Viewing 15 posts - 1 through 15 (of 16 total)
  • #162414

    I have always hated averages. They are horrible lagging things that can easily be curve fitted but I decided to code something to see a little more easily how bad they are and to see if any of the popular average types are better than others.

    So I coded this simple code that uses arrays to record the average gain/loss of any candle if it is preceded by a candle that meets a preset average condition. This condition can be something like close > average or low > average or even fast average > slow average. This tests long conditions but you can also test short by using the reverse condition.

    The 8 most popular average types are tested so that their performance can be compared. The result is the average gain per candle. A datum of every candle on the chart is also calculated so we can see how our average condition performance compares to buy and hold.

     

    The first attached image is of a test on the DJI daily chart. It tests long performance if the 24 day average > 48 day average. All averages have a lower average gain per candle than the buy and hold datum except for Hull, Zero Lag, Time Series and End Point averages where the performance is improved. So perhaps a simple filter like this can improve a strategy?

    The second image tests if close > 24 day average and only the Time Series average beats buy and hold.

    1 user thanked author for this post.
    #162418

    The 200 day average is often cited as a good filter for long term trading. Don’t be long unless price is above a simple moving average of it. Attached is the results of testing all the popular 200 day average types and it can be seen that on the DJI performance is terrible with a simple moving average compared to buy and hold. In fact only Time Series and End Point averages have improved performance by a little but if you look back at history they also were often under performing buy and hold in the past.

    I think I’d give the 200 day average a total miss as a filter.

    #162420

    By changing lines 8 and 9 to:

    ….we can show the average gain per candle as a % of opening price which I think shows historical performance in a better format.

    Attached is close > 50 day average for DJI in %.

    #162422

    MA’s alone are no good signals; they need further indicators or price action to be meaningful.

    MA200 effectiveness should be tested on a strategy based on other inicators, say a combination of price action + Rsi divergences. Testing that strategy (or any other strategy) with/without MA200 would be indicative.

     

     

    #162424

    The idea Roberto is that an average is used only as a filter to decide whether to allow long or to allow short trades. If it works as a filter then we should see more up price movement when above it and more down price movement when below it. So if we check average up movement per candle when our filter is true then we can see if the filter is actually likely to add anything to a strategies performance or even perhaps subtract from potential performance.

    My tester lets us purely compare different averages without the added curve fit of other conditions of entry such as RSI etc.

    #162428

    Yes, you are right Vonasi.

     

    #162432

    have you changed your view on averages? or atleast certain averages with this Vonasi ?

    #162450

    Well facts are facts. It is possible to add an average filter to a strategy and that filter mean that we are long on a market or short on a market during periods that statistically would have in the past given us an advantage (i.e more upward or downward  pips per candle than the norm).

    What I think is also interesting in the small amount of testing that I have done is how useless comparing price to an average is compared to using a fast average and a slow average.

    Also pretty much all the time simple moving average, exponential and weighted averages are pretty useless as a filter whereas Hull and zero lag seem to fair much better.

    No average filter will stop you from trading in a market when that market is going to lose you money.

    So until I test further I would say that there is a place for averages in trading but I think it is limited.

    1 user thanked author for this post.
    #162453

    i use different averages often as a filter.

    do you use more seasonality as filter or just different indicators?

    just curious as to what you prefer over averages wich are so popular and used in almost every strategy posted here.

     

    #162457

    I tested this code on Dax, Daily TF, using 200K units.

    You can see, from attached pic, that pips in favor of the position of price (compared to Sma200) are always more than adverse pips:

     

    #162464

    Not sure I understand why you are adding up the range of all red candles and the range of all green candles. Range size is just volatility and tells us nothing about direction.

    In my code I check the previous candle is above the average as this is the candle that would be used to make our choice as to whether the filter is met or not. I then add up the values of the following candle.

    #162465

    do you use more seasonality as filter or just different indicators? just curious as to what you prefer over averages wich are so popular and used in almost every strategy posted here.

    Seasonality in my mind is only of any use on some commodities – especially those that are seasonal in real life such as crops and pigs!

    The best filter is the news. Donald Trump is President of the biggest economy in the world – get the hell out of the markets unless you love volatility. Donald Trump is no longer President of the biggest economy in the world – time to go long on indexes.

    Averages are used in many strategies because they can be curve fitted so easily to make a strategy look better than it is.

     

    #162467

    okay, so i guess you are using API?

    #162472

    Not sure I understand why you are adding up the range of all red candles and the range of all green candles. Range size is just volatility and tells us nothing about direction.

    Because strategies are supposed to earn pips, so I think knowing that when price is ABOVE sma200 you may gain more pips when there’s a bullish candle rather than a bearish one…. may be of some interest (the other way round when price is BELOW sma200).

     

     

     

     

    #162473

    OK Roberto – I guess there is some logic in that but in the real world we can’t trade that range unless we are really very good and can get in at the low and out at the high on every candle. Perhaps comparing the ratio between high and open and low and open for candles above and below the average would tell us more.

Viewing 15 posts - 1 through 15 (of 16 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login