Dear all,
being new to Portfolio123 I checked out the intro webinars and some further resources before raising these questions. Maybe you can give me a hint:
the rules in portfolio123 (e.g. in a screen or in buy sell/rules) can be very complicated and I am looking of a possibility to debug or test a certain rule in that sense that I get an insight if they work on how I thought they should work. From my perspective this check is vital as with one wrong rule (using the command or parameters etc. wrongly) you are messing up your whole simulation. Are there any hints/tips on how to best debug a rule ?
In a simulation there is a ranking system and a buy rule. What is the sequence here? Actually I would assume first the ranking system and afterwards the buy rule gets executed. I am asking that because if there is a buy rule that is very restrictive it makes a difference if that rule kicks in first or the ranking system.
In answer to the first question, I suggest using rank performance tests on rules that have a wide variety of results. For example, if you want to test an accrual formula, you could create a node with it and see how the high-accrual companies perform versus the low-accrual companies.
In answer to the second question, buy rules are applied after the ranking is done. If you want rules applied prior to ranking, it's best to put them into your universe.
For understanding/testing what the rules do, the showvar() function is useful. It will display any variable you make in the screener for each stock, enabling you to check that the remaining stocks has the properties you want. Or that the formula you want to use as a rule gives the output you want.
For example if you want to see the short % of the stocks are, you can use:
showvar(@short,SI%ShsOut)
You can also calculate the sector-relative rank based on this:
showvar(@short_rank,FRank("SI%ShsOut",#sector))
It can also be helpful to see how a rule affects your system by using the "Totals" button, which show the number of stocks being removed by each rule.
I feel I should add that the general advice is to use as few buy/sell-rules as possible, try to push all your ideas into the ranking system instead. Your final system will then be much easier to test.
Thank you. I experimented a bit with showvar and yes that is what I had been looking for.
And thanks for clarification about the order of what kicks in first. It makes sense that the ranking systems is evaluated first before the buy rules.