Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 16:42:26 +0000



Time Range Highlight for Day Session

View Count: 515

[2023-07-24 02:05:25]
joshtrader - Posts: 488
One of the more common uses of Time Range Highlight is to color the evening session background a different color (in fact, this is recommended on the alerts page as the best way to do it). However, this means that it is only useful when using symbols which have the same session times. If I change from ES futures to CL futures, the highlight no longer does what it is intended to do. I would like to recommend an option to color based on the day/evening session, instead of a hard-coded time.

One alternative would be to make Alert variables for Day start and Evening start, and then that mechanism could be used.
[2023-07-24 13:38:45]
John - SC Support - Posts: 36322
One alternative would be to make Alert variables for Day start and Evening start, and then that mechanism could be used.

This does exist - you would need to use the "Spreadsheet System/Alert" study, where the "Chart Start Time" and "Chart End Time" are given in cells J75 and J76 (respectively). Note that these are the main session times, so the other hours are the Evening Session. You would then enter the following formula in K3:
=OR(FRACTIME(A3) < $J$75, FRACTIME(A3) > $J$76)

Then set the Draw Style for the K column (Buy Entry) as "Background Transparent" and set the "Width" as something relatively large, like 20 or so.

Refer to the following:
Spreadsheet Systems, Alerts and Automated Trading

Chart Studies: Background Transparent (ACSIL: DRAWSTYLE_BACKGROUND_TRANSPARENT)

Chart Studies: Subgraphs Tab >> Line Width
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-07-25 17:29:31]
joshtrader - Posts: 488
Thank you John.
In case anyone else does this, with volume/tick bars, I found it necessary to add the following change for greater accuracy:

=OR(FRACTIME(A3) < $J$75, FRACTIME(A3) >= $J$76 + (1/86400))

This is because the end time is expressed as :59 seconds when in fact it is :00, exclusive. I did not test this at the midnight boundary so caution on that, but for anything else I think it should work.
[2023-07-25 17:47:24]
joshtrader - Posts: 488
Also, while I appreciate this solution, I am probably not going to use it, after observing the behavior for a few minutes. The issue is that the width must be set sufficiently high to cover the whole bar width when zoomed in, but then when zooming out, a large width makes it so that the last colored bar overlaps too much with the first uncolored bar, and so some bars which appear to have a shaded background are simply showing the coloring from previous bars. Also, it's quite an expensive thing using a spreadsheet study, to simply achieve a colored background. I'll make do with the existing background highlight study and possibly edit the code (if it's open?) to do what I want it to do.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account