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.
sourceTradingPipeline.PNL.pnl Method
julia
pnl(
short::TradingPipeline.PNL.Short
) -> TradingPipeline.PNL.Result
Calculate profit/loss of a short position.
sourceTradingPipeline.PNL.qty Method
julia
qty(c::Contracts, price::Number)
Convert contracts into the equivalent quantity of the asset being traded.
sourceTradingPipeline.PNL.qty Method
julia
qty(n::Number, price::Number)
This just returns n since the quantity n
.
TradingPipeline.PNL.@pnl Macro
julia
@pnl entry exit quantity leverage
Calculate the profit/loss of a long positon. The quantity
and leverage
are optional.
TradingPipeline.PNL.@pnls Macro
julia
@pnls entry exit quantity leverage
Calculate the profit/loss of a short positon. The quantity
and leverage
are optional.