Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 21:56:56 +0000



Market depth historical study: linear interpolation

View Count: 476

[2021-10-23 16:26:33]
user2837 - Posts: 76
In the documentation of block coloring logic https://www.sierrachart.com/index.php?page=doc/StudiesReference.php&ID=375#BlockColoringLogic, should item 4 in Example 2 have (60, 0, 40) instead of (40, 0, 40)? Similarly, in Example 3.

If the color percentage is 0.40, I would expect the linear interpolant to be 0.60*range_min_color + 0.40*range_max_color.

Now suppose the Minimum Volume Intensity Percentage in Example 2 is 70 instead of 0. I would then expect the interpolating color in Example 2 to be:

0.60*(0.30*range_min_color+0.70*range_max_color) + 0.40*range_max_color.

Correct?
[2021-10-26 18:07:11]
John - SC Support - Posts: 31159
In the documentation of block coloring logic https://www.sierrachart.com/index.php?page=doc/StudiesReference.php&ID=375#BlockColoringLogic, should item 4 in Example 2 have (60, 0, 40) instead of (40, 0, 40)? Similarly, in Example 3.

If the color percentage is 0.40, I would expect the linear interpolant to be 0.60*range_min_color + 0.40*range_max_color.

Your equation is correct, but you need to keep in mind that each color is handled separately, so Red has a range_min_color of 0, therefore the resulting equation is Red_Interpolated = 0.60 * 0 + 0.40 * 100 = .40

The same is then true for Green and Blue, where Green is 0 and Blue is the same calculation as red. Hence a result of (40, 0, 40).

Now suppose the Minimum Volume Intensity Percentage in Example 2 is 70 instead of 0. I would then expect the interpolating color in Example 2 to be:

0.60*(0.30*range_min_color+0.70*range_max_color) + 0.40*range_max_color.

The Minimum Volume Intensity Percentage is not applied to the interpolation of the colors for the final step. Rather, the percentages of the range of values is adjusted. It's hard to explain, as it is done this way in order to create a faster lookup of the values rather than a calculation on the fly.
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