Skip to content

Commit e16370e

Browse files
Swap signal/histogram to align correctly (#520)
1 parent e437b84 commit e16370e

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

polygon/rest/models/indicators.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def from_dict(d):
3131
return MACDIndicatorValue(
3232
timestamp=d.get("timestamp", None),
3333
value=d.get("value", None),
34-
signal=d.get("histogram", None),
35-
histogram=d.get("signal", None),
34+
signal=d.get("signal", None),
35+
histogram=d.get("histogram", None),
3636
)
3737

3838

test_rest/test_indicators.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -94,50 +94,50 @@ def test_get_macd_indicators(self):
9494
MACDIndicatorValue(
9595
timestamp=1660881600000,
9696
value=6.912856964275647,
97-
signal=-42.59162765160919,
98-
histogram=49.504484615884834,
97+
signal=49.504484615884834,
98+
histogram=-42.59162765160919,
9999
),
100100
MACDIndicatorValue(
101101
timestamp=1660795200000,
102102
value=7.509881940545313,
103-
signal=-51.45940882014157,
104-
histogram=58.96929076068688,
103+
signal=58.96929076068688,
104+
histogram=-51.45940882014157,
105105
),
106106
MACDIndicatorValue(
107107
timestamp=1660708800000,
108108
value=7.734132135566654,
109-
signal=-62.67058280737392,
110-
histogram=70.40471494294057,
109+
signal=70.40471494294057,
110+
histogram=-62.67058280737392,
111111
),
112112
MACDIndicatorValue(
113113
timestamp=1660622400000,
114114
value=7.973958808765531,
115-
signal=-76.35755231359147,
116-
histogram=84.331511122357,
115+
signal=84.331511122357,
116+
histogram=-76.35755231359147,
117117
),
118118
MACDIndicatorValue(
119119
timestamp=1660536000000,
120120
value=7.90112075397235,
121-
signal=-93.39873532696055,
122-
histogram=101.2998560809329,
121+
signal=101.2998560809329,
122+
histogram=-93.39873532696055,
123123
),
124124
MACDIndicatorValue(
125125
timestamp=1660276800000,
126126
value=7.719066821080332,
127-
signal=-114.33606377695492,
128-
histogram=122.05513059803525,
127+
signal=122.05513059803525,
128+
histogram=-114.33606377695492,
129129
),
130130
MACDIndicatorValue(
131131
timestamp=1660190400000,
132132
value=7.468267821253335,
133-
signal=-139.99487694943858,
134-
histogram=147.4631447706919,
133+
signal=147.4631447706919,
134+
histogram=-139.99487694943858,
135135
),
136136
MACDIndicatorValue(
137137
timestamp=1660104000000,
138138
value=7.542041992364375,
139-
signal=-171.03107543375833,
140-
histogram=178.5731174261227,
139+
signal=178.5731174261227,
140+
histogram=-171.03107543375833,
141141
),
142142
],
143143
underlying=IndicatorUnderlying(

0 commit comments

Comments
 (0)