PureBytes Links
Trading Reference Links
|
Hi,
Custom backtester will definately allow you to do that.
You could probably use the AddToComposite (write how many buys so far)
paired with Foreign (read how many buys so far) to keep track of the
number of buys for each day such that you check how many have been
added so far before adding a new buy, and only accept new buys when
haven't yet exceeded daily maximum. When daily maximum has been met,
reject all other buys.
However, this will ignore position score and will take signals biased
to the ordering of the symbols in your watchlist. The custom
backtester might be a better approach.
The code would be something along these lines (not tested, so you may
have to clean it up a bit yourself):
DailyMax = 2;
BuySignal = ...
Count = Foreign("~DailyBuys", "X");
Buy = BuySignal AND Count < DailyMax;
AddToComposite(Buy, "~DailyBuys", "X", atcFlagDeleteValues +
atcFlagEnableInBacktest + atcFlagEnableInExplore);
Mike
--- In amibroker@xxxxxxxxxxxxxxx, "droskill" <droskill@xxx> wrote:
>
> Hey all,
>
> I was wondering if there is a simple way to limit the total number of
> trades that occur on any given day. So, I might have a total of 10
> positions for a strategy, and I want no more than 2 filled on any
> particular day.
>
> Any easy way to do that outside of using the custom portfolio
backtester?
>
------------------------------------
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/
|