Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 05:55:37 +0000



[User Discussion] - Color Bar based on closing price above/below sub graph

View Count: 899

[2020-08-22 11:23:56]
User238343 - Posts: 20
how do i write color bar condition for bar close above/below : ID1.SG2 & ID1.SG3 (HORIZONTAL PARALLEL LINES)

price closes above SG2 -color green. it will stay so until bar closes below SG3. (after closing above SG2, if any bar closes between SG2 and SG3, still color green) color changes to red only when first bar that closes below SG3. it stays red until next bar that closes above SG2.
[2020-08-22 13:02:57]
Sawtooth - Posts: 3976
Instead of the color bar study, use the Spreadsheet Formula study, with a formula like this in the Formula field:
=IF(CROSSFROMBELOW(C,ID1.SG2),1,IF(CROSSFROMABOVE(C,ID1.SG3),-1,ID2.SG1[-1]))
-where the Spreadsheet Formula study is ID2.

Set the Chart Region to 1, then on the Subgraphs tab, set the Draw Style to Color Bar, and Auto-Coloring to Based On +/-

This creates a value at each crossover that is persistent until the opposite crossover. This is not possible with the color bar study.
[2020-09-04 03:01:40]
User238343 - Posts: 20
need a adjustment to this bar coloring.

above spreadsheet formula color bar green or red depending on where the price is.(above/below horizontal lines) how can i bring in a two more colors in to it.( muted green and muted red)
- if price below VWAP green will be muted green. above VWAP red bar will be muted red.
[2020-09-04 14:00:19]
Sawtooth - Posts: 3976
- if price below VWAP green will be muted green. above VWAP red bar will be muted red.
Add two more instances of the Spreadsheet Formula study, one for the muted green and one for the muted red.
These two instances need to be below the original Spreadsheet Formula study in the Studies to Graph list.
On both instances:
-Set the Chart Region to 1
-Set 'Draw Zero Values' to No
-Set the Draw Style to Color Bar

Muted green formula in the Formula field:
=IF(AND(CROSSFROMABOVE(C,ID3.SG1),ID2.SG1=1),1,IF(ID2.SG1=-1,0,ID4.SG1[-1]))
-where this Spreadsheet Formula study is ID4

Muted red formula in the Formula field:
=IF(AND(CROSSFROMBELOW(C,ID3.SG1),ID2.SG1=-1),1,IF(ID2.SG1=1,0,ID5.SG1[-1]))
-where this Spreadsheet Formula study is ID5

-where, in both formulas, the VWAP study is ID3, and the original Spreadsheet Formula study from post#2 is ID2.
Date Time Of Last Edit: 2020-09-04 19:54:50

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

Login

Login Page - Create Account