On the left is a chart from TradingView for May 23 2025, on the right is the chart from the WL on NQ ASCII dataset. The intraday data is the same (with an adjust correction), but the program treats this day as two separate days, even though both brokers and TradingView combine the following two days into one.

Then I tested it in a different way, I ran it on daily bars and compared the results. Though I’m not sure that this method is correct.

Then I tested it in a different way, I ran it on daily bars and compared the results. Though I’m not sure that this method is correct.
CODE:
using WealthLab.Backtest; using WealthLab.Core; namespace WealthScript5 { public class MyStrategy : UserStrategyBase { public override void Initialize(BarHistory bars) { BarHistory intraday = WLHost.Instance.GetHistory(bars.Symbol, HistoryScale.Minute30, bars.StartDate.AddDays(-1), bars.EndDate, 0, null); BarHistory daily = BarHistoryCompressor.ToDaily(intraday); PlotBarHistory(daily, "Price", WLColor.Magenta.SetAlpha(100)); } public override void Execute(BarHistory bars, int idx) { } } }
Rename
1. You must Synchronize after compressing if you plan to work/plot with the chart's bars.
2. Daily bars will differ from what you synchronize by time with intraday trading - especially for globex futures with IB.
Don't ask me where or when they get their globex closing price from - I can't figure it out.
3. Anyway, run it with Synchronization on intraday bars. You'll see the Daily bar change at 4pm (assuming CME market time).
You just have to decide if you want to use your own real-sychronized prices based on actual trading, or the ones IB makes up from who knows where?
2. Daily bars will differ from what you synchronize by time with intraday trading - especially for globex futures with IB.
Don't ask me where or when they get their globex closing price from - I can't figure it out.
3. Anyway, run it with Synchronization on intraday bars. You'll see the Daily bar change at 4pm (assuming CME market time).
CODE:
BarHistory intraday = bars; // 30-minute or any intraday chart BarHistory daily = BarHistoryCompressor.ToDaily(intraday); daily = BarHistorySynchronizer.Synchronize(daily, bars); PlotBarHistory(daily, "Price", WLColor.Magenta.SetAlpha(100));
You just have to decide if you want to use your own real-sychronized prices based on actual trading, or the ones IB makes up from who knows where?
I am aware of Synchronize, but that's not the reason. Let's measure another way.

