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

[amibroker] Rotational Trading (kind of) Help



PureBytes Links

Trading Reference Links

Is there anyway to screen a list of stocks based on a criterion, rank
them and buy say the top five at certain point in time and then sell
them at a certain point in time?

I have the screening code worked out as I can filter for them and sort
to generate the list and the time based buys and sells are accurate as
well.  I just can't seem to piece both elements together into a
backtestable system.

I've tried positionscore and rotational trading and neither do what I
would like them to do.

Here is the filter

MPT_Period = Param("MPT Period", 50, 0, 500, 10);
Cdd = (HHV(C,MPT_Period) - C)/HHV(C,MPT_Period);
MaxDD = HHV(CDD,MPT_Period);
R2 = (Sum(Cdd*Cdd,MPT_Period))/(MPT_Period-1);
UI = sqrt(R2);
TR = Close/Ref(Close,-MPT_Period);
ANN = (exp(log(TR))-1);
UPI = (ANN - irate(5.1)/100)/UI;
Filter = 1;
AddTextColumn(FullName(),"Name",1.2);
AddColumn(UPI,"UPI");


Here is the buy and sell code

BuyDays = Param("# of BuyDays", 6, 1, 10, 1 );
SellDays = Param("# of SellDays", 2, -1, 15, 1 );
ShortDays = Param("# of ShortDays", 3, 0, 10, 1 );
m = Month()!=Ref(Month(),-1);
Buy = C > 1 AND Ref( m, BuyDays );
Sell = C > 1 AND Ref( m, -SellDays );
Short = Ref(m, - SellDays);
Cover = Ref(m, - (SellDays+ShortDays));

Tks



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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/