Login Page - Create Account

Support Board


Date/Time: Tue, 13 May 2025 17:45:19 +0000



Post From: Programming Help: Tick Size and Scale Range Type

[2024-08-29 09:45:37]
User688525 - Posts: 284
Hello Sierra Chart,
I have created a simple custom study to change the Tick Size and Scale Range Type using the code below.

Can assistance please be provided for two issues:
1) The ScaleConstRange is not being applied to the main graph ("0"). If this is changed to "1" (graph 2), then it appears to work?
2) When sc.FlagToReloadChartData is set to "1", the chart continuously reloads/loops?

#include "sierrachart.h"
SCDLLName("Ticks Range")

SCSFExport scsf_TicksRange(SCStudyInterfaceRef sc)
{

sc.TickSize = 0.5; // Set the tick size to 0.5

sc.ScaleRangeType = SCALE_CONSTANT_RANGE; // Set this study to use a centered constant range scale

sc.ScaleConstRange = 30; // Set the range of the scale to 30 points

sc.GraphRegion = 0; // Use the main price graph region

sc.FlagToReloadChartData = 1; // Reload the chart data

}


Thank you