Data timezone and market hours unviversal
Forums › ProRealTime English forum › ProOrder support › Data timezone and market hours unviversal
- This topic has 12 replies, 2 voices, and was last updated 1 week ago by
Method314.
-
-
04/19/2025 at 9:48 PM #246127
Hi,
Does anyone have a method to make the daily data from IG to ProRealTime a standardised format?
When I adjust the data in the timeframe settings the daily data is still 0000 to 0000. Although on a lower timeframe fine.
Is there a procedure or setting to have the daily data, market hours adjusted?
For example on the SPDR S&P 500, Ticker: SPY
Or whats the standard procedure to do this? For example, say I want to calculate the internal bar strength of the daily candle, for the last 5 daily candles within market hours. This is normally a simple procedure, but with ProRealCode it seems very elaborate? I think I’m missing something obvious.
04/19/2025 at 10:19 PM #246128Hi,
At the broker IG, CFDs are used with a “24-hour feed”, which means there are no “Regular Trading Hours” (RTH) or “Extended Trading Hours” (ETH) available (these are available when using broker IB with standardized futures).
If you still want to work with RTH and ETH on IG, you’ll need to create synthetic candles based on intraday data…04/19/2025 at 10:35 PM #246129Many thanks JS, thats what I’ve been doing so far, I was hoping that I missed something. It can make simple operations elaborate for the data set. If not done, when I standardise a process I’ll post with examples and structure.
You saved me a lot of time searching.
1 user thanked author for this post.
04/20/2025 at 12:36 PM #246146Okay, here’s the solution: IG 24hr data to standard market hours data conversion process. See pic below for ref.
Goto: Settings —> Platform settings—> Timezone = Use custom timezone —> Limit the display on intraday charts —-> Data = Use intra day quotes to build non-intraday candles.
Results: Daily data will now be as you expect to find it. Pic below for SPY data.
Market hours: You may have to drop down to a lower tf, say 1hr, find a notable candle, then on anyother platform you use (Python w/ Polygon data fetching say) align the time zone and market hours. I still find it a tad odd. even in the code, I use a 5 min freq, 195000 (HHMMSS) for my EOD time, 10 mins before close, on a 5 min chart, places order next candle = 5 min before close. But my Limit display data is set to 0930 to 1600. It is what it is.
Hopefully saves others time when coming to translate strategies to ProRealCode which trade ‘standard market hour’ EOD close data.
Putting in some ‘tags’ for other people who start with ProRealCode and have the same issue. Market Hr data, RTH, EHT, Polygon data, EODHD data, Tradingview data, Broker data, Time zones.
04/21/2025 at 10:37 AM #24614904/21/2025 at 3:32 PM #246156Thanks JS. For myself, I’m just translating some simple codes at the moment. I have many more using HAR volatility models ect so not to sure how thats going to go.
But for now. I wanted the daily data as per trading hours so I can easily calculate say the internal bar strength or any indicator really from daily close price and get a uniform result. IG day is 0000 to 0000 so didn’t translate as per other data sources. The above dealt with that. Although I still get discrepancies.
04/21/2025 at 5:08 PM #24615904/21/2025 at 6:00 PM #246161When using a “daily” strategy, you cannot use customized trading hours because the OHLC data would no longer match the actual “daily” candle…
If you switch back to the default trading hours, you’re faced with the issue that CFDs are traded 24 hours a day…
What you can do is change your timeframe to, for example, 5 minutes or 1 hour (IntraDay)…
This way, you stick to the default trading hours, but you can still define your preferred trading hours within your code using a condition like:
If OpenTime>=xxx and OpenTime<=yyy then
1 user thanked author for this post.
04/21/2025 at 6:58 PM #246163Thanks JS, really appreciate the help and input. That worked.
For others:
// accumulation and preload data
DEFPARAM CumulateOrders = False
DEFPARAM PreLoadBars = 500// Compute all indicators in Daily timeframe
TIMEFRAME(Daily, UpdateOnClose)
// Daily time frame indicator logic hereTIMEFRAME(Default)
// Set 5-minute timeframe for logic for orders to enter near close and still keep daily market hours adjusted data
TIMEFRAME(5 Minutes)// Entry : daily timeframe
//Entry logic here// Exit : exit daily timeframe
//Exit logic here// Trading logic at 16:50:00 (1655 order placed)
IF Time = 155000 THEN
IF NOT ONMARKET AND entryCondition THEN
// Buy/Short logic
ENDIFIF exitCondition THEN
// Sell/cover logic
ENDIF
ENDIF04/21/2025 at 6:59 PM #24616404/21/2025 at 7:04 PM #24616504/21/2025 at 7:13 PM #24616604/22/2025 at 12:11 PM #246213Ah I see. No problem. Well many thanks for the help again.
Actually now I spend some more time with ProRealTime, I think it’s great. The data formatting once sorted gives a clear runway. The tools, platform and esp the community are fantastic.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on