Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 13:10:48 +0000



[Programming Help] - Overlay only the open of a 30 minute price bar onto another non time based chart

View Count: 963

[2019-10-05 15:38:51]
User626032 - Posts: 36
Hey,

Trying to place a right triangle for candlestick indicator symbol for the open price only of a 30 minute chart onto another non-time based chart.

I have tried the following studies:

Color background based on alert
Color bar based on alert
Study overlay OHLC

The Study overlay OHLC gave me some success but would not always give me just the open price for the 30 min. bar but rather a range for some openings and other times would not let me ignore everything but SG1.

I guess one of these Color studies would work if I could figure out how to write an alert for the open price (SG1) of the 30 minute chart I overlayed the 30 min. chart onto the non time based chart. I'm sure it"s simple but digging through the alert page did not reveal anything to me.

I tried something simple like: C= ID:8.SG1, ID:8.SG1=TRUE or ID:8.SG1 = 1.0 but can't crack it.

Any thoughts
[2019-10-06 04:49:41]
Sawtooth - Posts: 3976
Try this:
On the 30 min chart:
- Add the Spreadsheet Formula study.
- Set the Draw Zero Values to No.
- Use this formula in the Formula field (not the Alerts tab):
=IF(MROUND(BARTIME,1/86400)=TIMEVALUE("09:30:00"),O,0)
- Set the Draw Style to Triangle Right.
On the non-time-based chart:
- Add the Study/Price Overlay study.
- Set the Study to Overlay to the 30min chart and the Spreadsheet Formula study.
- Set the Data Copy Mode to Use Earliest Value...
- Set the Bar Time Matching Method to Containing Match.
[2019-10-06 12:46:54]
User626032 - Posts: 36
Thanks for the help.

That worked perfect, but only for the 9:30 open bar period.

How can I add on the other TIMEVALUES in your formula?

I tried adding onto your formula like this:

=IF(MROUND(BARTIME,1/86400)=TIMEVALUE("09:30:00"),
MROUND(BARTIME,1/86400)=TIMEVALUE("08:30:00"),
MROUND(BARTIME,1/86400)=TIMEVALUE("09:00:00"),
MROUND(BARTIME,1/86400)=TIMEVALUE("07:30:00"),
MROUND(BARTIME,1/86400)=TIMEVALUE("07:00:00"),O,0)

But it was rejected saying the formula has no value

Is there anyway to add the other 30 min. opens in one formula?


I guess I could duplicate this for each bar but that would add too many studies.


I want to learn spreadsheet studies and the language but can't find a good resource for starting out.
The documentation is written for software engineers not coding bunnies like me. Is there a Spreadsheets for Dummies out there anywhere?


Thanks once more, I appreciate your reply. Anymore help would be great!
[2019-10-18 23:37:05]
Sawtooth - Posts: 3976
Use this formula in the Spreadsheet Formula study on the 30 min chart:
=IF(OR(MROUND(BARTIME,1/86400)=TIMEVALUE("09:30:00"),MROUND(BARTIME,1/86400)=TIMEVALUE("08:30:00"),MROUND(BARTIME,1/86400)=TIMEVALUE("09:00:00"),MROUND(BARTIME,1/86400)=TIMEVALUE("07:30:00"),MROUND(BARTIME,1/86400)=TIMEVALUE("07:00:00")),O,0)

Is there a Spreadsheets for Dummies out there anywhere?
There's this:
https://www.sawtoothtrade.com/tip-1.html
https://www.sawtoothtrade.com/tip-2.html

But SC's documentation is the authoritive resource. It may seem daunting but it is comprehensive.
Start here:
Overview of Spreadsheet Studies

You can also go to YouTube and search for "sierra chart spreadsheet"
There are some videos from various sources.

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

Login

Login Page - Create Account