diff --git a/polygon/rest/models/indicators.py b/polygon/rest/models/indicators.py index 81252477..aedada5a 100644 --- a/polygon/rest/models/indicators.py +++ b/polygon/rest/models/indicators.py @@ -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), ) diff --git a/test_rest/test_indicators.py b/test_rest/test_indicators.py index ce477fbf..bad16025 100644 --- a/test_rest/test_indicators.py +++ b/test_rest/test_indicators.py @@ -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(