Login Page - Create Account

Support Board


Date/Time: Wed, 29 Jun 2022 22:54:37 +0000



[User Discussion] - ACSIL Setting Constant Range Scale issue

View Count: 1146

[2014-01-23 23:29:14]
Trade Nice - Posts: 74
I am trying to use the following code to automatically set the range of a chart when the symbol is changed.

It works for the first symbol, but does not work when the symbol is changed to another symbol.

The value that shows on the Scale Window for the Scale Range is not showing correctly and is not providing the correct value for the range

But log message output for sc.BaseGraphScaleConstRange does show the correct value ( that is the value that should show as Scale Range and should control the range of the chart)

if sc.Index == 0;
{
sc.BaseGraphScaleRangeType = SCALE_CONSTRANGE;
sc.BaseGraphScaleConstRange = x; //x can be any realistic value
log_message.Format("sc.BaseGraphScaleConstRange: %f", sc.BaseGraphScaleConstRange ) ;sc.AddMessageToLog( log_message, 1 ) ;
}

The Log message is showing x, but the value in 'Constant Range Range:' is not x

I did try setting sc.BaseGraphScaleRangeType to Auto, and then interestingly the correct value for x did appear in the Constant Range > Range

Please note that the issue arises after the chart is change from one symbol to another





[2014-01-24 00:00:07]
Sierra Chart Engineering - Posts: 103520
The reason this happens is because the constant range value for a constant range scale is automatically reset when changing the symbol of a chart. You have to set sc.BaseGraphScaleConstRange after you change the symbol of 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
[2014-01-24 09:02:17]
Trade Nice - Posts: 74
Okay, the automatic reset is something I had not realised occurs.

However, my program is setting sc.BaseGraphScaleConstRange after the symbol has been changed, since the symbol being changed 'if(sc.Index == 0)' is what is causing the code to run?

So rather than the code needing to run after the symbol has been changed, the code needs to run after the automatic reset has been done?

Seems what would need to happen is that the "constant range scale is automatically reset" needs to be disabled, or else the program needs to be able to know when the automatic reset has been completed so sc.BaseGraphScaleConstRange could be set then ?

[2014-01-24 10:04:43]
Sierra Chart Engineering - Posts: 103520
You have to change sc.BaseGraphScaleConstRange after the study is fully recalculated which occurs after the symbol is changed.

So this would be on the next call into the study function after sc.Index == 0 occurs.
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
[2014-01-24 11:03:41]
Trade Nice - Posts: 74
Okay, I guess that means I need to create a gate so I only set sc.BaseGraphScaleConstRange on the first call after the full recalculation has occured. It is a pity to not be able to use sc.Index == 0.

It would seem to make sense that the auto constant range value could be set from ACSIL or else disabled from ACSIL. Could this be worked on?

I think I see the point of the auto constant range for normal use, but on a first look, it is not clear on what basis the auto constant range sets the ranges, as it does not appear to be on percentage basis of the first symbol, with that percentage applied to each following symbol's range to give relative views?

What is the formula for the auto constant range?
[2014-01-25 02:28:14]
Sierra Chart Engineering - Posts: 103520
You really have to work out a solution to this in the study function.

The scenario you are using, is rather unusual and we do not have the time to figure out some kind of solution for that.

The automatic setting of the constant range is simply the range of prices within the visible view of the chart after changing the symbol of 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

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

Login

Login Page - Create Account