# Optimization Criterion: Penalize the position opening duration

Since it is not possible to model the swap, it would be good to enable CP to penalize positions being open for long time.

So we can select "custom criteria" from the optimization tab and set somewhere in the CP settings the factor.

Lets assume the duration of a position is T in days.

Given the profit P in USD as currency, we can multiply P * exp(-T*c) where c is somewhere in the range of 0.1 and 0.05.

The total resulting metric would be the sum of all weighted profits

Andrey KhatimlianskyiIt can be implemented, of course.. But I'm not sure that this is really needed metric.