Skip to content

Modern Finance ReturnSummary

Paul Squires edited this page Oct 19, 2026 · 4 revisions

Home › Finance › Finance › ReturnSummary

ReturnSummary

Holds the figures SummarizeReturns computes, one field each.

Syntax

s.Total_  s.Annualized_  s.Volatility_  s.Sharpe_  s.Sortino_  s.MaxDrawdown_  s.Observations_

Examples

#import "std/money"
using money

'' Everything SummarizeReturns computes, in one record.
dim as float64 r( 0 to 11 ) = { 0.02, -0.01, 0.03, 0.015, -0.025, 0.04, _
                               0.01, -0.005, 0.02, 0.03, -0.015, 0.025 }
dim as float64 b( 0 to 11 ) = { 0.018, -0.012, 0.025, 0.012, -0.02, 0.035, _
                               0.008, -0.004, 0.018, 0.028, -0.012, 0.022 }

var s = SummarizeReturns( r( ), 0.0002, RETURN_MONTHLY )

print s.Value( ).Observations_           '' 12
print s.Value( ).Total_                  '' 0.1410864155548182
print s.Value( ).Volatility_             '' 0.07088723439378913
print s.Value( ).MaxDrawdown_            '' 0.02500000000000009

Library: Finance
Category: Finance
Documented under: Nothing Becomes A Keyword
Source: pkg/std/money/finport.tiko in the tiko repository.

Clone this wiki locally