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

[amibroker] Re: Help w/Code - Rotational Trading?



PureBytes Links

Trading Reference Links

In regards to only buying and owning stocks that meet your criteria, 
you just need to set the PositionScore to 0 (zero) for all stocks 
that do not meet your criteria.

In regards to dynamic position sizing, I don't know.  I haven't read 
up on the details of MaxOpenPositions and SetPositionSize lately, so 
I do not know to what extent they can be manipulated while in 
Rotational Mode.  I have been operating under the assumption that 
they were fixed once in Rotational Mode, but I could be wrong and I 
haven't tried to change them within a backtest (yet).

There is a AllowPositionShrinking option for when you don't have 
enough cash to buy a full position, but it sounds like you want a 
AllowPositionExpansion option to keep fully invested.

Logically, you want to:
 1) Determine number of stocks that meet your criteria
 2) Set MaxOpenPositions to that value
 3) Set Position Size to 100%/Positions

My guess is that you will probably need to use CBT to get to the 
level of manipulation that you are looking for.  I'll be interested 
in the final answer to your question.



--- In amibroker@xxxxxxxxxxxxxxx, "KBGlenn" <kbglenn@xxx> wrote:
>
> Could someone please give me some suggestions on how I might 
> accomplish the following:
> 
> - Establish a basket of stocks (I can do this)
> - Review the basket periodically and determine which meet certain 
> criteria (I can do this)
> - Buy all stocks in the basket that meet the criteria in equal 
weights 
> using all available cash (This I can do)
> - Somtimes there may be 20 and sometimes there may be 0.  However, 
> with every periodic review I need to rebalance as required. So, for 
> example, if stocks meeting the criteria went down from 5 to 4 I 
would 
> need to purchase additional shares of the 4 remaining on the list. 
> Alternatively I could go from 4 to 5 and need to trim the prior 4 
to 
> add the fifth stock. (This I can't figure out how to code.)
> 
> Also, would you even use rotational trading for this because you 
could 
> own anywhere from zero stocks to every stock on the list depending 
on 
> which met/didn't meet the criterion?  I suppose I could force sell 
> everything and simply repurchase each period, but I'd prefer to 
> backtest the way it would actually be implemented.
>




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/