거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
5733
평가:
(45)
게시됨:
2012.06.04 10:41
업데이트됨:
2016.11.22 07:32
ssorttest.mq5 (23.35 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The script contains several sorting methods for sorting of double[] array:

There are 2 functions - ascending (Up) and descending (Dn) sort:

  • SortBubbleUp(double & aAr[]);
  • SortBubbleDn(double & aAr[]);
  • SortSelectUp(double & aAr[]);
  • SortSelectDn(double & aAr[]);
  • SortInsertUp(double & aAr[]);
  • SortInsertDn(double & aAr[]);
  • SortShellUp(double & aAr[]);
  • SortShellDn(double & aAr[]);
  • SortHoareUp(double & aAr[]);
  • SortHoareDn(double & aAr[]);
  • SortSelectUpFst(double & aAr[]);
  • SortSelectDnFst(double & aAr[]).

The script has several auxiliary functions:

  • Check(double & aAr[]) - checks if array is already sorted (ascending). If array is not sorted, it prints "Error".
  • ArrayAlertR(double & aAr[],int aDigits=0,string aHeader="") - prints array as a line. Arguments: double & aAr[] - array to print, int aDigits - precision (digits), string aHeader - additional string at the start of the line. This function may be useful to check the changes of the array during the sorting process.
  • ArrayAlertC(double & aAr[],int aDigits=0,string aHeader="") - prints array as a column. Arguments: double & aAr[] - array to print, int aDigits - precision (digits),  string aHeader - additional string at the start of the line.

Sorting algorithms performance:

  • Hoare - 8 ms;
  • Shell - 78 ms;
  • SelectFst - 126 ms;
  • Selection - 582 ms;
  • Insertion - 702 ms;
  • Bubble - 1558 ms;

Fig. 1. Sort algorithms performance

Fig. 1. Sort algorithms performance

The fastest sort method is Hoar sort (Quick sort), but it's recursive and needs a careful use.

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/904

Sampler Sampler

The indicator calculates perfect market entry signals, which can be used for neural network training.

Pearson correlation indicator Pearson correlation indicator

Pearson correlation indicator shows the correlation between symbols.

EMA_STD_VA EMA_STD_VA

Adaptive Exponentially Smoothed Moving Average, based on StdDev indicator.

EMA_ATR_VA EMA_ATR_VA

Advaptive Exponential Moving Average - ATR Volatility Adjusted by Jose Silva.