smartift / grail

0 stars 0 forks source link

Super Feed Data Has OHLC=0 For Some Bars #47

Open guytp opened 6 years ago

guytp commented 6 years ago

Suepr feed as OHLC as 0 on a lot of M5 bars due to slow sync issues against Bitfinex.

Need a way to force recalculation of these at a later date. Recent changes should reduce likelihood of this happening, but still needs a fix.

Smart service should also exclude these bars, until they have data

UPDATE cb SET cb.IsDirtyBar = 1, cb.High = cb2.High, cb.Low = cb2.Low, cb.[Close] = cb2.[Close], cb.[Open] = cb2.[Open] FROM ChartBar cb JOIN ChartBar cb2 on cb2.OpenTime = cb.OpenTime AND cb2.ExchangeId = 4 AND cb2.InstrumentId = cb.InstrumentId WHERE cb.High=0 AND cb.Low=0 AND cb.OPenTime <= DATEADD(minute, -5, GETUTCDATE())

guytp commented 6 years ago

SELECT * FROM ChartBar cb (nolock) JOIN ChartBar cb2 (nolock) on cb2.OpenTime = cb.OpenTime AND cb2.ExchangeId = 4 AND cb2.InstrumentId = cb.InstrumentId WHERE cb.High=0 AND cb.Low=0 AND cb.OPenTime <= DATEADD(minute, -5, GETUTCDATE()) AND cb2.High != 0