Sort struct type arrays ? New comment [Deleted] 2014.08.02 17:30 Hi, is it possible to sort an array of structs ?Say:struct profit_targets{ string target_type; //name of target, "Target 1", "Target 2" double target_price; //price of the target}; profit_targets all_TP[2];all_TP[0].target_type = "Target 1";all_TP[0].target_price= 1.35666;all_TP[1].target_type = "Target 2";all_TP[1].target_price= 1.34711; How can I sort the array all_TP by target_price in Descending Mode ? ArraySort(all_TP.target_price,MODE_DESCEND); does not work :(Thanks in advance. How to sort struct variables in MT4? How to sort the value using ArraySort except zero data? Multi Dymension array..how to New comment
Hi, is it possible to sort an array of structs ?
Say:
struct profit_targets
{
string target_type; //name of target, "Target 1", "Target 2"
double target_price; //price of the target
};
profit_targets all_TP[2];
all_TP[0].target_type = "Target 1";
all_TP[0].target_price= 1.35666;
all_TP[1].target_type = "Target 2";
all_TP[1].target_price= 1.34711;
How can I sort the array all_TP by target_price in Descending Mode ?
ArraySort(all_TP.target_price,MODE_DESCEND); does not work :(
Thanks in advance.