Skip to content

RSI & IMI aren't quite right #11

Open
@samjtro

Description

@samjtro

All of these calculations are slightly incorrect. Take a sample return of the standard call using go run ..

Observe:

...
{Close:171.52 Hi:173.74 Lo:171.3101 Volume:7.0346295e+07 PivotPoint:172.19003333333333 ResistancePoints:[173.06996666666666 174.61993333333334 175.49986666666666] SupportPoints:[170.64006666666666 169.76013333333333 168.21016666666665] SMA:165.10403166666669 RMA:173.91 EMA:169.29157807806158 RSI:261.07395138312324 VWAP:172.19003333333333 MACD:10.114237451658198 Chaikin:0 BollingerBands:[165.10403166666669 165.10403166666669 165.10403166666669] IMI:401.01853855586455 MFI:0 PCR:0 OI:0}]
...

The issues are as follows:

  • IMI is multiples higher than it should be. The calculation is (SumOfGains / SumOfGains + SumOfLosses) * 100, and it should be from 0-100 (similar to RSI), however, it is consistently 400-800.
  • RSI is also higher than it should be. The result of the calculation should be 0-100, and it is from 150-400 instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions