Login Page - Create Account

Support Board


Date/Time: Wed, 07 May 2025 00:45:49 +0000



[Programming Help] - Colour Bar based on Alert Condition for a non-time based chart!

View Count: 315

[2024-11-23 22:25:01]
J DIDDY - Posts: 142
Hi Support,

I currently use a Heikin Ashe '5 Second' chart with Cum Delta Bars study and Bid/Ask ratio study and use the 'Colour Bar based on Alert Cond' study alert formula... =AND(V>400, ID9.SG4 > ID9.SG1) for a bar that is above 400 in volume, and the close being higher than the open (on the cum delta bars SG's) for a positive colour bar alert on the Bid Ask Ratio Study. (Screenshot attached for your reference)

I want to switch the chart to a Heikin Ashe 'Delta Volume Bars' with a setting of 25....and have the same Colour bar based alert.
But because each bar is 25 volume and too granular on the Cum Delta bars, I cant use the same formula and need one, which I think, should be... amount of volume increase based on time.

My theory is that if it takes an average of 10 secs for 400 lots of 'average-pace' positive delta volume to arrive, then if the formula is set 'less than 2 seconds' for e.g, then it will show the heavy volume spurt giving an alert.

Therefore, I think the alert formula needs the following:

A. An increase of 400 delta volume from its current amount

B. Something to show a Positive or Negative result.

C. Time(Speed) = Less than (x) seconds/milliseconds


Can you help with a formula for that please??


Many thanks
Date Time Of Last Edit: 2024-11-25 11:32:30
imageCOLOUR BAR BASED ON ALERT CONDITION Screenshot.jpg / V - Attached On 2024-11-23 22:01:48 UTC - Size: 397.48 KB - 58 views
[2024-11-24 15:33:51]
Sawtooth - Posts: 4212
Or if you know a better way around this...
Keeps both charts and use the Study/Price Overlay study on the Delta Volume per Bar chart to overlay the alerts from the 5 second chart.
[2024-11-24 17:31:42]
J DIDDY - Posts: 142
Hi Sawtooth

Thanks for your reply, but the only problem with that is that I have a very full and complex chart book with already many Study/Price Overlay's and I need to keep my charts as minimal as possible to save on processing etc...So I'd prefer not to go that route if I can do it with 1 chart and 1 alert!

Thanks tho!
Date Time Of Last Edit: 2024-11-25 10:39:46
[2024-11-25 16:59:39]
John - SC Support - Posts: 39675
We are not exactly sure what you are wanting to do, but if you want to get an alert when a particular bar meets your criteria within a certain time frame, then you can check the time by using the "BARDATETIME" and the "BARENDDATETIME" functions to check the amount of time that has passed for a bar. For instance, to see if volume is greater than 400 within 5 seconds in a bar, your Alert Condition would be the following:
=(BARENDDATETIME - BARDATETIME) * 24 * 60 * 60 < 5

The multiplication of 24 * 60 * 60 is because the hours within a day are stored as a fraction, so multiplying by 24 hours in a day, 60 minutes in an hour, and 60 seconds in a minute to get the value in seconds.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-25 20:50:32]
J DIDDY - Posts: 142
Hi John

Thanks, almost there...., But your current formula will just alert me when 'ANY' 400 volume arrives. I want to know...when an increase of EITHER 400 bid 'or' 400 ask volume arrives.

B. Something to show a Positive or Negative volume result.

On the 5 min chart I am using the 'cum delta volume bars' open/close SG's (ID9.SG4 > ID9.SG1) to note whether the volume was positive (up bar) or negative (Down Bar), which I cannot do on the 25 delta volume bars chart - because each bar is 25 in volume, so they wont get up to 400 volume.

The chart I want to move to is a Heikin Ashe 'Delta volume per bar' (25) chart with 'Cum Delta volume Bars' study and 'Bid/Ask ratio' study! (Please see pic attached with original post).

So how can I do this part of the alert equation?

Also can I use milliseconds in the time part of the formula??
(I trade NQ mainly and the 400 volume may arrive quicker than 1 second)

Thanks
Date Time Of Last Edit: 2024-11-25 21:00:05
[2024-11-25 21:56:35]
John - SC Support - Posts: 39675
What do you mean by an increase of either 400 Bid or 400 Ask. What are you using as a basis. Or if this is a rolling value, what are the conditions over which you want to look?

You need to quantify what you want to do in order to turn it into some kind of computer language. You may be able to visualize what you want easily enough, but we need the little bits which makes this the hard stuff.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-26 02:28:12]
J DIDDY - Posts: 142
OK

