Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

_cf_Returns.Drawdown ( PeriodCount ; IncomingArray ; DrawdownSoFar ; MaxDrawdown ; Type )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 5.0  (2 votes)
  Discuss this Custom Function

Peter Gerlings, CFA CAIA, PDG
www.rembrandtadvisors.com

This summarizes a drawndown history for a return series (typically a monthly or quarterly return stream representing an index, a portfolio, a security, etc.).

Sample Input:
a number between zero and one, depending on the how far the returns at a point in time are below the previous market peak.
Sample Output:
0.1746
1
0.998


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Description:

_cf_Returns.Drawdown ( PeriodCount ; IncomingArray ; DrawdownSoFar ; MaxDrawdown ; Type )

This summarizes a drawndown history for a return series (typically a monthly or quarterly return stream representing an index, a portfolio, a security, etc.). The value is "1" whenever there is a new market peak. Whenever the trailing return history is will be some value less than 1. It can never exceed one.

This is a recursive function, but does not call any other custom functions.

Note: "Type" is a boolean number: 1 = Max, 0 = Current. The latter is the assumed type if no value is provided. This determines what kind of drawdown result is provided, i.e the largest drawndown over the entire history (even if the current drawdown is zero), or just the current drawdawn. IMPORTANT!! The return stream MUST be provide in the IncomingArray parameter in CHRONOLOGICAL ORDER. I accomplish this by sorting the relationship based on the chronological date of each return entry, but there are other methods.

Written by Peter D. Gerlings, CFA, CAIA
August, 2011

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

After posting I went and tried to clean this up a little. Hopefully the comments are more helpful. I also got rid of a parameter

/*

_cf_Returns.Drawdown ( ReturnArray ; DrawdownSoFar ; MaxDrawdown ; Type )


This summarizes a drawndown history for a return series (typically a monthly or quarterly return stream representing an index, a portfolio, a security, etc.). The value is "1" whenever there is a new market peak. Whenever the trailing return history is negative it will be some value less than 1. It can never exceed one, and only go below zero in the case of leverage.

This is a recursive function, but does not call any other custom functions.

Note: "Type" is a boolean number: 1 = Max, 0 = Current. The latter is the assumed type if no value is provided. This determines what kind of drawdown result is provided, i.e the largest drawndown over the entire history (even if the current drawdown is zero), or just the current drawdawn. IMPORTANT!! The return stream MUST be provided in the ReturnArray parameter in CHRONOLOGICAL ORDER. I accomplish this by sorting the relationship based on the chronological date of each return entry, but there are other methods. Also, this assumes that numbers are entered in percentage and NOT decimal terms. I.e. 0.98% versus 0.98.

I call this function in the following let statement:

Let ( [

_IncomingReturnArray = List ( DATA_PerformanceHistory::PerformanceValue ) ;

// the relationship connecting to this separate TO is sor

Peter Gerlings, Amsterdam
January 11, 2018 2:07am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 8 + 3 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. WinClipboard ( String )
  (Fri, Jul 20, 12:52am)
2. BinToFloat32IEEE ( binary )
  (Wed, Jun 27, 11:01pm)
3. match_WindowName_List ( Window_Names_List )
  (Sun, Jun 24, 8:15pm)
4. match_LayoutName_List ( LayoutNames_List )
  (Sun, Jun 24, 8:09pm)
5. SQL_Creator_Select ( wrapped ; table_name ; layout_name ; using_field_from ; list_fields_only ; use_distinct ; key_field_list ; separator_for_records ; separator_for_fields )
  (Sun, Jun 24, 5:38pm)
6. SortList ( theList )
  (Sat, Jun 23, 8:45am)
7. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
8. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)

RSS Feed of Custom Functions