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.
JSParticipant
Senior
Hi,
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…
Many 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.
Okay, 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.
JSParticipant
Senior
Hi,
“OpenTime” gives the opening time of the candle so if you enter “If OpenTime>=195000” then no more orders will be placed after “195000”…
(“Time” gives the “Close” of the candle…)
Thanks 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.
Wait I get this? Is it possible to use prorealtime for trading normal market hours on IG data?
JSParticipant
Senior
When 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
Thanks 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 here
TIMEFRAME(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
ENDIF
IF exitCondition THEN
// Sell/cover logic
ENDIF
ENDIF
Can I message you in private?
Apologies, made an error above for the SPY the time logic for entry should be 155000 NOT 165000. (Market hours 0930 to 1600)
JSParticipant
Senior
Sorry, according to the rules of the forum it is not allowed to share personal information…
(see the forum rules, in yellow, at the bottom of the page)
Ah 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.