draw a colored box around the ETH, Europe/London sessions


Category:
0
0

The idea is to drawing the box around the overnight session, and another box to highlight the Europe or London session, to allow easy visual identification for any dentified support/resistance areas, allowing attribution to specific exhanges, for Futures…

 

did a bunch of poking around tonite, and what Im thinking might work is to

1) input the start and stop times for the sessions (these below are just examples)

input EUOpen = 0100;
input RTHOpen = 0900;
input RTHClose = 1600;
input AsiaOpen = 1800;

2) use conditional logic to then allow addcloud to paint the boxes to the high and lo of those periods

am I on the right track here?

is there a better way to get RTH/ETH exchange/market hours?

do I need to use secondstilltime?

Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on April 5, 2020 9:43 pm
297 views
0
Private answer

The simplest solution is to merely highlight the background of the chart. Trying to draw a box that is based on high and low of a specified period adds a level of complexity that is beyond the scope of what I can provide free of charge in the Q&A forum.

If you view the following video:

https://www.hahn-tech.com/thinkorswim-overnight-range-scan-alert/

You will find that it has a section of the chart shaded in Yellow to show what is called "The Alert Period". The period of time in which alerts can be triggered. Take a look at the code in that chart study and you'll see how to highlight a section of the chart based on a start and end time.

Here is a section of code to stole from that chart study I just referenced in the link above:

input alertPeriodStart = 930;
input alertPeriodEnd = 1130;
def startCounter = SecondsFromTime(alertPeriodStart);
def endCounter = SecondsTillTime(alertPeriodEnd);
def alertPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
AddCloud(if alertPeriod then Double.POSITIVE_INFINITY else Double.NaN, if alertPeriod then Double.NEGATIVE_INFINITY else Double.NaN, Color.YELLOW, Color.BLACK);

I removed the section of code that forces the shading to only be applied to the current day's trade. Adjust the start and end time through user settings. If you want more than one session highlighted in different colors just create several chart studies and adjust the default times and colors accordingly.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 6, 2020 7:45 am