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

Re: [amibroker] Rotational Trading Code


  • Date: Sun, 13 Dec 2009 23:38:43 -0800 (PST)
  • From: i cs <ics4mer@xxxxxxxxxxxx>
  • Subject: Re: [amibroker] Rotational Trading Code

PureBytes Links

Trading Reference Links



Hi Donald,

Here is a simple example that is in the systems folder of the AB Release.

// Simple example of rotational trading system
// This is contrarian strategy -
// it buys 4 "worst" stocks - the ones that suffered the most in last year
// (4 stocks having worst 252-bar rate-of-change)
//
// 4 positions
MaxPositions = 5;
SetOption("MaxOpenPositions", MaxPositions  );
SetOption("WorstRankHeld", MaxPositions + 2 );
SetPositionSize( 100 / MaxPositions, spsPercentOfEquity );

// trade on next day open
SetTradeDelays( 1, 1, 1, 1 );
BuyPrice = Open;

SetBacktestMode( backtestRotational );

// offsetting by large positive number
// makes sure that our score is always positive and we don't enter short trade
PositionScore = 10000 - ROC( C, 5 );

You can add "clauses" to the positionScore using the following pattern:

PositionScore =
IIf ( C*V > 10000.    // only return a value if  more than $10k traded    
       10000 - ROC( C, 5 ), // The actual PositionScore
        0); // Get a 0 score if the liquidity requirements are not met


Hope this gets you started.

Z


From: donald_brown_48367 <donald_brown_48367@xxxxxxxxx>
To: amibroker@xxxxxxxxxxxxxxx
Sent: Mon, 14 December, 2009 5:08:17 AM
Subject: [amibroker] Rotational Trading Code

 

Does anyone have a simple rotational code that they can post?



Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now.

__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___