I understood from Admin's previous post, I must put it in an array, and that is where I loose it, :-) , any suggestions?
Here is an example of using an array and a cycle. Keep in mind that I have not tested this code and there may be improvements needed. This should give you an idea though.
Here is the code from your script:
string c01 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_32:rd_168_48:id00:#EURUSDwnd|cWnd0",OBJPROP_TEXT) ;
string c02 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_48:rd_168_64:id00:#GBPUSDwnd|cWnd1",OBJPROP_TEXT) ;
string c03 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_64:rd_168_80:id00:#AUDUSDwnd|cWnd2",OBJPROP_TEXT) ;
string c04 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_80:rd_168_96:id00:#USDJPYwnd|cWnd3",OBJPROP_TEXT) ;
string c05 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_96:rd_168_112:id00:#USDCHFwnd|cWnd4",OBJPROP_TEXT) ;
string c06 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_112:rd_168_128:id00:#USDCADwnd|cWnd5",OBJPROP_TEXT) ;
string c07 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_128:rd_168_144:id00:#EURAUDwnd|cWnd6",OBJPROP_TEXT) ;
string c08 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_144:rd_168_160:id00:#EURCADwnd|cWnd7",OBJPROP_TEXT) ;
string c09 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_160:rd_168_176:id00:#EURCHFwnd|cWnd8",OBJPROP_TEXT) ;
string c10 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_176:rd_168_192:id00:#EURGBPwnd|cWnd9",OBJPROP_TEXT) ;
string c11 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_192:rd_168_208:id00:#EURJPYwnd|cWnd10",OBJPROP_TEXT) ;
string c12 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_208:rd_168_224:id00:#GBPJPYwnd|cWnd11",OBJPROP_TEXT) ;
string c13 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_224:rd_168_240:id00:#GBPCHFwnd|cWnd12",OBJPROP_TEXT) ;
string c14 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_240:rd_168_256:id00:#NZDUSDwnd|cWnd13",OBJPROP_TEXT) ;
string c15 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_256:rd_168_272:id00:#AUDCADwnd|cWnd14",OBJPROP_TEXT) ;
string c16 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_272:rd_168_288:id00:#AUDJPYwnd|cWnd15",OBJPROP_TEXT) ;
string c17 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_288:rd_168_304:id00:#CHFJPYwnd|cWnd16",OBJPROP_TEXT) ;
string c18 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_304:rd_168_320:id00:#AUDNZDwnd|cWnd17",OBJPROP_TEXT) ;
string c19 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_320:rd_168_336:id00:#NZDJPYwnd|cWnd18",OBJPROP_TEXT) ;
string c20 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_336:rd_168_352:id00:#NZDCADwnd|cWnd19",OBJPROP_TEXT) ;
string c21 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_352:rd_168_368:id00:#GBPNZDwnd|cWnd21",OBJPROP_TEXT) ;
string c22 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_368:rd_168_384:id00:#EURNZDwnd|cWnd22",OBJPROP_TEXT) ;
string c23 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_384:rd_168_400:id00:#GBPCADwnd|cWnd23",OBJPROP_TEXT) ;
string c24 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_400:rd_168_416:id00:#GBPAUDwnd|cWnd24",OBJPROP_TEXT) ;
string c25 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_416:rd_168_432:id00:#AUDCHFwnd|cWnd25",OBJPROP_TEXT) ;
string c26 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_432:rd_168_448:id00:#CADCHFwnd|cWnd26",OBJPROP_TEXT) ;
string c27 = ObjectGetString(0,"wnd:z_1??:c_69:lu_8_448:rd_168_464:id00:#CADJPYwnd|cWnd27",OBJPROP_TEXT) ;
Here is a better way to do it:
string c[27];
for (int i=ObjectsTotal()-1;i>=0;i--)//cycle through all objects on chart
{
string name=ObjectName(i);
if (StringFind(name,"wnd:z_1??:c_69:")==-1)continue;//all objects start with this same string so filter out other objects (eg. from other indicators)
for (int a=0;a<27;a++)//we will assign the 27 different symbols to the array
{
if (StringFind(name,StringConcatenate("cWnd",a))==-1)continue;//assign the symbol to the same array position in order
string text = ObjectGetString(0,name,OBJPROP_TEXT);
int pos = StringFind(text,"id00:#");//find position in text prior to where symbol will be
if (pos==-1)continue;//not an object we need to consider
c[a]=StringSubstr(text,pos+1,6);
}
}
A similar method could be used to get the values too. It may even be possible to find both the symbol and value at the same time with the same code. This is just an example though.
I think you asked before about the EA being able to check a symbol and value, trade if needed, and then go on to another symbol and so on. Once your data is in arrays, I think it's easier to work with. You can just have your EA cycle through the arrays you have instead of writing similar code over and over again.