Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 17:19:24 +0000



Trying to paint the area between two Candles if there is a Gap between Low and High

View Count: 808

[2022-09-10 00:25:52]
raheemrazzak - Posts: 37
I am using Bardifference Study with Settings

InputData1: Low
InputData2: High
InputData 1 Offset :0
InputData 2 Offset: 2

I want to draw a small rectangle between the bars if there is a gap between these two candles. With the rectangle covering the area of the gap

Currently, I'm combining this study with "Color bar based on alert condition" and adding a + sign if there is a Gap, I wanted to know if there is a way to just draw a rectangle in that area instead.
imageCurrentStudy.png / V - Attached On 2022-09-10 00:23:10 UTC - Size: 4.43 KB - 125 views
imageDesiredResult.png / V - Attached On 2022-09-10 00:23:15 UTC - Size: 3.22 KB - 111 views
[2022-09-10 03:13:20]
Sawtooth - Posts: 3992
It can be done using the Box Top Center/Box Bottom Center draw style combination in two adjoining columns/subgraphs of a spreadsheet study:

Post again if you want details.
[2022-09-10 04:37:04]
raheemrazzak - Posts: 37
Yes please, will appreciate further details. Do you want me to make a separate post?
[2022-09-10 16:50:02]
Sawtooth - Posts: 3992
Yes please, will appreciate further details.
Add the Spreadsheet System/Alert study.
- Give it a name in the Spreadsheet Name field.
- Set the Draw Style of SG5 to Box Top Center
- Set the Draw Style of SG6 to Box Bottom Center
- Formulas on the spreadsheet:
Cell O3:
=IF(D3>C5,D3,0)
Cell P3:
=IF(D3>C5,C5,0)

Column D is the Low
Column C is the High
The current bar is in row 3, previous bars in rows below.

You can duplicate this for the down direction using another two adjacent columns.

Columns K-N are for reserved for alerts. Any non-zero is a TRUE.
Alert settings in spreadsheet studies are managed on the Settings and Inputs tab, not on the Alerts tab.

You should be able to combine all of your Region 1 alerts into this spreadsheet study, if you want to.
[2022-09-11 20:39:02]
raheemrazzak - Posts: 37
This is perfect, really appreciate your help.

One last question is there any way to change the width of the box, currently, I'm using "-1" displacement which places it right in between the candles as I perfer, but not sure if I can make it slightly wider. Not a deal breaker, just for aesthetics.

Thanks again for the help.
[2022-09-11 22:07:03]
Sawtooth - Posts: 3992
is there any way to change the width of the box
There isn't any way to make the box wider, but you can try this instead:

Cell O3:
=IF(D3>C5,D3,0) (no change)
Cell P3:
=IF(D3>C5,C5,0) (no change)
Cell Q3:
=IF(O2>0,O2,0)
Cell R3:
=IF(P2>0,P2,0)
Cell S3:
=IF(Q2>0,Q2,0)
Cell T3:
=IF(R2>0,R2,0)

Set Draw Styles (Displacement of 0 for all):
SG5: Left Offset Box Top
SG6: Left Offset Box Bottom
SG7: Dash
SG8: Dash
SG9: Right Offset Box Top
SG10: Right Offset Box Bottom

This isn't exactly what you want, but close.
[2022-09-12 00:15:14]
raheemrazzak - Posts: 37
Thanks @tomgilb that does the job...



Thanks @GC5150 I'll check it out

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

Login

Login Page - Create Account