I am using API manager for the trading platform MetaTrader 4
I need to get ALL SECURITIES per GROUP
for example GROUP=preliminary|SECUTIRY_0=Forex|SECUTIRY_1=CFD|SECUTIRY_2=|
i have some tips how to do it below:
- After request Securities config using CfgRequestSymbolGroup(ConSymbolGroup configurations) you got all securities.*
- So you got ConSymbolGroup for each security and now that configurations[0] is forex, configurations[1] is cfd and configurations[2] is metals for example.*
- Then request group config using CfgRequestGroup(int total) you will get ConGroup structure for each group.
- ConGroup has ConGroupSec secgroups[MAX_SEC_GROUPS] parameter - security group settings.*
- The indexes will be the same so secgroups[0] is forex settings for this group, secgroups[1] is cfd and so on.*
my code is below but can not get the desired result, in the code below i get the list with SECURITIES AND THE LIST WITH GROUPS but can not get indexes based on description above to get the result in this format
GROUP=preliminary|SECUTIRY_0=Forex|SECUTIRY_1=CFD|SECUTIRY_2=|
// 1 step
// request all securities
// list with securities
ConSymbolGroup securities[MAX_SEC_GROUP];
int result = ExtManager->CfgRequestSymbolGroup(securities);
// 2 step
// request all groups
// list with groups
ConGroup *groups = ExtManager->CfgRequestGroup(&total);
ConGroupSec secgroups[MAX_SEC_GROUPS];
int index_secgroup = 0;
int index_security = 0;
for (int i = 0; i < MAX_SEC_GROUP; i++)
for (int i =0; i < total; i++)
ExtProcessor.PrintResponse(size,
"GROUP=%s|"
"SECUTIRY_0=%s|"
"SECUTIRY_1=%s|"
"SECUTIRY_2=%s|\r\n",
groups[i].group,
securities[0].name,
securities[1].name,
securities[2].name);
}