Support Board
Date/Time: Tue, 26 Nov 2024 04:33:23 +0000
Post From: Color Shading on Numbers Bars Background (and text)
[2018-04-05 06:06:57] |
whats1thingnow - Posts: 407 |
thanks for the reply. sorry for the delay, leaving for vacation soon and on vacation mode :) It also sounds like you do NOT want this to be diagonal comparison, is that correct?
Correct, I do NOT want this to be diagonal comparisonAre you looking for something similar to http://www.sierrachart.com/index.php?page=doc/NumbersBars.php#BackgroundColoringBasedOnAskVolBidVolDiagonalDifferencePercentageOfBarRange but not diagonal?
No, it's much more simple than this.This is what market delta does with their default background coloring, with a slight improvement: They use the Ask Vol Bid Vol Difference (AskVolume BidVolume Difference) (the difference between AskVolume and BidVolume for each price within the Numbers Bar) and color background based on the Value Percentage relative to Today's Chart Bars (not All Loaded Chart Bars, nor Visible Bars Only). Example: (very similar coloring logic to Numbers Bars: Calculated Values Background Coloring Logic ) - The Highest value and the Lowest value are determined for the day and an Up Range and Down Range are calculated. - If the Highest value is positive and the Lowest value is negative, then the Up Range is defined from the Highest Value to 0 and the Down Range is defined from the Lowest value to 0 (Up Range = Highest and Down Range = Lowest).
- If both values are positive, then the Up Range is determined to be the difference between the Highest value and the Lowest value (Up Range = Highest - Lowest). - If both values are negative, the the Lower Range is determined to be the difference between the Lowest value and the Highest value (Down Range = Lowest - Highest). - The percentage value of each value in the bar is determined and the appropriate coloring selected. Positive values are assigned into the Up Range # Colors and Negative values are assigned into the Down Range # Colors. - If the Highest value is positive and the Lowest value is negative, then a cell with a Positive value has its percent value calculated as Percentage = Cell Value / Highest Value; and a cell with a Negative value has its percent value calculated as Percentage = Cell Value / Lowest Value.
- If the Highest and Lowest values are both Positive, then each cell's percent value is calculated as Percentage = (Cell Value - Lowest Value) / (Highest Value - Lowest Value). - If the Highest and Lowest values are both Negative, then each cell's percent value is calculated as Percentage = (Cell Value - Highest Value) / (Lowest Value - Highest Value). - Zero values are handled special, depending on the range of values in the row. If the row is all Positive values, then a 0 value is mapped into the Up Range 0 Color. If the row is all Negative values, then a 0 value is mapped into the Down Range 0 Color. If the row values span across zero (both positive and negative values) then a 0 value is mapped into the Up Range 0 Color. - If a row has all the same values (including all zero values) then the background coloring for all cells in that row uses the Up Range 0 Color. Assume we use Percent Compare Thresholds: .25, .50, .75 If the AskVolume BidVolume Difference values within a 5 minute footprint bar is: -4697
5845 470 687 -3225 -3458 Percent Values for 5 minute footprint bar -4697 → 1.00 (-4697 / -4697 = 1.00)
5845 → 1.00 (5845 / 5845 = 1.00) 470 → 0.08 (470 / 5845 = 0.08) 687 → 0.11 (687 / 5845 = 0.11) -3225 → 0.69 (-3225 / -4697 = 0.69) -3458 → 0.74 (-3458 / -4697 = 0.74) Background Color Mapping -4697 (1.00) → Down Range 3 Color (1.00 > 0.75 and Negative Value)
5845 (1.00) → Up Range 3 Color (1.00 > 0.75 and Positive Value) 470 (0.08) → Up Range 0 Color (0.08 < 0.25 and Positive Value) 687 (0.11) → Up Range 0 Color (0.11 < 0.25 and Positive Value) -3225 (0.69) → Down Range 2 Color (0.50 < 0.69 < 0.75 and Negative Value) -3458 (0.74) → Down Range 2 Color (0.50 < 0.74 < 0.75 and Negative Value) The option that Market Delta doesn't have to my knowledge, but would improve this dramatically is the setting for a Maximum Quantity (just like https://www.sierrachart.com//index.php?page=doc/StudiesReference.php&ID=375&Name=Market_Depth_Historical_Graph#StudyInputs_MaximumQuantityForColoring ): If any AskVolume BidVolume Difference values are greater than this value, they will be colored as if they are equal to the Input value. This effects the overall range of quantity values used for the Block Coloring Logic.
The purpose of this Input is to prevent very large values from desaturating the rest of the graph. For example, if you were viewing a graph where most quantity values are in the range of 100~500, but there are one or two quantities that are over 5000, that would cause the large quantity values to stand out significantly while all of the other quantity values would be barely visible. With this Input, if it is set to a value of 500 or 600 for the example, the large quantity values would not stand out as much, and the details of the rest of the graph would be more visible. Setting this to 0 means there is no maximum quantity limit. Hope this helps and thank you very much in advance for adding this option! |