File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,18 @@ impl BarBuilder {
233
233
self . close = self . last_close ;
234
234
}
235
235
236
+ if let ( Some ( close) , Some ( low) ) = ( self . close , self . low ) {
237
+ if close < low {
238
+ self . low = Some ( close) ;
239
+ }
240
+ }
241
+
242
+ if let ( Some ( close) , Some ( high) ) = ( self . close , self . high ) {
243
+ if close > high {
244
+ self . high = Some ( close) ;
245
+ }
246
+ }
247
+
236
248
// SAFETY: The open was checked, so we can assume all prices are Some
237
249
let bar = Bar :: new (
238
250
self . bar_type ,
Original file line number Diff line number Diff line change @@ -245,6 +245,10 @@ cdef class BarBuilder:
245
245
self ._low = self ._last_close
246
246
self ._close = self ._last_close
247
247
248
+
249
+ self ._low._mem.raw = min (self ._close._mem.raw, self ._low._mem.raw)
250
+ self ._high._mem.raw = max (self ._close._mem.raw, self ._high._mem.raw)
251
+
248
252
cdef Bar bar = Bar(
249
253
bar_type = self ._bar_type,
250
254
open = self ._open,
You can’t perform that action at this time.
0 commit comments