Login Page - Create Account

Support Board


Date/Time: Tue, 23 Apr 2024 17:53:51 +0000



Post From: ACSIL Setting Constant Range Scale issue

[2014-01-23 23:29:14]
Trade Nice - Posts: 75
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