Login Page - Create Account

Support Board


Date/Time: Sat, 15 May 2021 10:51:48 +0000



[User Discussion] - What is the simplest way to plot a box around a time interval?

[2021-03-27 03:49:56]
RoadKill - Posts: 37 | Ending Date: 2021-01-01 [Expired]
I'm trying to find out what is the simplest way to plot a box that:
1. has a time range given by 2 certain hours and minutes, and
2. has the price level determined my the High and Low prices within that range.

For example,
I want to put a box on the chart showing the NY session that take place between 09:30 to 16:00 EST,
whose upper and lower boundaries are given by the High and Low within that time time.

After having looked at the hundreds of various example code, there is not one single example that plots a box of any kind, although there a plenty of weird and poorly documented functions that does all sort of other things... The closes I got was the "Weekly HL" (with no source code, afaict) and the "Daily Range Bands" with a lot of extra/undocumented features and spaghetti code.

Can some one please provide a study code to plot a box as suggested above?
[2021-03-27 20:34:53]
tomgilb - Posts: 2869 | Ending Date: 2021-10-14
I want to put a box on the chart showing the NY session that take place between 09:30 to 16:00 EST,
whose upper and lower boundaries are given by the High and Low within that time time.
The simplest way to do this is to use the High/Low For Time Period study:
- Set the Start/End times to 09:30 and 16:00.
- Set the SG1 Draw Style 'Transparent Fill Rectangle Top', and choose the color.
- Set the SG2 Draw Style 'Transparent Fill Rectangle Bottom'.

You could also use the Fill Rectangle Top/Bottom pair.
[2021-03-28 17:42:01]
RoadKill - Posts: 37 | Ending Date: 2021-01-01 [Expired]
Hi Tom,

Yes, I already tried that. But I need more than one session, and do
not want to (ultimately) have to add 12 studies in order to see all
the sessions I want. So I'm trying to do this in ACSIL, hoping to
combine them into one. I tried to use the Fill Rectangle Top/Bottom,
but could not get the time right, ending up just filling the very
last bar on chart.

I also looked at the Code for:
Studies6.cpp:3012:SCSFExport scsf_HighLowForTimePeriodExtendedLines
But, it's overly complicated as it is using a lot of extra (and useless) functions while
seemingly trying to compensate for a dynamic chart. This effectively prevents
you from effectively re-using the code for multiple sessions.

Basically we need (to create?) a function such that it can be used like this:
Rectangle(Name, Color, LineStyle, StartTime, EndTime, High, Low)

Frankly, I'm surprised there's not already something built-into SC for doing this.
Date Time Of Last Edit: 2021-03-28 17:47:05
[2021-03-28 22:18:45]
tomgilb - Posts: 2869 | Ending Date: 2021-10-14
You just need one High/Low For Time Period study for each session.
It draws a shaded area instead of a box.
See attached to see 3 sessions.
image3 Sessions.PNG / V - Attached On 2021-03-28 22:18:10 UTC - Size: 68.6 KB - 52 views
[2021-03-29 09:10:48]
User907968 - Posts: 493 | Ending Date: 2021-06-09
Frankly, I'm surprised there's not already something built-into SC for doing this.

If you don't want to use subgraphs to display the session boxes, there is certainly the possibility to use drawing tools within ACSIL - https://www.sierrachart.com/index.php?page=doc/ACSILDrawingTools.html.

However, as Tom already suggests, by far the simplest way to achieve this is to use multiple copies of the 'High/Low For Time Period' study.
[2021-03-30 20:58:48]
RoadKill - Posts: 37 | Ending Date: 2021-01-01 [Expired]
@User907968

by far the simplest way to achieve this is to use multiple copies of the 'High/Low For Time Period' study.

I know, and that is exactly what I want, but that is the thing. To quickly change or add a session I need to go find the correct study, and edit each in a different place, and having to deal with a bunch of settings I will never use and which are poorly explained. (They are all named the same and study selection/settings window which is not resizable! This is a very annoying bug all over SC, when you can't resize frequently used windows, that are containing rows with long column info.)

The code for that need to be rewritten to allow for adding multiple studies within. I already tried, but it got complicated quickly as the code within was not reusable, since it was not written in functional/objectified form.

In addition I would like to put some text above each box describing what session it is, and that name should be easily added to the main Study settings.
Date Time Of Last Edit: 2021-03-30 21:02:04
[2021-03-30 21:10:28]
bradh - Posts: 550 | Ending Date: 2021-06-13
They are all named the same and study selection/settings window which is not resizable!
If you give the study a Short Name, then it will be visible and standout in the Studies to Graph window.
[2021-03-31 10:50:47]
RoadKill - Posts: 37 | Ending Date: 2021-01-01 [Expired]
If you give the study a Short Name
Good point. Thank you.

I'll have to rename the most obnoxiously named studies to things like S1, S2, ... etc. Keep an internal record as what they do. Unfortunately that is only possible to the studies to which you have (or able to find) the source code. Maybe SC dev should look into this issue instead.
Date Time Of Last Edit: 2021-03-31 10:53:13
[2021-03-31 11:08:16]
User907968 - Posts: 493 | Ending Date: 2021-06-09
Unfortunately that is only possible to the studies to which you have (or able to find) the source code.

??? https://www.sierrachart.com/index.php?page=doc/ChartStudies.html#ShortName
[2021-04-18 19:15:26]
RoadKill - Posts: 37 | Ending Date: 2021-01-01 [Expired]
Aah, got you. Didn't realize that "Short Name" was a setting by itself.

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

Login

Login Page - Create Account