Support Board
Date/Time: Fri, 31 Jan 2025 10:46:38 +0000
[Programming Help] - Special colored volume bars
View Count: 3277
[2015-11-12 20:49:32] |
brown555 - Posts: 35 |
Do you have an indicator capable of doing the following: If the current volume bar is greater than the past X volume bars, the indicator will highlight the volume bar with color Y; e.g. "If current volume bar greater than the past 100 bars, color the volume bar purple"? I looked in the technical studies reference page and 'Add custom study' tab in Chart Studies and couldn't find what I was looking for, but maybe I overlooked it - Thanks |
[2015-11-12 22:24:09] |
Sawtooth - Posts: 4164 |
This could be done with a formula or two in the Spreadsheet System/Alert study.
|
[2015-11-13 03:31:45] |
Sierra Chart Engineering - Posts: 104368 |
This can be accomplished with the Color Bar Based on Alert Condition study: http://www.sierrachart.com/index.php?page=doc/doc_TechnicalStudiesReference.html#s245 You will need to use a separate Color Bar Based on Alert Condition study for each color that you want. Or has been suggested you can use the Spreadsheet System/Alert study Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2017-10-16 06:11:28] |
brown555 - Posts: 35 |
Thank you for pointing me in the right direction. However, upon reading the related material I was unable to find amongst the documentation an example of, or instructions for, creating an alert condition which involves coloring a bar based on what the values of the previous x number of bars are, e.g. "= V > previous x bars" where x is the # of bars to use in the calculation (I presume this would be the Input Value 'Number of Bars to Calculate') and where bars is volume bars. So since the number of bars to use to calculate this would be one of the inputs, what would the format of the Alert Condition formula be? ___________________________________________________________________________________________________________________________________________________________________________________________________________ If it helps, I'm trying to re-create an indicator I found on TradingView, coded by user 'marketsurvivalist' like so: // // @author MarketSurvivalist // This indicator is based on the ideas written about by Vincent Kott in his book Volume Spike Analysis // (http://www.amazon.com/Volume-Spike-Analysis-Includes-indicators-ebook/dp/B00F87ZMK8) // study("Volume Spike Analysis [marketsurvivalist]", shorttitle="VSA_MS") shortLookback=input(4) mediumLookback=input(20) longLookback=input(100) showMA=input(true) lengthMA=input(60) v2 = volume highestShort = highest(volume, shortLookback) highestMedium = highest(volume, mediumLookback) highestLong = highest(volume, longLookback) c = iff(highestLong == v2, blue, iff(highestMedium == v2, purple, iff(highestShort == v2, red, white))) plot(v2, style=columns, color=c) plot(showMA?sma(v2, lengthMA):na, color=aqua) |
[2017-10-18 03:50:54] |
Sierra Chart Engineering - Posts: 104368 |
the values of the previous x number of bars are, e.g. "= V > previous x bars"
You will want to use a formula like this: = V > MAX (V[-1], V[-2], V[-3], V[-4], V[-5]) Reference: Study/Chart Alerts And Scanning: Referencing Data Other Than on the Last Bar/Column In the Chart Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2019-05-01 03:47:10] |
brown555 - Posts: 35 |
What about if I wanted to color the volume bar GREEN if CLOSE>MIDPOINT of the current candlestick, BLACK if CLOSE=MIDPOINT of the current candlestick, and RED if CLOSE<MIDPOINT of the current candlestick? Is that do-able? (e.g. if range of the price bar is 10 ticks, and the bar closed 4 ticks from the top, it would be an 'UP' volume bar (GREEN), or if it closed 4 ticks from the bottom, it would be a DOWN volume bar (RED))
|
[2019-05-01 15:20:46] |
John - SC Support - Posts: 37621 |
In regards to post #6 - Yes, you can accomplish what you are asking for with 3 copies of the Color Bar Based on Alert Condition study. One for each of your conditions and color. The documentation for this study can be found here: Color Bar Based on Alert Condition You will need to work out the exact Alert formulas for what you are asking about. Refer to this section about alerts: Study/Chart Alerts And Scanning 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: