Skip to content

Commit

Permalink
Swap signal/histogram to align correctly (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpolygon authored Sep 23, 2023
1 parent e437b84 commit e16370e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions polygon/rest/models/indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def from_dict(d):
return MACDIndicatorValue(
timestamp=d.get("timestamp", None),
value=d.get("value", None),
signal=d.get("histogram", None),
histogram=d.get("signal", None),
signal=d.get("signal", None),
histogram=d.get("histogram", None),
)


Expand Down
32 changes: 16 additions & 16 deletions test_rest/test_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,50 +94,50 @@ def test_get_macd_indicators(self):
MACDIndicatorValue(
timestamp=1660881600000,
value=6.912856964275647,
signal=-42.59162765160919,
histogram=49.504484615884834,
signal=49.504484615884834,
histogram=-42.59162765160919,
),
MACDIndicatorValue(
timestamp=1660795200000,
value=7.509881940545313,
signal=-51.45940882014157,
histogram=58.96929076068688,
signal=58.96929076068688,
histogram=-51.45940882014157,
),
MACDIndicatorValue(
timestamp=1660708800000,
value=7.734132135566654,
signal=-62.67058280737392,
histogram=70.40471494294057,
signal=70.40471494294057,
histogram=-62.67058280737392,
),
MACDIndicatorValue(
timestamp=1660622400000,
value=7.973958808765531,
signal=-76.35755231359147,
histogram=84.331511122357,
signal=84.331511122357,
histogram=-76.35755231359147,
),
MACDIndicatorValue(
timestamp=1660536000000,
value=7.90112075397235,
signal=-93.39873532696055,
histogram=101.2998560809329,
signal=101.2998560809329,
histogram=-93.39873532696055,
),
MACDIndicatorValue(
timestamp=1660276800000,
value=7.719066821080332,
signal=-114.33606377695492,
histogram=122.05513059803525,
signal=122.05513059803525,
histogram=-114.33606377695492,
),
MACDIndicatorValue(
timestamp=1660190400000,
value=7.468267821253335,
signal=-139.99487694943858,
histogram=147.4631447706919,
signal=147.4631447706919,
histogram=-139.99487694943858,
),
MACDIndicatorValue(
timestamp=1660104000000,
value=7.542041992364375,
signal=-171.03107543375833,
histogram=178.5731174261227,
signal=178.5731174261227,
histogram=-171.03107543375833,
),
],
underlying=IndicatorUnderlying(
Expand Down

0 comments on commit e16370e

Please sign in to comment.