거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Permutations and Combinations - MetaTrader 5용 라이브러리

조회수:
4226
평가:
(32)
게시됨:
2019.06.04 20:30
업데이트됨:
2019.06.09 08:32
\MQL5\Include\ \MQL5\Scripts\Permutations\
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Introduction

It doesn't happen very often, but every once in awhile one needs to iterate over all of the combinations or permutations of a set of objects. Or more specifically, given a set of N objects, you want to consider k of them at a time (for each combination or permutation).

Practically, combinations and permutations algorithms can be used as a brute-force approach to solve certain problems, by trying every possible combination or permutation, until the optimal solution is found.

The circular k-permutations algorithm can be used in real world to solve parts of the Traveling Salesman Problem (TSP) or other similar problems like finding the currencies candidate for Triangular Arbitrage in Forex.

Below is a solution to each of these problems and more. The following generic algorithms permit to visit every combination or permutation of a sequence of length N, taken k items at time.


Performance Considerations

Every effort has been made to make this API library as fast as possible. Many algorithms and libraries for combinations/permutations were reviewed, and lot of benchmarks, code profiling and micro-optimizations were performed.

The Heap's algorithm in this library was re-implemented in a more efficient way that provides faster performance than its standard implementation.


The script 'CurrencyArbitrage_demo.mq5'

The included script scans all the possible 28 currency pairs from the 8 major currencies in Forex (usd, eur, gbp, aud, nzd, jpy, cad, chf). If an arbitrage opportunity that satisfies the profit threshold is found, it will be written to the the 'Experts' log along with the potential profit rate.

The script is a demonstration code that could be further implemented into an expert advisor / indicator to scan the market continuously for arbitrage opportunities. 

Export Summary Grouped by Trading Days Export Summary Grouped by Trading Days

The script exports summary of closed trades grouped by each trading day to .csv file

Variance Variance

Variance (Welford’s method for computing)

ArrowDrawingIndiEu ArrowDrawingIndiEu

This indi will draw OBJ_ARROW_BUY/OBJ_ARROW_SELL when find signals on Arrow Indi Buffers.

GbpChf GbpChf

Advisor for trading Gbp/Chf. Algorithm for bar opening prices. Timeframe H1.