Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 15:50:23 +0000



[Programming Help] - Change a chart's periodicity based on symbol

View Count: 881

[2019-12-06 03:41:18]
joshtrader - Posts: 435
I have quote board linked with two charts so that the charts change symbols based on what I click in the quote board.

The charts are "volume per bar" charts and not time-based. Is it possible to change the periodicity depending on the symbol selected? For example, selecting symbol XYZ changes the chart to 5000V, and ABC changes the chart to 1000V?
[2019-12-06 11:44:32]
T44 - Posts: 363
Yes, I do this using ACSIL.

e.g.

//Check if the first two characters of the symbol are "ES"
int IsES; IsES = sc.Symbol.CompareNoCase("ES",2);

if (IsES == 0) {
//if the symbol is ES then set the volume per bar to 5000V- use sc.SetBarPeriodParameters here
n_ACSIL::s_BarPeriod NewBarPeriod;
NewBarPeriod.ChartDataType = INTRADAY_DATA;
NewBarPeriod.IntradayChartBarPeriodType = IBPT_VOLUME_PER_BAR ;
NewBarPeriod.IntradayChartBarPeriodParameter1 = 5000;

//Set the bar period parameters. This will go into effect after the study function returns.
sc.SetBarPeriodParameters(NewBarPeriod);
}
see sc.SetBarPeriodParameters()
Date Time Of Last Edit: 2019-12-06 11:51:45

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

Login

Login Page - Create Account