Login Page - Create Account

Support Board


Date/Time: Thu, 09 Jan 2025 08:50:41 +0000



[Programming Help] - Color Background Based on Slope of Stoch

View Count: 2287

[2016-07-25 20:06:09]
User28914 - Posts: 87
Is this possible?

If so, can it be possible to color a background if 2 or more Stochs are in sloping at the same time?
[2016-07-26 21:55:57]
Sierra Chart Engineering - Posts: 104368
Yes this is possible. The formula for this will be somewhat involved.

For an example of slope calculations, look at example #8 here:

http://www.sierrachart.com/index.php?page=doc/StudyChartAlertsAndScanning.php#FormulaExamples

Here is the complete documentation for Alert Formulas:

http://www.sierrachart.com/index.php?page=doc/StudyChartAlertsAndScanning.php
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-07-26 21:56:32
[2016-08-03 15:07:43]
User28914 - Posts: 87
I tried example 8 but it did not work.

I want to Color the Background of the Region 2 based on whether the Slow %K slope is up and the Slow %K slope is down.

Auto-Coloring change the line Based on Slope, I want to Color the Background.
[2016-08-03 15:43:24]
User28914 - Posts: 87
Also, any chance a Stoch can be drawn as a horizontal bar that changes color based on slope?
See attached.
imagestoch.png / V - Attached On 2016-08-03 15:43:12 UTC - Size: 22.31 KB - 446 views
[2016-08-04 02:05:40]
Sawtooth - Posts: 4147
Try this:

Add three instances of the Color Background Based On Alert Condition study, one each for up, down and equal.
Set the Chart Region to all the same region as the Stoch study, then hide the Stoch study.

For the upsloping %K, use this formula on Alerts tab of the Color Background study:
=ID1.SG1>ID1.SG1[-1]

For the downsloping %K, use this formula on Alerts tab of the Color Background study:
=ID1.SG1>ID1.SG1[-1]

For the flat %K, use this formula on Alerts tab of the Color Background study:
=ID1.SG1=ID1.SG1[-1]

where ID1 is the Stoch study, edit as needed.

Size the chart region small so that it looks like a horizontal bar.

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

Login

Login Page - Create Account