Hi Herman, It is always interesting to read how others use the CBT, and like you, I've played around with using (Static)VarSet, etc. within CBT
Don't know if you saw my earlier e-mails of a few days ago re dynamic rebalancing. Basically, due to mandates, I need to assess my risks on both an absolute and a relative basis. The latter means I want to be long all constituents of my benchmark, but then take "active bets" by underweighting or overweighting my positions versus the official relative weights in the benchmark. So, I have my scores (which are not complicated) and want to enter all of them as trades, in the sense of rebalancing trades (i.e. scale-in/out) depending on the score. For that purpose I tried indeed to use VarSet, as well as StaticVarSet to define WITHIN the CBT my relative weights referring to "external" arrays for benchmark weights which I then tweak to STOCK-SPECIFIC arrays of active weights. The difference between the latter and the "current PosValue" then becomes the amount to ScaleIn/Out. It turns out, or at least that is my conclusion, that you cannot do this in CBT. In summary, you can dynamically rebalance your portfolio by way of PositionScore, but not by PositionSize, because this only refers to the entry-date of a trade, not the intermediate sizes. If you (or anybody else dealing with these issues) have any thoughts, or even better a solution, on this, please let me know. Sorry if this turns out to be too much OT, but I'm desperate for a solution to what seems to me an obvious trading strategy. PS
