• 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.

Maximum Position Value

Discussion in 'Trading Strategies/Systems' started by stevecar144, Nov 27, 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,
    I am using a pretty standard position size setup as follows:
    maxpos = 4; // maximum number of open positions
    SetOption("InitialEquity", 100000 ); // set initial equity = 100K
    SetOption( "MaxOpenPositions", maxpos );
    SetPositionSize( 100 / maxpos, spsPercentOfEquity );

    What I want to do is control trade size so that each trade is no more than 8% of daily volume. I know this can be done in the back test settings and saved in an .apx. Can it be done in the AFL though?
    So something like this:
    MaxPosValue = C * V * (8/ 100);

    but how to incorporate that into the position sizing is the question?

    TIA.
    Steve c
     
  2. Trav.

    Trav.

    Posts:
    438
    Likes Received:
    426
    Joined:
    Nov 27, 2017
    Try this mate, seems to work but have a play.

    MaxPosValue = C * V * (.08);
    PositionSize = SetPositionSize ( MaxPosValue, 1);

    SYNTAX SetPositionSize( size, method )
    RETURNS ARRAY
    FUNCTION This function allows to control trade (position) size in four different ways, depending on 'method' parameter.
    Parameters:

    size (ARRAY) defines desired trade size

    method (ARRAY) defines how 'size' is interpreted

    • spsValue (=1) - dollar value of size (as in previous versions)
     
    Warr87, debtfree and Gringotts Bank like this.
  3. stevecar144

    stevecar144

    Posts:
    26
    Likes Received:
    0
    Joined:
    Jun 7, 2007
    Awesome, will give it a try.
     
Loading...

Share This Page