Refer to "AmiBroker Custom Backtester Interface.pdf" in the Files section of this group, posted by gp_sydney:
http://f1.grp.yahoofs.com/v1/4MUQScTOe79GNNV- ZkLEVgZrQsvpi7UryW1IV34jAcr5MrdKVujCnYWixQTKH2jURoJKyDJobZlG0ZMwEvdBvx nggD5xMLok/AmiBroker%20Custom%20Backtester%20Interface.pdf You can monitor portfolio equity on a bar by bar basis in custom backtester code. If equity falls below your threshold, iterate through the list of open positions and close them out using the low level custom backtester API: http://www.amibroker.com/guide/a_custombacktest.html Mike --- In [email protected], "zozuzoza" <[EMAIL PROTECTED]> wrote: > > Thanks, the example works on single stock equity. I am looking for > portfolio equity. > > To correct my question > How could I code a stop loss based on portfolio equity? If the > portfolio equity drops 5%, close the positions. > > Has anybody come accross this problem? > > Thank you. > > Best regards, > zozu > > --- In [email protected], reinsley <reinsley@> wrote: > > > > Hi, > > > > Howard B gave an exemple in this topic : > > > > http://finance.groups.yahoo.com/group/amibroker/message/130567 > > > > Best regards > > > > zozuzoza a écrit : > > > > > > How could I code a stop loss based on equity? If the equity drops > 5%, > > > close the positions. > > > > > > Thanks a lot, > > > zozu > > > > > >
