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

[amibroker] Re: trading backtests in real life



PureBytes Links

Trading Reference Links

Dave,

Without wasting too many words, here is how I use AB for mech trading
systems:

1) Use a single AFL for the backtesting

2) Use the same AFL for the nightly Explores by setting Filter options
as follows:

........ lastbar = BarIndex() == BarCount - 1;
........ Filter = Buy AND Lastbar; // For Exploring tomorrows picks
........ AddColumn(s) for Order Entry info, ie. #shares, Ord Type,
Price, initial stop, etc.

... Next, I manually maintain seperate Watchlists for each mech
strategy that I trade containing current open positions.
 
........ A seperate set of AFL in a special subdirectory called STOPS,
that are matched to their parent AFL which generated the trade to
begin with, and which use their own Watchlist open positions to
generate the new next day EXIT orders that I need to update in my
brokerage account.

Regards,

Phsst


--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> wrote:
> understood. do you do this with explorations or backtests?
> 
> do you use stops? if so, do you try to have AB tell you when they
get hit? I
> ask because it does need to know what got bought to do that. for dynamic
> stops, I'd think you'd need to create exploration columns with the
current
> stop price, instead of relying on ApplyStop. is that so?
> 
> thanks,
> 
> dave
>   It depends on your definition of "manage".  Personally I use AB for
>   several systems that I trade and I use it in the context of having AB
>   tell me when signals occur.  However, I do not use it to tell me
>   whether or not trades actually occured or if they did at what price
>   etc.
> 
>   --- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx>
>   wrote:
>   > understood tomasz.
>   >
>   > I'm looking into exploring instead of backtesting as a way to manage
>   > execution. even though takes a bit of juggling on my part, it's more
>   > flexible in that everything's visible to me, so I can respond on my
>   own to
>   > whatever actually happened in real life. I need to semi-manually
>   look for
>   > sells that apply to things I actually bought, pick out the top
>   > PositionScores from among the buys, and figure out my own position
>   sizes. I
>   > think it's doable. luckily, this system doesn't use stops, so it
>   doesn't
>   > have to know exactly what was really purchased to tell me what it's
>   doing.
>   >
>   > I hate to ask the obvious question folks, but is anyone actually
>   trading a
>   > mechanical system they manage with AB? how do you do it?
>   >
>   > dave
>   >
>   >   This is one of the reasons why I was reluctant to include
>   that 'next day
>   > recommendations' in backtester at all.
>   >   I was always saying that you have to wait for full featured
>   account
>   > manager to handle it.
>   >   I have been reluctant but still many people pushed 'next day
>   > recommendation' concept so I added it.
>   >   Now you are facing the challenge I had in mind writing that you
>   would need
>   > full account manager section not just quick hack.
>   >
>   >   So again I may repeat what I wrote already a number of times.
>   This will be
>   > easy with full account manager implemented.
>   >
>   >   Best regards,
>   >   Tomasz Janeczko
>   >   amibroker.com
>   >     ----- Original Message -----
>   >     From: Dave Merrill
>   >     To: amibroker@xxxxxxxxxxxxxxx
>   >     Sent: Wednesday, November 05, 2003 12:29 AM
>   >     Subject: RE: [amibroker] Re: trading backtests in real life
>   >
>   >
>   >     maybe I wasn't clear. I'm using an AB backtest to generate
>   signals that,
>   > if things work out, I'll follow in real life. as a step in the real-
>   life
>   > direction, I'm first paper trading it, but the real issue here is
>   keeping
>   > the backtest, ie, the signal generator, in sync enough to generate
>   useful
>   > signals, given real-life execution deviations.
>   >
>   >     clear as mud?
>   >
>   >     dave
>   >
>   >       agreed, there will be differences between paper trading this
>   strategy
>   > and putting real money on it. still, I thought it was another level
>   of
>   > confirmation I'd try going through. not something I've tried before.
>   >
>   >       but that doesn't have anything to do with this actual
>   question (:-).
>   > today's execution weirdness could have happened in real life too;
>   that LGF
>   > quote is what I saw everywhere, not just in the paper account. I'm
>   happy to
>   > let the trade go and live to trade another day, but given the scored
>   > portfolio model, my AB backtest is now out of sync with what
>   actually
>   > "happened", and that's what i'm trying to fix.
>   >
>   >       dave
>   >         Simulations like this are FUN, but IMHO not much like real
>   trading.
>   >         I've yet to see one that completely emulates the real world
>   without
>   >         introducing a variety of its own short comings.
>   >
>   >         --- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill"
>   <dmerrill@xxxx>
>   >         wrote:
>   >         > the new backtest feature that allows us to see signals
>   for the
>   > next
>   >         day is a
>   >         > wonderful step towards sane real life trading of AA tests.
>   > however,
>   >         I wonder
>   >         > if anyone any ideas on how to handle a real life
>   situation that
>   >         came up in
>   >         > paper trading today.
>   >         >
>   >         > understand that I'm not asking for full portfolio
>   management or
>   >         anything, or
>   >         > just bitching; I know that's coming at some point. I'm
>   just trying
>   >         to figure
>   >         > out what to do now, given the current tools we have.
>   >         >
>   >         > the system I'm trying out is a scored non-rotational
>   portfolio,
>   >         trading 10
>   >         > positions max. I got 10 entry signals for today, the
>   first day of
>   >         paper
>   >         > trading, but couldn't enter 3 of them for various reasons
>   that
>   >         actually
>   >         > could happen in real life, I think. (for instance, LGF,
>   Lion's
>   > Gate
>   >         Films,
>   >         > earlier today said last tick 3.95, bid .01, asked 10, no
>   major
>   >         immediate
>   >         > news I saw. what is that about? optionsXpress' paper
>   system
>   >         wouldn't let me
>   >         > short 2 others.)
>   >         >
>   >         > does anyone have any ideas on how to best move forward
>   from here?
>   >         the
>   >         > backtest thinks I'm already in 10 stocks, so unless I get
>   exit
>   >         signals
>   >         > tonight, it won't show me any new buys, and if there are
>   sells,
>   >         it'll only
>   >         > show that number of buys.
>   >         >
>   >         > the only thing I could think of to sync things back up
>   again is
>   >         funky: hard
>   >         > code some exceptions, like:
>   >         >
>   >         > ticker = Name();
>   >         > if(ticker == "LGF" or ticker == "CCBL" or ticker
>   == "TRID") {
>   >         >   buy = buy and Date() != 1031103
>   >         > }
>   >         >
>   >         > as time goes on, more of these would need to be added
>   every time
>   >         something
>   >         > unpredictable happened on the execution side.
>   >         >
>   >         > any other ideas? anyone trading backtests like this?
>   >         >
>   >         > dave
>   >
>   >
>   >
>   >         Send BUG REPORTS to bugs@xxxx
>   >         Send SUGGESTIONS to suggest@xxxx
>   >         -----------------------------------------
>   >         Post AmiQuote-related messages ONLY to:
>   amiquote@xxxxxxxxxxxxxxx
>   >         (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   >         --------------------------------------------
>   >         Check group FAQ at:
>   > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>   >
>   >         Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>   Service.
>   >
>   >
>   >
>   >       Send BUG REPORTS to bugs@xxxx
>   >       Send SUGGESTIONS to suggest@xxxx
>   >       -----------------------------------------
>   >       Post AmiQuote-related messages ONLY to:
>   amiquote@xxxxxxxxxxxxxxx
>   >       (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   >       --------------------------------------------
>   >       Check group FAQ at:
>   > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>   >
>   >       Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>   Service.
>   >
>   >
>   >
>   >     Send BUG REPORTS to bugs@xxxx
>   >     Send SUGGESTIONS to suggest@xxxx
>   >     -----------------------------------------
>   >     Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   >     (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   >     --------------------------------------------
>   >     Check group FAQ at:
>   > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>   >
>   >     Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>   Service.
>   >
>   >
>   >         Yahoo! Groups Sponsor
>   >               ADVERTISEMENT
>   >
>   >
>   >
>   >
>   >   Send BUG REPORTS to bugs@xxxx
>   >   Send SUGGESTIONS to suggest@xxxx
>   >   -----------------------------------------
>   >   Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   >   (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   >   --------------------------------------------
>   >   Check group FAQ at:
>   > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>   >
>   >   Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>   Service.
> 
> 
>         Yahoo! Groups Sponsor
>               ADVERTISEMENT
> 
> 
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   --------------------------------------------
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
>   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/I3w.vC/hP.FAA/3jkFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/