PureBytes Links
Trading Reference Links
|
Gary and Eric,
My understanding is that it's fundamentally impossible for our AFL code to
do anything that depends on entry into or exit from rotational trades. The
reason is that AB essentially makes one pass through all stocks, running our
code to calculate PositionScores, but not doing any trading. It *can't*
trade yet, because it needs to know the PositionScore for *all* tickers
under test, so it can know which ones are highest. AB then makes another
pass through, "executing" trades using the PositionScores calc'd in the
first pass, but it doesn't run any of our code this time. The upshot is that
by the time it's known what trades will be taken, our code has already
finished running, and can't effect anything. Make sense?
Actually, I shouldn't say "impossible". Besides not liking that word on
principle, very little actually is. If you wanted to write your own
rotational trading engine in AFL, maybe using the Osaka plugin, you could
have it figure out all entries, exits, different types of stops, available
equity based on PositionSizes, trades taken and prior trades, etc, during
the processing of the first stock (only), then use that info to enter and
exit trades for each stock as it comes up. You wouldn't even need to use
rotational mode at that point, since you could tell AB when to enter and
exit each ticker.
That's a big, ugly, job to do as right as Tomasz already did, and I for one
am not interested. Not interested enough to actually do it anyway (:-).
Someone else may be, or may have already cooked it up.
Dave Merrill
Have you figured out a way to know what positions are currently on, and
how many bars they have been on while rotational trading?
Thanks,
Gary
Dave Merrill <dmerrill@xxxxxxx> wrote:
How about:
Sell = my_sell_signal AND (BarsSince(Buy) >= min_hold_bars);
That won't work if you're using rotational trading, because there aren't
any
Sell signals.
Dave Merrill
Is there an AFL function for backtesting that restricts trades to a
minimum holding period? New mutual fund rules have 30, 60 and
sometimes 90 day hold restrictions. Would like to account for this
in backtesting.
Thanks!
-Eric.
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|