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

[amibroker] Sanity check w/ rotational trading



PureBytes Links

Trading Reference Links

Hi all

I am getting some anomalous results on a particular data set when using the following 
simple rotational system. Is it possible I am looking into the future without knowing it?

// 3-EMA rotational system

// set up rotational trading

SetTradeDelays( 1,1,1,1 );

EnableRotationalTrading();

positions = Param("# of Positions", 10, 1, 100, 1);

SetOption("WorstRankHeld", positions+1); 

PositionSize = -(100/positions); // invest X% of equity in single security

// minimum price

MinPrice = 0.50;


// position scoring


ShortPeriod = Optimize( "Short EMA", 5, 2, 20, 2 );
MediumPeriod = Optimize( "Med EMA", 40, 20, 100, 10 );
LongPeriod = Optimize( "Long EMA", 200, 100, 500, 20);


m1 = EMA(C, Shortperiod);
m2 = EMA(C, mediumPeriod);
m3 = EMA(C, Longperiod);

// slopes

s1 = (m1-Ref(m1, -1))/m1;
s2 = (m2-Ref(m2, -1))/m2;
s3 = (m3-Ref(m3, -1))/m3;

// weights

w1 = -1; //Optimize( "w1", -1, -1, 1, 0.5 );
w2 = 0.5; //Optimize( "w2", 0.5, -1, 1, 0.5 );
w3 = -1; //Optimize( "w3", -1, -1, 1, 0.5 );

PositionScore = IIf( C > minprice, s1*w1 + s2*w2 + s3*w3, 0 );


------------------------------------

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/