Haifa Israel
Experience: Beginner
Platform: sierra chart
Broker: Optimus Trading Group/Rithmic
Trading: es
Posts: 91 since Apr 2012
Thanks Given: 50
Thanks Received: 71
|
There probably is an easier solution but here is what I have on mind:
Lets call the charts from which you want to get the bars start time Source Charts and lets call the chart that will get those values the Destination Chart.
On the Source charts you will have to add a study that will store the time values in persistent variables, for an example you can use something like this:
int& Hour= sc.PersistVars->i1;
int& Minute= sc.PersistVars->i2;
int& Second= sc.PersistVars->i3;
SCDateTime DTV = sc.BaseDateTimeIn[sc.Index];
DTV.GetTimeHMS(Hour, Minute, Second);
Then, on the Destination chart you will have another study that will get those time values using:
const s_sc::s_PersistentVariables * p_PersistVars = sc.GetStudyPersistentVariablesFromChartUsingID( Source.GetChartNumber(), Source.GetStudyID());
Something like this:
CSFExport scsf_DestinationStudy(SCStudyGraphRef sc)
{
SCInputRef Source = sc.Input[0];
if (sc.SetDefaults)
{
Source.Name = "Source_Chart_&_Study_Numbers";// Use those inputs to choose the source study on the source chart.
Source.SetChartStudyValues(1,0);
return;
}
const s_sc::s_PersistentVariables * p_PersistVars = sc.GetStudyPersistentVariablesFromChartUsingID( Source.GetChartNumber(), Source.GetStudyID());
int Hour = p_PersistVars->i1;
int Minute = p_PersistVars->i2;
int Second = p_PersistVars->i3;
}
The sc.GetStudyPersistentVariablesFromChartUsingID function creates a link between the corresponding persistent variables on the source study and the destination study so that each time the values of Hour, Minute and Second change on the source chart they will immediately be updated on the destination chart with the values from the source.
This is documented here :
ACSIL Interface Members - Functions - Sierra Chart
I hope this helps.
|