1. Yes it will be a rolling value....so it could be, POSITIVE from 0-400, or -200 to +200, or +100 to +300.... OR .... NEGATIVE +400 to 0, or -100 to -500...and so on

The V>400 in the formula on the 5 min chart I have been using should be fine... the next part of the formula is the bit to show the direction...


2. Let's try this....

Using a Delta Volume Bars chart (25 setting) I need to reference the 'Cumulative Delta volume Bars study (IDxx)' in the formula to get the 'direction' of the volume ....so I need 16 consecutive 'UP' bars to get me to 400 positive delta volume. (16 x 25 Cumulative Delta volume Bars = 400)


So what would the formula be for:

1) Volume = Over 400
V>400

2) Direction: (Referencing 'Cumulative Delta volume Bars (IDxx)') ...Maybe this is something like:
More than (x) consecutive 'Cum Delta vol Bars (IDxx)' where the next bars close must be equal or higher than the previous bars close (To show positive volume)
More than (x) consecutive 'Cum Delta vol Bars (IDxx)' where the next bars close must be equal or lower than the previous bars close (To show negative volume)

3) Time: (Referencing the 'Cumulative Delta volume Bars (IDxx)' part of the formula above)
More than (x) consecutive 'Cum Delta vol Bars (IDxx)' delivered in under (x) seconds/milliseconds

But can I use milliseconds instead of seconds?

I hope that makes sense!

Thanks in advance!
Date Time Of Last Edit: 2024-11-26 02:28:54
imageCOLOUR BAR BASED ON ALERT CONDITION Screenshot.jpg / V - Attached On 2024-11-26 00:32:35 UTC - Size: 425.2 KB - 39 views
[2024-11-26 15:03:39]
John - SC Support - Posts: 39675
Since you are using Delta Volume bars with a volume of 25, this actually simplifies things, as you can do what you are suggesting. You would need to look at the last 16 bars to see if they are all in the same direction. You do have to do this individually for each pair of bars, so that part of the formula would look like the following for the Up bar situation:
=AND(C > C[-1], C[-1] > C[-2], C[-2] > C[-3])

You would need to extend this out to the 16 bars.

Then to test the time, use the same idea we gave above, but you would need to test the current bar against the bar 16 back. So this would look like the following to check against 400 milliseconds:
=(BARENDDATETIME - BARDATETIME[-16]) * 24 * 60 * 60 * 1000 < 400

So then you need to combine these which would be the following:
=AND(C > C[-1], C[-1] > C[-2], C[-2] > C[-3], (BARENDDATETIME - BARDATETIME[-16]) * 24 * 60 * 60 * 1000 < 400)
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-26 20:10:30]
J DIDDY - Posts: 142
Awesome thanks John! I'll check this out!!!
[2024-11-26 22:36:17]
J DIDDY - Posts: 142
Sorry John,

We missed something that I mentioned originally!


I want the bars that are gonna be determined, to be the Cumulative Delta Volume Bars study on the chart and NOT the Delta Volume Bars...BECAUSE I am using Heikin Ashe and NOT candlestick bars. And Heikin Ashe wont work because of the way they are formulated.

So can we change that part of the formula to be for Cum Delta volume bars please??? ID:9, Open=SG1, High=SG2, Low=SG3, Close=SG4

And the speed part of the formula will be for the Cum Delta Vol bars too!

NOTE: From the screenshot attached you can see that the volume comes in much better and earlier on the Cum Delta Volume bars in the Blue circle, than the messy Heikin Ashe Bars in the pink circle which are very choppy at the same area!

Thanks!
Date Time Of Last Edit: 2024-11-26 22:36:49
image1.jpg / V - Attached On 2024-11-26 22:33:21 UTC - Size: 103.53 KB - 42 views
[2024-11-27 14:25:47]
John - SC Support - Posts: 39675
You would just need to change the C (close of the Main Price Graph) to the ID and Subgraph you want to use. So the formula for checking that the bars are all moving in the same direction becomes the following:
=AND(ID9.SG4 > ID9.SG4[-1], ID9.SG4[-1] > ID9.SG4[-2], ID9.SG4[-2] > ID9.SG4[-3])

Refer to the following and the section below it:
Study/Chart Alerts And Scanning: Referencing Study Subgraphs
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-27 21:36:10]
J DIDDY - Posts: 142
Thanks alot. I'll try this!

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

Login

Login Page - Create Account