Skip to content

DrawdownPeak Function Has Issues #132

@rjvelasquezm

Description

@rjvelasquezm

Noticed an issue in the DrawdownPeak private function when trying to calculate a Ulcer Index myself using the Drawdowns function.

Seems to me DrawdownPeak may be an old implementation of Drawdowns that never got swapped in some older functions.

Issue is returns are divided by 100 at one point, compounded and then multiplied back by 100. So it seems to assumes percent returns are passed in as integers instead of decimals. It seems to me in the rest of the package decimal returns are always expected so seems to fall out of place.

The fix is simple, just remove the divide by 100 and multiply by 100. That makes drawdown results match those returned by the Drawdowns function.

                                    val = val * (1 + R[j]/100)
                          
                                    drawdownpeak[i] = (val - 1) * 100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions