The Algo assembly is used to work with the Calculation Algorithms extension. Programming in Fore using this assembly consists in a consecutive setup of calculation algorithm.
Before getting started with calculation algorithm:
Make sure that you have installed the Calculation Algorithms extension.
In the development environment add links to the Algo system assembly and to the Calculation Algorithm Core custom assembly, which is included in the Calculation Algorithms component:
After the operations are executed, classes and application functions of the Calculation Algorithm Core custom assembly are available to get started with calculation algorithm.
To get started with calculation algorithm:
Get a repository object of the Indicators Calculation Algorithm type using the CalcObjectFactory class and the CreateCalcObject application function, which are implemented in the Calculation Algorithm Core custom assembly.
Syntax of the CreateCalcObject function:
CreateCalcObject(descr: IMetabaseObjectDescriptor, [OpenForEdit: Boolean = true]): ICalcObject;
Parameters:
descr. Repository object.
OpenForEdit. Allow or deny to edit repository object.
Cast the obtained object to the ICalcAlgorithm interface.
The example of getting calculation algorithm with the ALGORITHM identifier for edit:
Sub UserProc;
Var
MB: IMetabase;
Algo: ICalcAlgorithm;
Begin
MB := MetabaseClass.Active;
Algo := CalcObjectFactory.CreateCalcObject(MB.ItemById("ALGORITHM"), True) As ICalcAlgorithm;
//...
End Sub UserProc;
The following objects are used in calculation algorithm setup:
Calculation block. It is used to execute calculations by the specified parameters. The ICalcBlock interface is used to work with calculation block.
Aggregation block. It is used to execute aggregation by the specified parameters. The ICalcAggr interface is used to work with aggregation block.
Function block. It is used to calculate application function. The ICalcFunc interface is used to work with function block.
Linear optimization block. It is used to solve the task of optimal use of limited resources. The ICalcLinearOptimizationBlock interface is used to work with linear optimization block.
Control block. It is used to check entered data in the Interactive Data Entry Forms extension. The ICalcValidationBlock interface is used to work with control block.
Ready calculation algorithm. It is used to calculate the existing calculation algorithm in the current calculation. The ICalcAlgorithm interface is used to work with ready calculation algorithm.
Calculation algorithm setup is executed according to the scheme:
For details about interaction of assembly interfaces see the Algo Assembly Hierarchy section.
See also:
About the Algo Assembly | Algo Assembly Interfaces | Algo Assembly Enumerations