OHL prices match in most cases, but on some days WL counts two days when all other services (I double checked several) count one. Apparently, this is something specific to the futures market.
And IB really counts daily bars strange. I'll stick with the compressing option, but as long as there is a problem with the extra day, that's not a solution either.
Upd: On Nov 25, the High also differs significantly
CODE:That's what we get
BarHistory intraday = WLHost.Instance.GetHistory(bars.Symbol, HistoryScale.Minute5, bars.StartDate, bars.EndDate, 0, null); BarHistory daily = BarHistoryCompressor.ToDaily(intraday); for (int i = 0; i < daily.Count; i++) WriteToDebugLog($"{daily.DateTimes[i].ToShortDateString()}, {daily.Open[i]}, {daily.High[i]}, {daily.Low[i]}, {daily.Close[i]}");
OHL prices match in most cases, but on some days WL counts two days when all other services (I double checked several) count one. Apparently, this is something specific to the futures market.
And IB really counts daily bars strange. I'll stick with the compressing option, but as long as there is a problem with the extra day, that's not a solution either.
Upd: On Nov 25, the High also differs significantly
Re: special hours for Thanksgiving.
The market session that opened Wednes, 2025-11-26 17:00 closed on Thurs, 2025-11-27 12:00. The market reopened Thurs, 2025-11-27 17:00 (like normal) and closed Fri, 2025-11-28 12:30, an early holiday close.
We count those days like we do every other day of the year. I can't tell you why the providers completely skip the daily bar on Thankgiving, but here's an explanation from from Grok why Daily and intraday prices will basically never align for futures:
-----------
The daily closing price for CME futures contracts like the E-mini Nasdaq-100 (NQ) is the official daily settlement price determined by CME Group, rather than simply the last trade price at a specific cutoff like 16:00 CST (which appears to be a slight misalignment with standard settlement timing, as the process occurs earlier). This settlement price is used for marking positions to market, margin calculations, and as the "close" in daily data feeds from providers.
For NQ specifically, the lead (front) month contract's settlement follows a tiered procedure based on electronic trading activity on CME Globex:
o Primary Method (Tier 1): If trades occur during the designated 30-second settlement window (15:14:30 to 15:15:00 Central Time, or 3:14:30 PM to 3:15:00 PM CT), the price is the volume-weighted average price (VWAP) of those trades.
o Fallback (Tier 2): If no trades happen in that window, it's the midpoint of the lowest bid and highest ask during the same period.
o Further Fallback (Tier 3): If no two-sided market (bid/ask) is available, the net change in the underlying Nasdaq-100 cash index from the prior settlement is applied to the previous day's NQ settlement price.
Subsequent contract months (e.g., second month and beyond) are derived similarly but anchored to the lead month's settlement, often using spread trades or prior relationships if direct activity is lacking. In rare cases of anomalies, CME staff may adjust for an alternative price.
This process occurs about 15 minutes after the Nasdaq cash market close (which is at 3:00 PM CT / 4:00 PM ET), allowing futures trading to continue and capture post-close adjustments. Discrepancies between daily and intraday data can arise because intraday feeds might reflect real-time trades at other times (e.g., exactly at cash close or later in the session), while the daily close strictly uses this settlement methodology. Trading in NQ continues electronically until 4:00 PM CT, but the settlement is fixed at that earlier window.
cftc.gov
The market session that opened Wednes, 2025-11-26 17:00 closed on Thurs, 2025-11-27 12:00. The market reopened Thurs, 2025-11-27 17:00 (like normal) and closed Fri, 2025-11-28 12:30, an early holiday close.
We count those days like we do every other day of the year. I can't tell you why the providers completely skip the daily bar on Thankgiving, but here's an explanation from from Grok why Daily and intraday prices will basically never align for futures:
-----------
The daily closing price for CME futures contracts like the E-mini Nasdaq-100 (NQ) is the official daily settlement price determined by CME Group, rather than simply the last trade price at a specific cutoff like 16:00 CST (which appears to be a slight misalignment with standard settlement timing, as the process occurs earlier). This settlement price is used for marking positions to market, margin calculations, and as the "close" in daily data feeds from providers.
For NQ specifically, the lead (front) month contract's settlement follows a tiered procedure based on electronic trading activity on CME Globex:
o Primary Method (Tier 1): If trades occur during the designated 30-second settlement window (15:14:30 to 15:15:00 Central Time, or 3:14:30 PM to 3:15:00 PM CT), the price is the volume-weighted average price (VWAP) of those trades.
o Fallback (Tier 2): If no trades happen in that window, it's the midpoint of the lowest bid and highest ask during the same period.
o Further Fallback (Tier 3): If no two-sided market (bid/ask) is available, the net change in the underlying Nasdaq-100 cash index from the prior settlement is applied to the previous day's NQ settlement price.
Subsequent contract months (e.g., second month and beyond) are derived similarly but anchored to the lead month's settlement, often using spread trades or prior relationships if direct activity is lacking. In rare cases of anomalies, CME staff may adjust for an alternative price.
This process occurs about 15 minutes after the Nasdaq cash market close (which is at 3:00 PM CT / 4:00 PM ET), allowing futures trading to continue and capture post-close adjustments. Discrepancies between daily and intraday data can arise because intraday feeds might reflect real-time trades at other times (e.g., exactly at cash close or later in the session), while the daily close strictly uses this settlement methodology. Trading in NQ continues electronically until 4:00 PM CT, but the settlement is fixed at that earlier window.
cftc.gov
Your Response
Post
Edit Post
Login is required