Gating based on threshold in Composite Nodes

Dear P123 community,

My understanding of the composite node is that it computes a weighted sum of the outputs of its immediate children. Then it maps the these sums (computed across the universe) by normalizing the set of sums uniformly into the interval [0,1].

Assuming the above is correct, how might implement hard gating based on thresholds?

To make the question concrete, consider the “Core Combination” ranking system in P123, which is the weighted sum of 6 children (Growth, Volatility, Sentiment, etc). The effect I would like to achieve is to guarantee that a stock which has a Growth rank < 60 should never be able to get near the top by compensating for it by doing well of the other 5 factors (Volatility Sentiment etc children). In this case 60 would be the threshold gate value.

If I was writing this at a low level, I might do something like this: insert a kind of gating node in between the root node of Core Combination and the root of the Growth subtree, and have this gating node consider the rank being output by its sole child (Growth). The gating node would pass the child’s output upwards if (and only if) the child’s output was >= 60. Otherwise the gating node would pass up -Infinity. This would ensure lower growth than 60 can never be compensated for by high scores in the other 5 areas.

How might one achieve this kind of effect within the grammar of the P123 tree-based representation of ranking systems?

Thank you,

Bilal

Hello Bilal,
I cant think of a way to do exactly what you are asking, but here are some ideas:

  1. Add a stock formula node with type 'Boolean values' and use the formula NodeRank("Core: Growth") > 60
    Give that node a fairly high weight ie at least 20% so that those with a growth rank < 60 are forced far down in the rank results.
    Note: NodeRank functions must be placed below the referenced node.

  2. Remove the stocks with Growth rank < 60 by using a rule directly in your Screen or Strategy Buy rules instead of in the ranking system. The rule is Rating("Core: Growth") > 60

Thank you. I attempted to operationalize gating growth at 60 as follows:

Add a node to the bottom of the Core ranking system:

<StockFormula Weight="15" RankType="Higher" Name="Gated: Growth" Description="" Scope="Universe">
	<Formula>Eval(NodeRank("Core: Growth") > 60, NodeRank("Core: Growth"), 0)</Formula>
</StockFormula>

while leaving the original Core: Growth node where it is, but reweighting it to 0

<Composite Name="Core: Growth" Weight="0" RankType="Higher">
	...etc
</Composite>

However, this fails with the error message:

Ranking failed on 02/20/2016: In 'Core Combination - Gated'-> In 'Gated: Growth'-> NodeRank functions must be placed below the referenced node and may not be used in cross-sectional functions.

Is there a way to use NodeRank to create transformationsof existing (higher up) node outputs? For example, my above failed attempt was to try and make a hockeystick transform of the original Growth, but I might for example have wanted to take the product of Growth and Value node outputs. It seems like NodeRank would do that, but then the error appears.

Thank you for your time and assistance.

Bilal

It failed because the weight of the Growth node is set to 0%. The system ignores any node with 0% weight, so change the weight to a non-0 number like .01.

You probable want to change the Ranking type to 'Boolean' for the NodeRank. Then the ranks will be either 100 or 0. If you use 'higher', it you get ranks like 99.8 or 60.
Like this: