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

[amibroker] Using two systems in one script



PureBytes Links

Trading Reference Links

Hello,

I am learning rotational trading and would like some feedback on 
PositionSize.

I have the following in the code.

MaxPos = 5;
SetOption("InitialEquity", 100000);
SetOption("MaxOpenPositions",MaxPos);
PositionSize = -100/MaxPos;

I run the complete afl with a PositionScore and find that on certain 
days there are only 3 or 4 stocks that have a PositionScore that 
warrants a buy.  Thus, I am in cash for part of the time and, as a 
result, would like the system to use the value less than 5 when less 
than 5 stocks have PositionScores that warrant buys.

I tried the following, but can not figure out how to determine 
Available_count without using AddtoComposite which seems to require 2 
afls -- one to count the qualifing stocks each day via addtocomposite 
and another afl to do the rotational trading.

High_available = Min(MaxPos,Available_count);
PositionSize = Nz(-100/High_available);

Thanks in advance for the help and please remember that I am just 
getting into this stuff.

Bert





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/