weight_by_log#

API documentation for tradeexecutor.strategy.weighting.weight_by_log Python function.

weight_by_log(alpha_signals)[source]#

Use logarithmic weighting to dampen high signals.

  • Applies log(1 + signal) to each signal’s absolute value

  • Higher signals still get more weight, but the relationship is logarithmic rather than linear

  • Useful when raw signal values span a wide range and you don’t want top signals to dominate the portfolio

Parameters:

alpha_signals (Dict[int, float]) –

Return type:

Dict[int, float]