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

RE: [amibroker] Vertical Grid Line



PureBytes Links

Trading Reference Links

Hi,

If someone could help with this please. I would like to setup a position 
size based on the smallest trade size of either the:

1. Risk or
2. Maximum Trade Size of 10% of the capital.

ie: If the risk position size is $5000 and the Max Trade Size is $7000 
then I trade the $5000.

Also, I have a Minimum Trade Size of 9% of capital.

ie: If the Minimum Trade Size is $6000 then using the above examples I 
wouldn't take the trade as the $5000 risk size is below the Minimum 
Trade Size.

The code I've started with is:

//Position Sizing

MinTradeSize	= -9;
MaxTradeSize	= -10;
Risk		= 0.01 * Capital;
RiskOrMax 	= Min(MaxTradeSize,Risk / Open - Ref(Stop,-1));
PositionSize	= IIf(Risk < MinTradeSize, 0, RiskOrMax);

...but it doesn't work as no trades come up in the backtest.

TIA
Cheers, Glenn



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/