We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53d98fa commit 7302ab3Copy full SHA for 7302ab3
src/computable/tradebar.ts
@@ -133,7 +133,10 @@ class TradeBarComputable implements Computable<TradeBar> {
133
inProgressBar.vwap = (inProgressBar.vwap * inProgressBar.volume + trade.price * trade.amount) / (inProgressBar.volume + trade.amount)
134
// volume needs to be updated after vwap otherwise vwap calc will go wrong
135
inProgressBar.volume += trade.amount
136
- inProgressBar.timestamp = trade.timestamp
+
137
+ if (trade.timestamp.valueOf() > inProgressBar.timestamp.valueOf()) {
138
+ inProgressBar.timestamp = trade.timestamp
139
+ }
140
}
141
142
private _reset() {
0 commit comments