//+------------------------------------------------------------------+ //| Struct.mq5 | //| Copyright 2026, Niquel Mendoza. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026, Niquel Mendoza." #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #include "..\\Generic\\Simple.mqh" //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ class CGenericUtilsSort_MqlTick { public: CGenericUtilsSort_MqlTick(void) {} ~CGenericUtilsSort_MqlTick(void) {} //--- static __forceinline bool Less(const MqlTick& a, const MqlTick& b) { return a.bid < b.bid; } //--- static void Swap(MqlTick& a, MqlTick& b) { const MqlTick temp = a; a = b; b = temp; } }; //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- MqlTick tick[]; ArrayResize(tick, 10); for(int i = 0; i < 10; i++) { tick[i].bid = double(i); } //--- TsnSort(tick, 0, 10 - 1, MqlTick); ArrayPrint(tick); } //+------------------------------------------------------------------+