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

[amibroker] Rotational Mode Code Question


  • Date: Sun, 21 Mar 2010 13:57:05 -0000
  • From: "Matt" <rochemb@xxxxxxxxxxx>
  • Subject: [amibroker] Rotational Mode Code Question

PureBytes Links

Trading Reference Links

I have a system that currently trades 2 postions on the last trading day of every-other month (last day in Feb., last day in April, etc.).  See code below.

I am trying to modify code so that the system enters one position at the end of every month and holds that position for 2 months.  I want system to hold max. of 2 poitions as in original code.  It would be like this: December 31st - evaluate Rank and enter 1 position.  Hold this position until February 28.  January 31st - evaluate Rank and enter 2nd position.  Hold this position until March 31st.  February 28, 1st postion is exited and new position entered and held until April 30th.  This process repeats (system enters a new postion every month, holding max. of 2 positions).  Can this type of code be done in Rotational Mode?  Thanks.

Current Code:
SetBacktestMode( backtestRotational );
Filter = 1;
SetOption("MaxOpenPositions",2 );
SetOption("WorstRankHeld",2); 
PositionSize = -100/2; 

newBiMonth = Month() != Ref(Month(), 1) AND Month() == 2 OR Month() != Ref(Month(), 1) AND Month() == 4 OR Month() != Ref(Month(), 1) AND 
Month() == 6 OR Month() != Ref(Month(), 1) AND Month() == 8 OR Month() != Ref(Month(), 1) AND Month() == 10 OR Month() != Ref(Month(), 1) AND
Month() == 12;

PositionScore = IIf(Rank < 0, 0, PositionScore); 
PositionScore = IIf(newBiMonth, PositionScore, scoreNoRotate);








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

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

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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/