Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 18:07:09 +0000



[Programming Help] - How can I get the SC Cumulative Delta to color bars and/or alerts based on

View Count: 1168

[2021-03-12 12:50:47]
C_Money - Posts: 70
Hi all,

Not much of a programmer here but I can get by. Can you offer any insight in to getting the CD to alert me to pinbars and <50% candles. Coloring them would be a plus. I don't even think I have access to the code.
[2021-03-12 17:06:34]
Sawtooth - Posts: 4173
pinbars and <50% candles
Please explain further what these are.
[2021-03-12 17:15:46]
C_Money - Posts: 70
A <%50 candle is when the body only of a candle makes up for less than 50% of the total size of the candle. A pinbar is basically a <50% candle except the body of a candle is skewed towards the far top or bottom of the candle. I've attached a screenshot of the pinbar.
imageCapture.PNG / V - Attached On 2021-03-12 17:15:07 UTC - Size: 69.28 KB - 287 views
[2021-03-12 19:04:11]
Sawtooth - Posts: 4173
This is the formula to find when the body is <50% of the range:
ABS(O-C)<(H-L)*0.5

What are the rules for when the body is skewed to one end of the candle?
Bullish pinbar examples:
Lower wick is >n% of the range
and/or
upper wick is <n% of the range
Date Time Of Last Edit: 2021-03-12 19:04:54
[2021-03-12 19:47:44]
C_Money - Posts: 70
When I enter that in to the alert field, the indicator title turns red and shows an exclamation point.

The wicks should be 60% of the total candle size. I think that would produce a good pinbar and keeps it simple.
[2021-03-12 20:22:47]
Sawtooth - Posts: 4173
the indicator title turns red and shows an exclamation point.
That means the alert is TRUE in the current bar.

The wicks should be 60% of the total candle size
edit the formula to this:
ABS(O-C)<(H-L)*0.6

Put this formula on the Alerts tab of the Color Bar Based On Alert Condition study to color every bar where it is true.
[2021-03-12 20:31:32]
C_Money - Posts: 70
Ah, i see. Thanks

Coloring the bars on the main price chart works. But it does not color the Cumulative Delta indicator, which is in a different chart region as the main price graph. How do I color the CD bars based on that condition?
[2021-03-12 20:52:54]
Sawtooth - Posts: 4173
I'm sorry, use this formula instead:
=ABS(ID1.SG1-ID1.SG4)<(ID1.SG2-ID1.SG3)*0.6
-where the CD study is ID1; edit as needed.

Set the color bar study to the same Chart Region as the CD study.
The color bar study must be below the CD study in the Studies to Graph list.

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

Login

Login Page - Create Account