Beobachten
1
0
Fork
Du hast bereits einen Fork von MQLArticles erstellt
0
MQLArticles/Utils/TfI
Repository-Dateien (neuester Commit zuerst)
Dateiname Letzte Commit-Nachricht Letztes Commit-Datum
2026-09-12 19:41:52 -05:00
..
Base.mqh mejoras en RM, cambio con namepsace TSN 2026-09-12 19:41:52 -05:00
Gen.mq5 new files added 2026-07-31 13:43:33 -05:00
Main.mqh mejoras en RM, cambio con namepsace TSN 2026-09-12 19:41:52 -05:00
README.md 2026-09-06 11:25:00 -05:00

← Utils

Utils/TfI

O(1) timeframe lookup tables — avoids scattered switch(ENUM_TIMEFRAMES) blocks across the codebase.

Main features

  • Timeframe → period in seconds, via a precomputed table (g_mqlarticles_tfi_period_s).
  • Timeframe → descriptive names (full enum name, short uppercase, short lowercase) (g_mqlarticles_tfi_desc / MqlArticlesTfiDesc).
  • A hash-based jump table (seeds + final table) for fast lookups instead of linear search (generated via SimPHash).

Basic usage

// Example: Given a timeframe (in this case, the period current as an example; it could be a variable, etc.), 
// you want to quickly convert that variable to a short description "M1" 
// without using EnumToString and StringReplace + To Upper/ToLower. Instead,
//  you use a quick access method with an alg hash (perfect hash), a single click, a mul, a
// nd a shift... and that's it! You now have an index with which you can query properties.  
const string decs = g_mqlarticles_tfi_desc[MqlArticlesTfiIdx(PERIOD_CURRENT)].full_name; 
Print(decs);