Thanks for your reply. I will defer further discussion on this to my main thread #114449. Except to say that the CBI doesn't seem to be enough either, since there will not be any signals for the symbols upon which I did place a limit order, but which did not result in a fill (due to adverse price action). The end result is that I do not seem to have the scores of the other candidates with which to make the comparrison and zero out the "false" fills, as expanded upon in the above thread.
--- In [email protected], "gp_sydney" <[EMAIL PROTECTED]> wrote: > > I'm not entirely sure I understand what you are trying to do, but I > think the custom backtester interface will let you do it. In the CBI > you can scan all available signals before the trades are made and > change parameters for them, including setting the position size to > zero so that they'll never be taken. > > Since you're trying to rank signals across multiple stocks, and > discard some after a certain number have been selected, I'm not sure > you'll be able to do it in normal AFL code alone as that code only > relates to a single symbol at a time. > > Regards, > GP > > > --- In [email protected], "sfclimbers" <sfclimbers@> wrote: > > > > ts, > > > > Did you ever get an answer to this question? I believe that I've run > > into the same issue as posted in #114449 > > > > http://finance.groups.yahoo.com/group/amibroker/message/114449 which > > might present the case a little more clearly. I would have thought > > that this would be a common request. > > > > Thanks > > > > --- In [email protected], "techsmart" <mric@> wrote: > > > > > > > > > Maybe someone here can help. > > > > > > PositionScore alone will not do what I want. > > > > > > The day before trade entry I scan for POTENTIAL entries. I get up > > to > > > 40 or 50 signals. On the next day I use a limit order a certain > > > percentage below the prior day close as an entry. However, I do > > not > > > want to end up with too many buys, so I rank the potential entries > > by > > > ROC(C,40) and take the top 'x'(usually about 5 to 10) number of > > > signals and enter them as limit orders. This way I can be sure to > > > not overextend my equity. Of those limit orders I can have > > anywhere > > > from 0 to all filled. > > > > > > I have the system worked out in the AB backtester except that > > > PositionScore and MaxPositions does not accurately simulate what > > > really happens. Using these filters, will result in the system > > > taking the 'x' number of entries with the highest ROC amongst all > > > those that got hit. This is not reality, but based on the EOD data > > > on the day of entry. > > > > > > What I need is to have the backtester take all the signals and then > > > RANK them by ROC(C,40) and then take the top 'x' (say 5 or 10) and > > > use those as the basket to trade the next day. Of those 'x' number > > > of signals, anywhere from 0 to x may be entered, but this will be a > > > realistic backtest...just as I trade the system. > > > > > > Below is an exchange with AB support. I have not made clear what I > > > am trying to do, but maybe it will help explain it. > > > > > > In sum: I want to rank all signals by some filter factor and then > > > take the top 'x' number to use as potential buys the next day, > > > discarding all those that fall below a certain RANK. Hard cutoffs > > > will not give me a specific number of signals. For instance, if I > > > used ROC(C,40) > 20, some days I would get no signals and other > > days > > > I might get 30. > > > > > > Anyone know how this might be done? > > > > > > I think the 'for' loop might do, but not sure. > > > > > > ts > > > > > > --------------------------- > > > Marcin, > > > > > > I did not make myself clear. > > > > > > If you have signals the day before and a group of possible entries > > > that are > > > entered intraday THE NEXT DAY with a limit order, using > > PositionScore > > > and > > > MaxPositions does not simulate reality. Using that method, the > > > backtester > > > will take the top x number of trades based on PositionScore, but in > > > reality > > > you would have no idea which trades would hit their limit order > > > first, so > > > would not know until EOD which of the PositionScore ranked trades > > you > > > would > > > take. > > > > > > SO... the point is... > > > > > > I need a method to rank all the potential signals on the day PRIOR > > to > > > entry. > > > Then take x number of them (say 10) and only use those as entries > > on > > > the > > > next day. > > > > > > Can I do this: Take a list of symbols that pass a filter.... say > > > perhaps 40 > > > symbols, then rank them by some factor, such as ROC(C,40), then use > > > only the > > > top 10 (for example) as potential trades the next day. Of those > > 10, > > > only > > > the ones that hit a certain limit order would be bought. > > > > > > I need a way to rank and filter the signals from the day before and > > > then > > > strip off those below a certain rank. PositionScore does this > > after > > > the > > > fact...EOD on the entry day and this is not the way the system > > really > > > works. > > > > > > Hope I am expressing myself clearly. I know it is confusing. > > > > > > > > > > > > Subject: Re: [#16654] Ranking signals for possible entry the day > > > before > > > > > > > > > > Helo, > > > > > > > > You can use PositionScore variable in your formula and define the > > > criteria > > > > you use. > > > > (and combine it with the Maximum open positions limit) > > > > > > > > See: > > > > http://www.amibroker.com/guide/h_portfolio.html > > > > > > > > > > > > Best regards > > > > > > > > Marcin Gorzynski > > > > Amibroker.com Technical Support > > > > > > > > Subject: [#16654] Ranking signals for possible entry the day > > before > > > > > > > > > > > > First let me say that Amibroker is a wonderful tool for system > > > development > > > > and backtesting. I've used many others and find that Amibroker > > has > > > all > > > > the > > > > capabilities I've been looking for. I've already given you a > > > favorable > > > > review on the Elite Trader message board and will continue to > > > recommend > > > > your > > > > software to others. It's very capable and FAST! Thanks! > > > > > > > > > > > > V. 4.65.2 > > > > > > > > My question: > > > > > > > > My system finds potential signals on the day before entry. There > > > may be > > > > anywhere from 0 to 50 potential signals on any one day. > > > > > > > > Entries are made the NEXT day on a limit order. So, I cannot be > > > sure how > > > > many of those limit orders will be hit. I can simply limit the > > > number of > > > > orders I submit, but this does not seem to be a very good way to > > > backtest > > > > and does not simulate what I do in reality. In testing I have > > > found that > > > > filtering on certain parameters can improve results (such as > > taking > > > those > > > > signals for stocks with the greatest 40 day ROC). I can test > > this > > > in the > > > > backtester with the portfolio option using positionscore, but > > this > > > is > > > > unrealistic, because there might have been 20 limit orders hit > > > intraday > > > > and > > > > the backtester will take the 2 (or whatever MaxOpenPositions > > number > > > I have > > > > specified) with the best ROC, something I would not have been > > able > > > to > > > > predict intraday when limit orders are getting hit at various > > > different > > > > times. > > > > > > > > What I would like to do is this: On the day before entry (the > > > signal > > > > day), > > > > I would like to be able to rank all the possible signals by some > > > factor, > > > > such as 40 day ROC. This still leaves some uncertainty about how > > > many > > > > actual entries you'll get, but it would prevent the backtester > > from > > > doing > > > > something that couldn't be done in reality and would put an upper > > > limit on > > > > the number of trades taken. > > > > > > > > So...to summarize: > > > > > > > > Can the backtester take all the potential signals on day -1 and > > > rank them > > > > according to some factor (say, ROC(C,40)) and then just use a > > > limited > > > > subset > > > > of all the signals to use as actual limit orders on the next > > day. > > > Hard > > > > cut-offs, like ROC(C,40) > 20, don't work because that can give > > you > > > many > > > > signals one day and none the next. What is needed is a relative > > > ranking > > > > or > > > > scoring, so that the backtester will only take, for example, the > > 5 > > > stocks > > > > with the highest ROC40, all the others being discarded. > > > > > > > > I think the 'for loop' may be the way to do this, but I'm not > > > skilled > > > > enough > > > > to be able to sort it out. > > > > > > > > Thanks very much for your help and for a great trading tool. > > > > > > > > > > > > > > > > > > > > >
