factor_agent.session.session_function#

session_function(graphs)[source]#

One KunQuant function with an output per graph, named after it: its value at each session’s last bar.

Every aggregation is expanded into its session sums; the bars before a session’s last are NaN. A subtree is computed once however often the graphs hold it: an operator computing what an earlier one of any graph computes is that operator (Mul(close, volume) and Mul(volume, close) are one, x + 1e8 - 1e8 and x two), so an aggregation of one subgraph in two graphs sums it once. Operators in or after a loop are kept as built, a loop’s body being its own.

Raises:
ValueError

If a graph does not end in a session aggregation.