Skip to content

TradingPipeline.PNL

This is a utility module for doing PNL calculations.

TradingPipeline.PNL.pnl Method
julia
pnl(
    long::TradingPipeline.PNL.Long
) -> TradingPipeline.PNL.Result

Calculate profit/loss of a long position.

source
TradingPipeline.PNL.pnl Method
julia
pnl(
    short::TradingPipeline.PNL.Short
) -> TradingPipeline.PNL.Result

Calculate profit/loss of a short position.

source
TradingPipeline.PNL.qty Method
julia
qty(c::Contracts, price::Number)

Convert contracts into the equivalent quantity of the asset being traded.

source
TradingPipeline.PNL.qty Method
julia
qty(n::Number, price::Number)

This just returns n since the quantity n.

source
TradingPipeline.PNL.@pnl Macro
julia
@pnl entry exit quantity leverage

Calculate the profit/loss of a long positon. The quantity and leverage are optional.

source
TradingPipeline.PNL.@pnls Macro
julia
@pnls entry exit quantity leverage

Calculate the profit/loss of a short positon. The quantity and leverage are optional.

source

Let's see if this change triggers anything.