As a first answer to your request, I attach an indicator which plots the
opening range for various
futures contracts. I have done this for my own needs as well. There were four things I wanted to integrate:
(1) Display the open of the
RTH session.
(2) If you put the indicator on a chart and then switch instruments, the indicator should automatically select the correct opening period for the instrument. For example the opening period for ES should be 8:30 to 9:30 AM CT, whereas the opening period for 6E should be 8:00 to 9:00 AM ET. This requires that the indicator knows the default values and that you can change them via indicator dialogue.
(3) With ever changing daylight savings times between Europe the US and the rest of the world, the indicator should adapt automatically to these times. So you cannot enter the opening time in your local timezone, but you need to indicate teh session length (close time as per session template - opening time). For example for ES the correct session length would be 15:15 - 8:30 = 6h45, for TF the session length would be 18:00 - 9:30 = 8h30.
(4) Some of the session start at strange times, like the GC session at 8:20 AM, or the SI session at 8:25 AM. If you use larger time frames the data required to calculate the opening range is not included with the chart data base. There will be no bar opening at 8:25 and you cannot display the correct RTH open. This requires to load minute data separately, and calculate the opening range from this data.
(1) to (3) are implemented with the current version, have kept (4) for future improvement.
Default session times based on ETH, opening period based on RTH
FOREX: ETH session 17:00 ET - 17:00 ET, opening period starts 8:00 ET
Currency Futures: ETH session 17:00 CT - 16:00 CT, opening period starts 7:00 CT
DX (Dollar Index): ETH session 20:00 ET - 18:00 ET, opening period starts 8:00 ET
CME Index Futures: ETH session 15:30 CT - 15:15 CT, opening period starts 8:30 CT
TF (Russell 2000): ETH session 20:00 ET - 18:00 ET, opening period starts 9:30 ET
EUREX Index Futures: ETH session 8:00
CET - 22:00 CET, opening period starts 9:00
CBOT Interest Rate Futures: ETH session 17:00 CT - 16:00 CT, opening period starts 8:20 CT
EUREX Interest Rate Futures: ETH session 8:00 - 22:00 CET, opening period starts 8:00
CL (WTI Crude): ETH session 18:00 ET - 17:15 ET, opening period starts 9:00 ET
BC (Brent Crude, ICE): ETH session 20:00 ET - 18:00 ET, opening period starts 9:00 ET
GC (Gold) : ETH session 18:00 ET - 17:15 ET, opening period starts 8:20 ET
SI (Silver): ETH session 18:00 ET - 17:15 ET, opening period starts 8:25 ET
HG (Copper): ETH session 18:00 ET - 17:15 ET, opening period starts 8:10 ET
To catch the correct opening period, you need to enter the difference between session end as per session template and the opening time.
The solution adapted may look complicated, but there are some advantages:
- The indicator will adapt to any chosen template and settings
- You can select the duration of the opening period (for example 5, 15, 30 or 60 minutes)
- You can switch instruments and the opening range will adapt to the instrument
- The opening range will remain correct, when the US has DST for Halloween and Europe is already back to standard time
Feedback welcome.