Skip to content

Calculation of HREF and LREF in calculation.py is incorrect #2

Description

@mls149

Lines 48-49 and lines 61-62: the bracket for 0.5 is put wrongly, hence result is incorrect. Should multiply by 0.5 for second pair, not subtract from first pair.

Correct code as below:

            href[i] = ((data[high].iat[i]) - (data[close].iat[i-1])) - \
                       (0.5 * ((data[low].iat[i])-(data[high].iat[i-1])))

            lref[i] = ((data[close].iat[i-1]) - (data[low].iat[i])) - \
                (0.5 * ((data[low].iat[i-1])-(data[high].iat[i])))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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