//+------------------------------------------------------------------+ //| CompareFunction.mqh | //| Copyright 2000-2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #include //+------------------------------------------------------------------+ //| Compares two objects and returns a value indicating whether one | //| is less than, equal to, or greater than the other. | //+------------------------------------------------------------------+ int Compare(const bool x,const bool y) { if(x>y) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(xy) return(1); else if(x int Compare(T x,T y) { //--- try to convert to comparable object IComparable*comparable=dynamic_cast*>(x); if(comparable) { //--- use specied compare method return comparable.Compare(y); } else { //--- unknown compare function return(0); } } //+------------------------------------------------------------------+