Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 15:08:59 +0000



[Programming Help] - is it possible to know the color of slope of an EMA

View Count: 1173

[2019-08-12 20:41:43]
User183724 - Posts: 183
i have an ema with slope. the colors are red for down slope and green for up slope. can an alert be programmed to determine what the color is? for example...if slope green then do something...if not, must be red...do something else
Date Time Of Last Edit: 2019-08-12 20:47:44
[2019-08-12 21:42:15]
John - SC Support - Posts: 31342
No, it is not possible to base an alert on the color. You have to create the alert using the same underlying information that determines the color.

In your example, you could determine an upslope using the following alert condition:
=ID1.SG1 > ID1.SG1[-1]

This tests to see if the particular subgraph value at the most recent bar is greater than the vale at the prior bar. You would need to update the ID1 and SG1 to your specific study and subgraph.

Refer to the following for how to reference data in alerts for other than the current bar:
Study/Chart Alerts And Scanning: Referencing Data Other Than on the Last Bar/Column In the Chart
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-08-12 22:06:31]
Sawtooth - Posts: 3992
Look at #8 or #9 here:
Study/Chart Alerts And Scanning: Alert Formula Examples

If you are using a spreadsheet study, look at this:
Spreadsheet Example Formulas and Usage: Formula that Matches the Slope Coloring of a Study Subgraph Line
Date Time Of Last Edit: 2019-08-12 23:11:33
[2019-08-12 22:57:38]
User183724 - Posts: 183
John...thx. just seems to be more trouble than it should be since the software already calculates it.

tomgilb...thx...I'm not up to spreadsheets yet. pretty good with simple alerts...I'd like to learn spreadsheets but the docs are pretty sketchy for a noob...I've looked at the ACSIL...I'm ok with C++ but since, again, the docs are kind of sketchy, its a struggle. anyway, thanx again.

by the way, the way Im doing this now is exactly like john said except...

ID1.SG1 is my EMA
ID2.SG1 is an intermediate 'Color Bar based on Alert Condition with the alert settings at ID1.SG1>ID1.SG1[-1]
finally
ID3.SG1 is another 'Color Bar based on Alert Condition with the alert settings ID2.SG1 = 1


Im doing this to reduce the number of characters I have to type in the actual alert I'm trying to program...seems harder than it should be

thanx again
[2019-08-12 23:14:38]
Sawtooth - Posts: 3992
What you are doing will work most of the time, except when there are any flat segments.

The #9 Simple Alert example will work almost all of the time, except if there are 2 or more consecutive flat segments.
The spreadsheet example works all of the time because it is creating a persistent variable.
[2019-08-13 00:12:26]
User183724 - Posts: 183
tomgilb...thx again... I got other traps for flat areas. I was just hoping to make the whole thing simpler...

when I figure out spreadsheets, I'll keep your advise in mind. thx again

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

Login

Login Page - Create Account