Login Page - Create Account

Support Board


Date/Time: Tue, 09 Sep 2025 03:05:45 +0000



Indicators not scaled correctly in Chart Region?

View Count: 180

[2025-08-05 14:06:17]
neevaksama - Posts: 61
Hello SC,

Preface
- ID20.SG1 = 20 Volume SMA
- Formula below means alert if "Volume is more than 20SMA and Average of previous 3 candles OR Volume more than previous candle which fulfills the condition I just said)"
- Formula: =OR(
AND(V > ID20.SG1, V >= 1.5 * AVERAGE(V[-1], V[-2], V[-3])),
AND(V > V[-1], V[-1] > ID20.SG1[-1], V[-1] >= 1.5 * AVERAGE(V[-2], V[-3], V[-4]))
)

- Logged output = OR(
AND(13748 > 12664.1, 13748 >= 1.5 * AVERAGE(12022, 6798, 7862)),
AND(13748 > 12022, 12022 > 12307.95, 12022 >= 1.5 * AVERAGE(6798, 7862, 6482))
)

Issue
- Alert works
- However, it is supposed to work when Volume > 20SMA. Numbers-wise, it's correct
- Visually, volume looks lower than 20SMA which is confusing

Chart Region Settings
- Interactive Scale Range
- Scale Range: Automatic

Indicator's Scale Settings
- Default (I.e Scale Range: Automatic Zero-Based, Scale Type: Linear)


Any explanation why this happens?
imagesc-visual.png / V - Attached On 2025-08-05 14:01:10 UTC - Size: 21.47 KB - 49 views
[2025-08-05 15:50:52]
John - SC Support - Posts: 41676
We need to see the entire chart, particularly so we can see the right side scale for that region. If you supply an image, please follow these instructions:
Support Board Posting Information: Attaching or Posting a Screenshot/Image (Optional)

You mention that the one study scale is set to "Automatic Zero-Based", we assume this is the Volume. What is the Moving Average scale type set to?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-08-05 17:13:10]
neevaksama - Posts: 61
The MA is set to Automatic.

I have uploaded the entire Chart itself: https://www.sierrachart.com/image.php?Image=175441392315.png
[2025-08-05 21:20:44]
John - SC Support - Posts: 41676
This formula:
=OR(
AND(V > ID20.SG1, V >= 1.5 * AVERAGE(V[-1], V[-2], V[-3])),
AND(V > V[-1], V[-1] > ID20.SG1[-1], V[-1] >= 1.5 * AVERAGE(V[-2], V[-3], V[-4]))
)

Does not mean ""Volume is more than 20SMA and Average of previous 3 candles OR Volume more than previous candle which fulfills the condition I just said)".

You have two ANDs, which are nested into an OR, which does separate out the two conditions, so either AND() condition could be true. But the second AND() condition checks that the volume of the current bar is greater than the volume of the previous bar AND the volume of the previous bar is greater than ID20.SG1, AND the volume of the previous bar is greater than or equal to 1.5 times the average of the volumes from the bars 2, 3 and 4 back from the current bar.

Make sure your conditions are actually being met, as there is no condition in what you have that checks just that the SMA is greater than the volume of a bar.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-08-06 03:13:47]
neevaksama - Posts: 61
1st AND = Volume is more than 20SMA and Average of previous 3 candles
AND(V > ID20.SG1, V >= 1.5 * AVERAGE(V[-1], V[-2], V[-3]))

2nd AND = Volume is more than prior Candle. Prior candle's volume is more than 20SMA at the prior candle and Average of previous 3 candles before that prior candle
AND(V > V[-1], V[-1] > ID20.SG1[-1], V[-1] >= 1.5 * AVERAGE(V[-2], V[-3], V[-4])

Enclosing OR = So in either case, if I do see a colored bar in the volume histogram, either that bar or the previous bar must be above the 20SMA right?

_________________

If you look at the chart uploaded where I have arrowed out some colored bars, none of them fulfills this
Enclosing OR = So in either case, if I do see a colored bar in the volume histogram, either that bar or the previous bar must be above the 20SMA right?


I meant volume of bar has to be above SMA not SMA above volume of bar, hence why I am confused when I mentioned "Visually, volume looks lower than 20SMA ..." :
there is no condition in what you have that checks just that the SMA is greater than the volume of a bar.

Date Time Of Last Edit: 2025-08-06 03:32:29
[2025-08-06 13:46:41]
John - SC Support - Posts: 41676
We understand what you are referring to now, sorry it took us a bit.

Please get us that chart so we can take a look, as there must be some reason for what is occurring. Follow these instructions to get us the chart:
Support Board Posting Information: Providing Chartbook with Only a Single Chart
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-08-06 16:47:13]
neevaksama - Posts: 61
No worries, here is the chartbook.
attachmentSCDebug.Cht - Attached On 2025-08-06 16:47:00 UTC - Size: 16.88 KB - 53 views
[2025-08-06 17:37:44]
John - SC Support - Posts: 41676
The problem was with the order of the calculations. Keep in mind that, in general, the order of the items in the Studies to Graph is the order in which the studies are calculated, going from top to bottom. Therefore, you need to have the studies in this order:
- Volume
- 20SMA
- Volume Spike 1.5
- Volume Spike 1.8
- Volume Spike 2.0

As each of these depends on the ones before it, and the Color Bars need to color correctly, which also follows the same order, so they need to be in the order they are (which is how you had them).
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-08-06 18:25:20]
neevaksama - Posts: 61
Thank you, this worked!

However, I still don't understand the logic behind it

So...
- We have a order precedence as you mentioned
- But how does Color Bars use that order precedence when it has been properly accounted for (or so I thought) with our Formulas, brackets, etc in the "Alerts" tab

Also, sorry for the trouble, is there documentation to this, I can't seem to find with the keywords "Calculation order" in SC's search bar
[2025-08-06 18:59:57]
John - SC Support - Posts: 41676
The real issue was the 20SMA with regards to the Volume. Those two were the ones that were out of order and was causing the issue.

Although the "Color Bar Based on Alert Condition" would normally have the same issue, the precedence for that specific study is set to low, so it will run after other studies.

The documentation on this is here:
Chart Studies: Study Calculation Precedence And Related Issues
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account