CalcAlgResult CalcAlg(AlgId tAlg, ArgType tArg)
tAlg. Moniker of opened indicators calculation algorithm instance.
tArg. Operation execution parameters.
The CalcAlg operation calculates indicators calculation algorithm.
To execute the operation, in the tAlg field specify the opened calculation algorithm instance moniker, and in the tArg field specify operation execution parameters. The moniker can be obtained on executing the OpenAlg operation.
The operation results in the information about successful calculation or calculation errors and also the total calculation time and the total time spent on calculation.
Below is the example of starting indicators calculation algorithm calculation. The request contains opened calculation algorithm instance moniker. The response contains information about calculation results.
{
"CalcAlg" :
{
"tAlg" :
{
"id" : "S1!M!S!C1"
},
"tArg" :
{
"command" : "Start",
"state" : "true"
}
}
}
{
"CalcAlgResult" :
{
"state" :
{
"calculationState" : "Running",
"needUpdateStyles" : "1"
}
}
}
public static CalcAlgResult CalcAlg(string moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tCalc = new CalcAlg()
{
tAlg = new AlgId() { id = moniker },
tArg = new CalcAlgArg()
{
command = AlgCalcCommand.Start,
state = true
}
};
//Execute indicators calculation algorithm
var result = somClient.CalcAlg(tCalc);
return result;
}
See also: