1. Yes, but Fraction would need to be expressed as a whole number. Use 1/NumberOfSymbols * 100
2. Yes. e.g. listnum = ...; symbols = CategoryGetSymbols( categoryWatchlist, listnum ); symcount = StrCount( symbols, "," ) + 1; 3. Neither. I believe that it uses the current bar equity on a bar by bar basis. http://www.amibroker.com/guide/afl/afl_view.php?name=setpositionsize Mike --- In [email protected], "lucianomt" <lucian...@...> wrote: > > So basically I need to do: > > Fraction = 1/NumberOfSymbols > SetPositionSize( Fraction, spsPercentOfEquity ); > > 1) Would be above code acheive the intended result? > 2) Is there a way to count the number of symbols in a watchlist? > 3) Does the SetPositionSize function use the last bar equity or initial > equity? (I do see there is a checkbox on the AA > Report tab, but I can't > find the AFL version.) > > > > > --- In [email protected], "Mike" <sfclimbers@> wrote: > > > > If by aggregate result you mean that you want to see what would happen to > > total equity, win/loss ratios, etc. when taking all signals together, then > > I think that you have answered your own question. > > > > Given that gains and losses in the other stocks have a direct impact on > > what is available to apply to the current signal, I believe that you must > > employ some form of portfolio allocation. > > > > Taking it to the extreme, you need to know that you are bankrupt before > > considering the next signal. Similarly, even at $1 position size, if you > > generate more signals than you have cash, something has to give. > > > > If you just want to see how each symbol individually would perform, you can > > select "Individual Backtest" from the drop list of the Backtest button in > > the AA window. > > > > Mike > > > > --- In [email protected], "lucianomt" <lucianomt@> wrote: > > > > > > Thanks for the reply Mike. > > > I believe I have the strategy and watchlist part nailed down. I am > > > actually looking for specific instructions on how to use the AA to test > > > the strategy for all the symbols in the watchlist and getting an > > > aggregate result. I am not looking to optimize returns by choosing > > > between alternative positions (using positionscore, etc), rather an > > > analysis that will trade all the signals in every stock. > > > > > > I guess I could set position size to 1/nth of equity (n = number of > > > symbols in watchlist). But I was wondering if AA had a built-in feature > > > that produced the same result without the need to set up a portfolio > > > allocation logic. > > > > > > > > > > > > > > > --- In [email protected], "Mike" <sfclimbers@> wrote: > > > > > > > > Run it against a watch list. If your single stock is representative of > > > > its sector, you might try including other stocks in the same sector. > > > > Conversely, you might try offsetting it by including stocks with > > > > "opposite" behavior to counter the drawdowns (typically at the expense > > > > of reduced peaks also). > > > > > > > > Create your own watchlist, or use one provided by your data provider > > > > (e.g. components of the S&P 500, etc). Use portfolio backtester from AA > > > > window. > > > > > > > > Alternatively, if you don't want to maintain a watch list, add logic to > > > > only Buy if the symbol belongs to a chosen sector/industry/whatever, > > > > then run against all symbols. > > > > > > > > If you've managed to capture a generic pattern you could apply it to > > > > all stocks in the database in search of as many signals as possible. > > > > > > > > The combinations are endless, and 'best' is subjective. > > > > > > > > Mike > > > > > > > > --- In [email protected], "lucianomt" <lucianomt@> wrote: > > > > > > > > > > I've developed a trading strategy and have tested/optimized it using > > > > > one stock. What is the best way to test it with a list of stocks? > > > > > > > > > > I don't have a portfolio allocation logic, I just need the aggregate > > > > > numbers for all the stock on the list. > > > > > > > > > > > > > > >
