Login Page - Create Account

Support Board


Date/Time: Sat, 05 Oct 2024 09:15:24 +0000



[Programming Help] - Settlement price

View Count: 1599

[2021-10-07 20:22:00]
User499894 - Posts: 45
Hi, I would like to display in a chart yesterday settlement price and the VWAP value at the close of the session in the same way I can do with O,H,L,C etc. by using the Daily OHLC. study. Is it possible?
Thanks
[2021-10-08 01:08:35]
John - SC Support - Posts: 34944
There are not built-in offsets in the studies to do what you are asking for. Therefore, you would need to get the data into the chart first (for instance, the Settlement price is the Close of the Daily bar, therefore you would use the Study/Price overlay to get the Daily data into the chart you want to display the information for).

Then, you could use the Spreadsheet study to find the previous day and display the value, and then find the first non-zero value.

For example, if you used the Study/Price Overlay to get the daily data into an Intraday Chart and the ID of the study is 1, then you would add a Spreadsheet Study and enter the following in the referenced cells (this assumes that the Session Times are set to Central for the CME, so the day session ends at 15:30):
K3: =IF(HOUR(A3 < 15), ID1.SG4@3, 0)
L3: =MOSTRECENTNONZEROVALUE(K3:K50)
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-10-08 07:53:04]
User499894 - Posts: 45
Ok, it could be done as you say, but the official settle price (see: https://www.cmegroup.com/markets/equities/sp/e-mini-sandp500.settlements.html - SC quoteboard shows the same figure) does not seem to be the exact close of daily bar...
And how can I use your suggested way to show the VWAP value of yesterday at close time?
Date Time Of Last Edit: 2021-10-08 07:53:37
[2021-10-08 12:50:42]
Sawtooth - Posts: 4093
the official settle price does not seem to be the exact close of daily bar...
The Settlement price is the close of the Historical Daily bar, not the close of an Intraday 1-0-0 daily bar.

To get the Settlement price from an Historical Daily bar to an Intraday chart, use the Study/Price Overlay study on the Intraday chart, referencing Daily OHLC study on the Historical Daily chart.

how can I show the VWAP value of yesterday at close time?
To get yesterday's VWAP value at the close from an Historical Daily chart to an Intraday chart:
- Add another instance of the VWAP study to the Historical Daily chart
--- Hide the study
--- On the Subgraphs tab, set the Displacement to 1 for every SG# you want to overlay on the Intraday chart.
- Add the Study/Price Overlay study on the Intraday chart:
--- Reference the hidden VWAP study on the Historical Daily chart.
--- Set the 'Bar Time Matching Method' to 'Containing Match'

To extend the VWAP value at the close time on an Intraday chart into the following day, here's one way:
https://www.sawtoothtrade.com/free-stuff-10.html

It could also be done with the Spreadsheet Formula study, extending only the VWAP, using a formula like this in its Formula field:
=IF(AND(MROUND(BARTIME[-1],1/86400000)<TIMEVALUE("16:14:00"),MROUND(BARTIME,1/86400000)>=TIMEVALUE("16:15:00")),ID2.SG1[-1],ID1.SG1[-1])
where the close time is 16:15, the VWAP study is ID2, and the Spreadsheet Formula study is ID1.
This example is intended for a time-based chart where there is a bar timestamped at 16:15:00.
[2021-10-08 21:45:37]
User499894 - Posts: 45
Great, it works. Thanks, I really appreciate your support!

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

Login

Login Page - Create Account