• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

Amibroker % daily volume trade size

Discussion in 'Trading Strategies/Systems' started by stevecar144, Nov 29, 2019.

sentifi.com

Aussie Stock Forum Sentifi Top themes and market attention on:

  1. stevecar144

    stevecar144

    Posts:
    26
    Likes Received:
    0
    Joined:
    Jun 7, 2007
    Hi all,
    Amibroker has a back test setting "limit trade size as % of entry day volume". I understand the purpose is to limit trade size to the set percentage... However, in the Amibroker docs it says "This prevents from 'affecting the market' by huge orders", sure, it would, but its a back test?? There is no effect on the market. And of course, the day volume can't be known until the close, right? So what is the comment about? So, is the volume that the setting uses, yesterday's volume? Or, is it just a case of this being the best one can do to simulate live market conditions? If so, it's kind of pointless because in live trading one can't apply the percentage...confused!!

    Cheers
    Steve C
     
  2. Trav.

    Trav.

    Posts:
    438
    Likes Received:
    426
    Joined:
    Nov 27, 2017
    Steve,

    When I first started running backtests I found I was making big bucks on my back test and looking at the below results it became obvious that my position sizes were becoming unrealistic and would 'move the market' if the position could actually be filled

    upload_2019-11-29_18-42-31.png

    So I am not sure exactly what volume if any the backtest uses but trying to simulate such a thing would be pretty difficult.

    Hopefully the above helps paint a picture to what an unrealistic backtest looks like and what Amibroker is trying to prevent.

    I have ended up going for a fixed position size to prevent the above. So with the standard $100k equity figure I would use $10k position size with a maximum of 20 positions which would be reasonable to manage once you gain more experience.

    Cheers

    Trav
     
    qldfrog and Skate like this.
  3. qldfrog

    qldfrog

    Posts:
    3,073
    Likes Received:
    1,366
    Joined:
    Jun 8, 2008
    Hi Trav, as a cheeky comment
    You do well with 20 10k position on a 100k portfolio:)
    But i agree with the idea of trying to add realism into backtest, otherwise you could run scenarios buying more shares than even available...
     
    Trav. likes this.
  4. Trav.

    Trav.

    Posts:
    438
    Likes Received:
    426
    Joined:
    Nov 27, 2017
    Yes well I am not trying to cook the books here :p , you would get to a maximum of 20 x $10k positions after a period of time if your system is profitable.

    Good to see someone is auditing my comments :xyxthumbs
     
    qldfrog likes this.
  5. stevecar144

    stevecar144

    Posts:
    26
    Likes Received:
    0
    Joined:
    Jun 7, 2007
    Hi again, wow, I fell into a logic trap. For whatever bizarre reason I had in mind that the % of daily volume setting was driving the stock selection. No, of course not. It simply regulates the trade size after the selection is made by whatever rules the afl includes. Must have been very tired when I fell into that line of thinking.
    So, I have been back testing at 5% of daily volume, which I think is conservative enough to allow compounding of trade size over time in the test and not "affect the market" in the real world.
    Anyway, there is still the issue of not knowing (going forward) if the daily volume will be high enough to take the intended trade. It's kind of moot though I guess, as that answer cannot be known till late int he trading day.
    Last point is "what to use for daily turnover?" price * volume gives a static figure which is not much use is compounding trade size. So I guess code has to check equity and estimate the trade size and then adjust the turnover expectation....???
    Or, just be happy with a low % of daily volume...or not compound at all.
     
  6. Trav.

    Trav.

    Posts:
    438
    Likes Received:
    426
    Joined:
    Nov 27, 2017
    Steve I think if you look at the average daily volume of a set period leading into your trade should give you an indication if your trade will be taken without moving the market to much. I have a filter that is used for identifying liquidity in a stock so that I can get in and out easy, but this is pretty much the same thing as we are talking about

    VolumePeriod = 10;
    VolumeDollars = 200000;
    VolumeFilter = EMA ( V * C, VolumePeriod ) > VolumeDollars;
     
    Skate likes this.
  7. stevecar144

    stevecar144

    Posts:
    26
    Likes Received:
    0
    Joined:
    Jun 7, 2007
    Cheers, will give it a try....appreciated.
     
  8. Trav.

    Trav.

    Posts:
    438
    Likes Received:
    426
    Joined:
    Nov 27, 2017
    I am not sure if you have played with optimize yet but with the above you can test different scenarios very easily.

    //VolumePeriod = 10;
    //VolumeDollars = 200000;

    VolumePeriod = Optimize ( "Volume Period", 10, 5, 30, 1);
    VolumeDollars = Optimize ( "Volume Dollars", 200000, 100000, 1000000, 100000);
     
  9. stevecar144

    stevecar144

    Posts:
    26
    Likes Received:
    0
    Joined:
    Jun 7, 2007
    Cheers, will keep testing, but at this stage the issue I see is that a static turnover figure is not a good fit to a compounding test. Static turnover figure makes sense for fixed trade size back tests though. So I will probably rely on 5% of daily volume to restrict trade size from getting too large and set a minimum trade size around $2500. 50 day avg volume suffers the problem that it is possible for volume to be 0 on the trade day...even if unlikely. So again, % volume seems the best fit for me.
    Cheers.
     
  10. Trav.

    Trav.

    Posts:
    438
    Likes Received:
    426
    Joined:
    Nov 27, 2017
    I am responding to you without knowing your situation so obviously some of the info I post is not relevant.

    Now to my point I also restrict my scans to XAO which helps filter out the smaller stocks that have liquidity issues. Again you might be targeting these smaller stocks but I have lost to much money playing in the small end of time.

    upload_2019-11-30_9-23-20.png

    upload_2019-11-30_9-23-46.png
     
    Boggo and Skate like this.
  11. stevecar144

    stevecar144

    Posts:
    26
    Likes Received:
    0
    Joined:
    Jun 7, 2007
    Agreed, I am using asx sp200+delisted but not asx sp50. Getting good results, but more important as you say, top stocks tend to be liquid. My min price is .05c and it surprises me that there are sp200 stocks at that price, but mainly just after the GFC and only a handful of trades at that price in the entire test . As the test moves forward the prices get higher. Also use positionscore = c*v to try to get more liquidity. I think I need to check that Norgate data sp200 has historical constituents...don't understand that aspect well enough. As I think about it more, .05c in the top 200 seems wrong.
     
  12. Boggo

    Boggo

    Posts:
    3,192
    Likes Received:
    398
    Joined:
    Mar 28, 2006
    XAO here too @trav on the weekly, too may false starts so I stick with the All Ords constituents.
    Back testing agrees.
     
    Trav. likes this.
Loading...

Share This Page