[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Rounder Lot Size



PureBytes Links

Trading Reference Links

In order to round the number of shares in your trade to the rounder 
numbers that people typically use (e.g. 100, 500, 1000), you have to 
set the RoundLotSize variable to a different number based on the 
value of the stock and your position size.  I wrote the following 
little bit of script that I include at the end of other scripts.

It assumes PositionSize is always a positive number (rather than the 
negative percentage variation).

lotSize = PositionSize / BuyPrice; 
RoundLotSize = 
	Iif( lotSize / 1000 > 1, 1000,
	Iif( lotSize / 500 > 1, 500,
	Iif( lotSize / 100 > 1, 100,
	Iif( lotSize / 50 > 1, 50,
	Iif( lotSize / 10 > 1, 10, 
        5
	)))));

dan
liberte@xxxxxxxxxxxxx






------------------------ Yahoo! Groups Sponsor --------------------~--> 
GFT Forex Trading Accounts As low as $250 with up to 400:1 Leverage. Free Demo.
http://us.click.yahoo.com/lpv1TA/jlQNAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/