This function or something similar may do what you want without setting
the RoundLotSize.

-Steve

function ComputeNumShares(price, percentOfEquity, totalEquity)
{
   dollars = totalEquity * (percentOfEquity / 100);
   shares = dollars / price;
   if (shares < 100)
     shares = Round(shares);
   else
   {
     shares /= 100;
     shares = Round(shares);
     shares *= 100;
   }
   return shares;
}


--- In [email protected], Flávio Veloso <[EMAIL PROTECTED]> wrote:
>
> Hi all.
>
> Is it possible to use different round lot sizes (e.g. by setting
> RoundLotSize variable) depending on the number of shares that are
going
> to be bought/short?
>
> Basically all I want is RoundLotSize = 100 for any position size that
> results in more than 100 shares to be bought/short, and RoundLotSize =
1
> for the rest.
>
> For example:
>
> Number of shares (based on PositionSize): 75
> Use RoundLotSize = 1
> Shares to buy = 75
>
> Number of shares (based on PositionSize): 125
> Use RoundLotSize = 100
> Shares to buy = 100
>
> Number of shares (based on PositionSize): 360
> Use RoundLotSize = 100
> Shares to buy = 300
>
> Anyone doing this? If so, how?
>
> Thanks in advance.
>
> --
> Flávio
>


Reply via email to