Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 13:04:12 +0000



[Programming Help] - How to create alert background condition with one subgraphs or none

View Count: 1283

[2018-01-30 21:29:03]
User33743 - Posts: 83
Hi,
I was trying to put simply color baground condition with studies:

Color Bar Open close
or
CandlestickPatterns Finder

AND

Numbers bars calculated values ( SG14 total volume bar difference >0)
(ID1.SG14>0)

I want e.g from study CPF Hammer (which i setup as pattern 2) but in subgrahps of this study i cannot setup SG2, always go to "Ignore" and it uses settings from SG1. Is this some bug or i should setup something additionally. ?

When I go into Color bar there is only one Subgraphs but i want to based color background because candle is green(up candle) and (ID1.SG14>0) but since there is only one SG i don't know how to go into option green (which is for up bar).

Could you help?
[2018-02-02 15:23:14]
User33743 - Posts: 83
Any ideas?
[2018-02-02 19:18:32]
Sawtooth - Posts: 3976
Color bar studies only have one subgraph and its output is based on the formula on the Alerts tab.

While the CPF study does not allow changes to subgraph Draw Styles, the subgraphs do output a value >0 when TRUE.
Use a formula like this in the Color bar study's Alerts tab:
=ID2.SG2>0
where the CPF study is ID2.

The NBCV study's SG14 outputs positive and negative values. If you want to combine positive values with up bars, use a formula like this in the Color bar study's Alerts tab:
AND(ID1.SG14>0,C>O)
where the NBCV study is ID1.
[2018-02-06 13:13:00]
User33743 - Posts: 83
Hi!
thank you for help!

What i actually need is to recognize if bar is upbar or downbar , thats why i use color bar open close study. Maybe there is some other study which could also give me info if a bar is up or down?

Best Regards
[2018-02-06 15:40:43]
Sawtooth - Posts: 3976
In most cases, C>O will find an up-bar, and C<O will find a down-bar.

To always match the coloring of up and down bars, you'll need to use a spreadsheet study to create a persistent variable with this formula:
=IF(OR(E3>B3,AND(B3>E4,B3=E3)),1,IF(OR(E3<B3,AND(B3<E4,B3=E3)),-1,T4))
This example formula would be entered in cell T3, a Formula Column.
It returns a 1 if price bar is up-colored or a -1 if price bar is down-colored.

You could then reference column T in your formula, now on the spreadsheet using the spreadsheet syntax, e.g. in cell U3:
AND(ID1.SG14@3>0,T3=1)
[2018-02-06 22:29:37]
User33743 - Posts: 83
Hi,
TY for your time and helping me! Really appreciated!

Am i right, or in previous version
"=IF(OR(E3>B3,AND(B3>E4,B3=E3)),1,IF(OR(E3<B3,AND(B3<E4,B3=E3)),-1,T4))" "1" doesn't reffer to any cell?
Should't this be:
=IF(OR((E3>B3,AND(B3>E4,B3=E3)),1,T3),IF(OR(E3<B3,AND(B3<E4,B3=E3)),-1,T4))
?

I'm not sure how can i do this, where exactly can I put it? In color baground study?
"You could then reference column T in your formula, now on the spreadsheet using the spreadsheet syntax, e.g. in cell U3:
AND(ID1.SG14@3>0,T3=1)"

I'm trying to get this ;)

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

Login

Login Page - Create Account