Login Page - Create Account

Support Board


Date/Time: Thu, 19 Sep 2024 01:00:25 +0000



Post From: OpenChartOrGetChartReference

[2014-07-05 06:35:54]
tickHunter - Posts: 14
I am trying to open a chart using sc.OpenChartOrGetChartReference().

Am I correct in thinking that I can use this function in an ACSIL study to open a chart set to some particular start time? Following the example provided in studies.cpp, here is a portion of the relevant code:


int& ChartNumber = sc.PersistVars->i1;
s_ACSOpenChartParameters OpenChartParameters;
OpenChartParameters.PriorChartNumber = ChartNumber;
OpenChartParameters.ChartDataType = INTRADAY_DATA; //This can also be set to: DAILY_DATA
OpenChartParameters.Symbol = sc.GetRealTimeSymbol();//When want to use the symbol of the chart the study function is on, use sc.GetRealTimeSymbol()
OpenChartParameters.IntradayBarPeriodType = IBPT_DAYS_MINS_SECS;
OpenChartParameters.IntradayBarPeriodLength = 30*SECONDS_PER_MINUTE; // 30 minutes

OpenChartParameters.SessionStartTime.SetTimeHMS(9,30,53); //some arbitrary start time
OpenChartParameters.SessionEndTime.SetTimeHMS(15,14,59);


The new chart which is opened using this function is always set to a start time of 00:00:00, regardless of the value set during initialization of the object.

Thanks!
Date Time Of Last Edit: 2014-07-05 22:35:11