Skip to content
18

Fees Constraints

PortfolioOptimisers.add_to_fees! Function
julia
add_to_fees!(model::Model, expr::AbstractJuMPScalar)

Accumulate a JuMP expression into the :fees expression of the optimisation model.

Creates the :fees expression if it does not yet exist; otherwise adds expr to it in place.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • expr::JuMP.AbstractJuMPScalar: The fee expression to accumulate.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_turnover_fees! Function
julia
set_turnover_fees!(args...)

Add a turnover-based transaction fee expression to the JuMP optimisation model.

The fall-through method does nothing. The concrete method computes val' * |w - wt| via NormOneCone constraints and accumulates the result into the model's :fees expression via add_to_fees!.

Mathematical definition

tftn,i|wiwt,ik|,ftn=vtftn.

Where:

  • wi: Portfolio weight for asset i.

  • wt,i: Benchmark weight for asset i.

  • k: Budget scaling / homogenisation variable.

  • v: Per-asset fee rate vector.

  • tftn: Auxiliary absolute-deviation variable vector.

  • ftn: Total turnover fee.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • tn::Turnover: Turnover specification containing benchmark weights w and per-unit fee val.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_non_fixed_fees! Function
julia
set_non_fixed_fees!(args...)

Add all non-fixed (proportional and turnover) fee expressions to the JuMP optimisation model.

The fall-through method does nothing. The concrete method delegates to set_long_non_fixed_fees!, set_short_non_fixed_fees!, and set_turnover_fees!.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • fees::Fees: Fee specification containing long, short, and turnover fee rates.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_long_non_fixed_fees! Function
julia
set_long_non_fixed_fees!(args...)

Add proportional long-side fee expression to the JuMP optimisation model.

The fall-through method does nothing. The concrete method adds fl' * lw to the model's :fees expression via add_to_fees!.

Mathematical definition

fl=fllw.

Where:

  • fl: Total long-side fee.

  • fl: Per-asset long-side fee rate vector.

  • lw: Long-weight vector.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • fl: Long-side fee rate(s). Accepts a scalar Number or a VecNum.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_short_non_fixed_fees! Function
julia
set_short_non_fixed_fees!(args...)

Add proportional short-side fee expression to the JuMP optimisation model.

The fall-through method does nothing. The concrete method adds fs' * sw to the model's :fees expression via add_to_fees!. Does nothing when no short-weight variable :sw exists in the model.

Mathematical definition

fs=fssw.

Where:

  • fs: Total short-side fee.

  • fs: Per-asset short-side fee rate vector.

  • sw: Short-weight vector.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • fs: Short-side fee rate(s). Accepts a scalar Number or a VecNum.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_fixed_fees! Function
julia
set_fixed_fees!(
    model::Model,
    sp::AbstractMIPSpace,
    ind::AbstractMIPIndicators,
    ffl::Union{Nothing, Number, AbstractVector{<:Union{var"#s34", var"#s33"} where {var"#s34"<:Number, var"#s33"<:AbstractJuMPScalar}}},
    ffs::Union{Nothing, Number, AbstractVector{<:Union{var"#s34", var"#s33"} where {var"#s34"<:Number, var"#s33"<:AbstractJuMPScalar}}},
    ffl_flag::Bool,
    ffs_flag::Bool
)

Add fixed-fee expressions to the JuMP optimisation model.

A fixed fee is charged per position held, whatever its size, so unlike the proportional fees above it cannot be written against the weights — it needs a binary saying whether the position is there at all. That is the only reason this one takes an indicator bundle, and the only reason a MIP builder has to run before it.

Mathematical definition

ffl=fflbl,ffs=ffsbs.

Where:

  • bl, bs: Long and short binaries (long_bin, short_bin). These are the binaries themselves, never the gates: a fee is incurred by the decision to hold, which is what the bit records, and the gates relax to continuous variables when the budget is free.

  • ffl, ffs: Long and short fixed-fee rates.

Under a long-only builder the held bit is the long bit (HeldIndicators), and there is no short side to charge.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • sp::AbstractMIPSpace: Weight space the fees are charged in.

  • ind::AbstractMIPIndicators: Indicator bundle supplying the binaries.

  • ffl::Option{<:Num_VecNum}: Long-side fixed fee rate(s).

  • ffs::Option{<:Num_VecNum}: Short-side fixed fee rate(s).

  • ffl_flag::Bool: Whether to add the long fixed-fee expression.

  • ffs_flag::Bool: Whether to add the short fixed-fee expression.

Returns

  • nothing.

Related

source