Login Page - Create Account

Support Board


Date/Time: Mon, 12 Oct 2026 21:13:39 +0000



Feature request : New Scale Range Setting

View Count: 287

[2026-08-27 15:21:48]
Sébastien - Posts: 155
Hi,
I opted to use a single laptop screen for my trading interface.
Thus I am constrained to use some small charts that only take a small part of my screen.
Some of these charts contain a Numbers Bars study so I use the Constant Range setting for them (as it should be).

From time to time, I use the Maximize window/Restore window features on these charts to make them full screen to see more historic data.
When doing so, the Price Range stay constant since I use Constant Range setting. But it looks badly stretched on the Y axis in full screen mode.

To avoid this problem, it would be awesome to have a new setting that links proportionally the Y size of the window (in pixels) with the Constant Range setting input.

For example, If a window have a normal height dimension of 1000 pixels with a 30 Constant Range setting input, when this window is maximized full screen and take 2000 pixels in height, the constant range input value would also double and become 60 instead of 30.
This way the proportionality would be preserved and there would be no stretching at all.

Would you consider adding this new feature ?

Best regards,
Sébastien
[2026-08-27 22:28:09]
Sierra_Chart Engineering - Posts: 25148
We will have to look into this later.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2026-08-27 22:28:15
[2026-08-28 06:49:45]
Tony - Posts: 725
Switch Range Bar number between 30 and 60 would give you a very different view of chart, might disturb your trading strategy, another possible solution would be dynamically change Top and Bottom Range of the Scale on the fly, (see animated .gif attached), the chart showed in the attached image is set to 30 tick range bar, as I change the size of the window, the Top and Bottom Range change accordingly, so you always have the same perspective. This is done with ACSIL.

The idea:
void CenterTheChart(SCStudyInterfaceRef sc)
{
  sc.BaseGraphScaleConstRange = sc.ChartRegion1BottomCoordinate * 0.233387358;
  sc.BaseGraphScaleRangeTop = sc.Close[sc.IndexOfLastVisibleBar] + sc.BaseGraphScaleConstRange*4/9.0;
  sc.BaseGraphScaleRangeBottom = sc.Close[sc.IndexOfLastVisibleBar] - sc.BaseGraphScaleConstRange*5/9.0;
}

Date Time Of Last Edit: 2026-08-28 07:01:02
imageoutput_small.gif / V - Attached On 2026-08-28 06:57:20 UTC - Size: 331.96 KB - 96 views
[2026-08-28 16:24:03]
Sébastien - Posts: 155
Hi Tony,
Thank you for taking some of your time to think about my issue.
There might have been a misunderstanding about what I meant when I said "Constant Range".
I was speaking about the Scale Range Setting, not the bar period type.
Indeed switching the bar period between 30 and 60 Range would give me a completely different graph. This is not what I wanted.

Anyway, your .gif example does exactly what I expect.
I didn't know that it was achievable with ACSIL.

I took the liberty to give to Grok the piece of code you wrote so it would write me a full custom study (I am not smart enough to learn coding).
After a few back and forth Grok gave me a fully working custom study that automatically adapts the scale range proportionally to Region 1 height.
It is very practical for Footprint charts or TPO charts when using Maximize window/Restore window keyboard shortcuts.

Thank you again Tony for the idea.

For those interested, here is the source code.

#include "sierrachart.h"

SCDLLName("Adaptive Constant Range by Height")

SCSFExport scsf_AdaptiveConstantRangeAuto(SCStudyInterfaceRef sc)
{
// Persistent storage
int& r_BaselineHeight = sc.GetPersistentInt(0);
float& r_BaselineConstRange = sc.GetPersistentFloat(1);
int& r_LastHeight = sc.GetPersistentInt(2);
int& r_BaselineCaptured = sc.GetPersistentInt(3); // 0 = not yet
float& r_LastValueWeSet = sc.GetPersistentFloat(4); // last value written by the study

if (sc.SetDefaults)
{
sc.GraphName = "Adaptive Constant Range by Height (Auto)";
sc.StudyDescription =
"Keeps visual bar size constant when the chart window is resized. "
"Automatically captures the current height + Constant Range as baseline. "
"If you later change the Constant Range manually, the study re-learns "
"the new value as the new baseline. "
"Only sc.BaseGraphScaleConstRange is ever modified.";

sc.AutoLoop = 0;
sc.GraphRegion = 0;
sc.UpdateAlways = 1;
sc.CalculationPrecedence = LOW_PREC_LEVEL;

return;
}

// Current height of Chart Region 1
int CurrentHeight = sc.ChartRegion1BottomCoordinate - sc.ChartRegion1TopCoordinate;
if (CurrentHeight <= 10)
return;

float CurrentConstRange = sc.BaseGraphScaleConstRange;

// ------------------------------------------------------------------
// 1. Detect that the user manually changed the Constant Range
// ------------------------------------------------------------------
// If the value currently in the chart is different from the last value
// the study itself wrote, the user must have changed it.
const float EPSILON = 0.00001f;
bool UserChangedRange = (r_BaselineCaptured != 0) &&
(fabsf(CurrentConstRange - r_LastValueWeSet) > EPSILON);

// ------------------------------------------------------------------
// 2. Capture / re-capture baseline
// ------------------------------------------------------------------
if (r_BaselineCaptured == 0 || sc.IsFullRecalculation || UserChangedRange)
{
if (CurrentConstRange > 0.0f)
{
r_BaselineHeight = CurrentHeight;
r_BaselineConstRange = CurrentConstRange;
r_LastHeight = CurrentHeight;
r_LastValueWeSet = CurrentConstRange; // we did not change it, user did
r_BaselineCaptured = 1;

// Optional confirmation
/*
SCString msg;
msg.Format("Baseline %s: Height=%d ConstRange=%.5f",
UserChangedRange ? "updated by user" : "captured",
r_BaselineHeight, r_BaselineConstRange);
sc.AddMessageToLog(msg, 0);
*/
}
return;
}

// ------------------------------------------------------------------
// 3. Only act when the window height has actually changed
// ------------------------------------------------------------------
if (CurrentHeight == r_LastHeight)
return;

r_LastHeight = CurrentHeight;

// Calculate new range while preserving the visual density of the baseline
float NewConstRange = r_BaselineConstRange * ((float)CurrentHeight / (float)r_BaselineHeight);

// *** THE ONLY LINE THAT WRITES TO THE CHART ***
sc.BaseGraphScaleConstRange = NewConstRange;

// Remember what we just wrote so we can detect future manual changes
r_LastValueWeSet = NewConstRange;
}

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

Login

Login Page - Create Account