Step-by-step installation of TsnPerfectHashGenerator - SimPHash

6 September 2026, 20:55
Niquel Mendoza
0
63

SimPHash is the script that generates, from a YAML file, an ultra-fast lookup function based on a Perfect Hash. If you already got it from the Market, this guide walks you step by step until it's up and running, including the mandatory dependency it needs to compile.


Step 1: SimPHash

If you installed it from the Market, you already have the script in your MQL5/Scripts folder, ready to use. You don't need anything else for this step.

If instead you want to explore or modify the source code, you can find it in the MQL5 Algo Forge repository: https://forge.mql5.io/nique_372/SimPHash. I explain which license applies in that case further below.


Step 2: Install TsnTables (mandatory dependency)

The .mqh file generated by SimPHash internally includes TsnTables. This dependency is always required, with no exception: whether you're only going to use the generated .mqh in your EA or indicator, or you're going to study or modify SimPHash's source code.

Repository: https://forge.mql5.io/nique_372/TsnTables

You have three ways to get it, depending on what's most convenient for you:

  • Option A, direct download (the simplest): go to the repository, download the ZIP of the code, and unzip it inside your MetaTrader 5 Shared Projects folder.
  • Option B, from the MetaEditor interface: log in with your MQL5 Algo Forge account, fork the TsnTables repository, and in your Shared Projects folder it will automatically appear with the repository's name; from there you only need to click "Git clone" to pull all the content.
  • Option C, command line with git: if you have git available, run a git clone pointing to the repository's URL (inside your MT5 Shared Projects folder).

Step 3: TSN Ecosystem SDK


The generated .mqh files for the tool do not use relative includes directly; instead, they use paths relative to the MQL5\\Includes folder.

Because of this, you need to install the free product, TSN Ecosystem SDK, which bundles the "proxy" include files for the whole ecosystem into a single ZIP.

You can find it here: https://thebotplace.com/bot/tsn-ecosystem-sdk

Download the ZIP and unzip it into your MQL5\\Include folder.


About licenses

It's worth distinguishing two layers here, because each one has its own license:

The version of SimPHash you downloaded from the Market, the compiled script, is governed by MQL5's standard Market terms (MetaQuotes' Market Terms of Use Agreement). Those terms automatically apply to any product obtained there, and among other things cover personal use of the program, with no need for me to add anything extra.

SimPHash's source code, published separately in the Forge repository, is distributed under its own license, Nique&Leo NL-NC. This is the license that applies if your interest is to read, study, or modify that source code. I'd recommend reading the full text before doing so.

TsnTables, the mandatory dependency, is distributed under the MIT license. This makes it free to use with practically no restrictions, whether you only include it in your project or decide to read or modify its code.

The broader dependency tree of the TSN ecosystem (YAML templates, utilities, articles, and other related repositories) includes pieces under different licenses, MIT, NL-NC, and others, each with its own terms. None of them are implicitly guaranteed: always check the specific license of each repository before using or redistributing it. You can check the ecosystem's full license index here: https://forge.mql5.io/nique_372/TSNReposIndex


Explore the code

If you want to see how SimPHash is built under the hood, review its dependencies, or simply learn from the implementation, the full repository is available at: https://forge.mql5.io/nique_372/SimPHash


Docs