forked from nique_372/ICTLibraryEasy
239 lines
7.1 KiB
Markdown
239 lines
7.1 KiB
Markdown
<p align="center">
|
|
<img src="./Images/ICTLibraryEasyByLeo.png" alt="ICTLibraryEasy Logo" width="1150" height="175"/>
|
|
</p>
|
|
|
|
<p align="center">
|
|
A simplified MQL5 library for integrating essential ICT (Inner Circle Trader) concepts into your trading bots and expert advisors.
|
|
</p>
|
|
|
|
<p align="center">
|
|
<img src="https://img.shields.io/badge/Language-MQL5-1B6CA8?style=flat-square"/>
|
|
<img src="https://img.shields.io/badge/Platform-MetaTrader%205-0D1B2A?style=flat-square"/>
|
|
<img src="https://img.shields.io/badge/Author-nique__372%20and%20Leo-C9D6DF?style=flat-square"/>
|
|
<img src="https://img.shields.io/badge/version-1.21-blue"/>
|
|
</p>
|
|
|
|
|
|
---
|
|
|
|
## Integrated Concepts
|
|
|
|
| Class | Concept | Description |
|
|
|---|---|---|
|
|
| `CFvgBar` | **FVG** | Detects Fair Value Gaps (bullish & bearish) with configurable minimum size and drawing style |
|
|
| `CBosChoch` | **BOS / CHoCH** | Identifies Break of Structure and Change of Character using swing-based logic |
|
|
| `CSwingBarPure` | **Swings (Pure)** | Detects swing highs and lows using a configurable candle-based method |
|
|
| `CSwingBarZigZag` | **Swings (ZigZag)** | Detects swing highs and lows using a ZigZag indicator approach |
|
|
| `CTradingSession` | **Trading Session** | Tracks session time windows, draws ranges and exposes session high/low |
|
|
| `CRangeSession` | **Range Session** | Similar at Trading Session, but with max and min session tracking |
|
|
|
|
---
|
|
|
|
## Quick Start Examples
|
|
|
|
### FVG — Fair Value Gap
|
|
|
|
```cpp
|
|
#define DEFGLOBAL_SIMPLE
|
|
#include "..\\Global.mqh"
|
|
|
|
CFvgBar fvg;
|
|
int8_t idx_controler_d1 = INVALID_INDEX;
|
|
|
|
int OnInit()
|
|
{
|
|
const int atr_pos = ICTAtr_Create(PERIOD_CURRENT, _Symbol, 14, true);
|
|
CAtr* atr_ptr = ICTAtr_GetAtrPointer(atr_pos);
|
|
|
|
g_new_bar_manager.GetPosExecute(PERIOD_D1, idx_controler_d1);
|
|
|
|
fvg.Create(_Symbol, _Period);
|
|
fvg.SetGrapich(clrGreen, clrRed, clrGreen, clrRed, STYLE_SOLID, true, 1, true, 10, 1, STYLE_DOT);
|
|
fvg.Set(500, defined_pattern, fvg_1_vela, CreateDiffptr(MODE_DIFF_BY_ATR, _Symbol, atr_ptr, 1, 0.00));
|
|
|
|
return INIT_SUCCEEDED;
|
|
}
|
|
|
|
void OnTick()
|
|
{
|
|
const datetime curr_time = TimeCurrent();
|
|
g_new_bar_manager.Execute(curr_time);
|
|
|
|
if(CNewBarManager_IsNewBarM1(g_new_bar_manager))
|
|
{
|
|
const bool new_day = CNewBarManager_IsNewBar(g_new_bar_manager, idx_controler_d1);
|
|
ICTGen_FuncionOnBarM1(new_day, curr_time);
|
|
fvg.OnNewBar();
|
|
}
|
|
}
|
|
```
|
|
|
|
### BOS / CHoCH — Break of Structure & Change of Character
|
|
|
|
```cpp
|
|
// In OnInit()
|
|
g_bos_choch.Create(_Symbol, _Period);
|
|
g_bos_choch.SetGrapich(clr_Choch, clr_Bos, clr_Choch_2, clr_Bos_2, STYLE_DOT);
|
|
g_bos_choch.Init(2, clrRed, clrBlue, "Arial", 8, false, 30, MODE_SWING_STRICT, false, 500);
|
|
|
|
// In OnTick() — inside IsNewBar block
|
|
g_bos_choch.OnNewBar();
|
|
```
|
|
|
|
### Trading Session
|
|
|
|
```cpp
|
|
// In OnInit()
|
|
session.Create(_Symbol, _Period, 0, 0, true, true, 10, 0, 15, 0, "Trading session");
|
|
session.SetGrapichStyles(STYLE_SOLID, clrAntiqueWhite, 1, true);
|
|
session.SetExtra(clrAqua, clrAliceBlue, STYLE_SOLID, 2, draw_session_range_lines_and_rect);
|
|
|
|
// In OnTick() — inside IsNewBarM1 block
|
|
session.OnNewBarM1();
|
|
```
|
|
|
|
|
|
### Swings — Pure method
|
|
|
|
```cpp
|
|
// In OnInit()
|
|
MqlParam params[];
|
|
PureToParmas(5, 5, MODE_SWING_NO_STRICT, params);
|
|
swing.Create(_Symbol, _Period, 0, 0, true, params);
|
|
swing.SetProperties(clrBlue, clrRed, "H", "L", "Arial", 8, 10);
|
|
|
|
// In OnTick() — inside IsNewBar block
|
|
swing.OnNewBar();
|
|
```
|
|
|
|
|
|
### Swings — ZigZag method
|
|
|
|
```cpp
|
|
// In OnInit()
|
|
MqlParam params[];
|
|
ZZToParams(5, 400, false, params);
|
|
swing.Create(_Symbol, _Period, 0, 0, true, params);
|
|
swing.SetProperties(clrBlue, clrRed, "H", "L", "Arial", 8, 10);
|
|
|
|
// In OnTick() — inside IsNewBar block
|
|
swing.OnNewBar();
|
|
```
|
|
|
|
|
|
---
|
|
|
|
## Repository Structure
|
|
|
|
```
|
|
ICTLibraryEasy/
|
|
├── Src/ # Wrapper for ICT concepts imported from ICTEasyLibrary.ex5
|
|
├── Examples/ # Complete bot ict and comparative benchmarks with other libraries and code generated by LLM
|
|
└── Images/ # Repository banner
|
|
```
|
|
---
|
|
|
|
## Benchmark
|
|
|
|
The repository includes a script in the [Examples/Benchmark](https://forge.mql5.io/nique_372/ICTLibraryEasy/src/branch/main/Examples/Benchmark) folder that compares library performance against 7 implementations from other authors and AI models (Claude Opus 4.7, Gpt, etc..).
|
|
|
|
<div style="display: grid; justify-content: center;">
|
|
<img src="./Images/result.png" alt="Performance comparison chart" width="1055">
|
|
</div>
|
|
|
|
### Results Table
|
|
|
|
| Implementation | Duration (ms) | Memory (MB) |
|
|
|---|---|---|
|
|
| rpanchyk | 992,574 | 2 |
|
|
| Hieu Hoang | 1,078 | 1 |
|
|
| R. Kumar Nait | 9,844 | 1 |
|
|
| ICTLibraryEasy | 141 | 1 |
|
|
| Claude Sonnet 4.5 | 172 | 1 |
|
|
| Chat GPT | 1,109 | 1 |
|
|
| Claude Opus 4.7 | 921 | 1 |
|
|
| MQL5 Article (EN) 22264 (autor=Amanda) | 375 | 1 |
|
|
|
|
**Notes**
|
|
- 6 months on XAUUSD M5 with OHLCM1 data from FTMO-Demo
|
|
- Performance comparison of FVG implementations across different sources and the ICTLibraryEasy
|
|
|
|
---
|
|
|
|
## Requirements
|
|
See the [dependencies.json](./dependencies.json) file.
|
|
|
|
|
|
---
|
|
|
|
## Installation
|
|
- Clone the git repository into shared projects via cmd.
|
|
- Contact me privately on MQL5 chats (user: nique_372) to be added as a collaborator with your MQL5 nickname (read-only access), which will make the repository automatically appear in your Shared Projects folder.
|
|
- Fork the repository.
|
|
|
|
---
|
|
|
|
## Disclaimer
|
|
|
|
**Trading involves substantial risk of loss.**
|
|
|
|
- This software is a technical tool, not financial advice
|
|
- Past performance does not guarantee future results
|
|
- You are solely responsible for your trading decisions
|
|
- Always test thoroughly before deploying with real capital
|
|
- Apply appropriate risk management at all times
|
|
|
|
The authors assume no liability for trading losses, system failures, or any damages arising from the use of this software.
|
|
|
|
---
|
|
|
|
## License
|
|
|
|
This repository uses a **dual licensing system**:
|
|
|
|
### ICT Easy Library `/Src/` + `ICTEasyLibrary.ex5`
|
|
- **License:** Apache 2.0 Modified
|
|
- **Commercial use:** Allowed in your bots
|
|
- **Selling library:** Prohibited
|
|
- **Details:** [LICENSE](./LICENSE.md)
|
|
|
|
> Only `/Src/` code can be modified. The compiled library (`ICTEasyLibrary.ex5`) cannot be reverse-engineered.
|
|
|
|
### Examples `/Examples/`
|
|
- **License:** Proprietary - Educational Use Only
|
|
- **Commercial use:** Prohibited to sell or derivatives
|
|
- **Learning:** Study and learn freely
|
|
- **Details:** [LICENSE-EXAMPLES](./LICENSE-EXAMPLES)
|
|
|
|
|
|
---
|
|
|
|
## Full Version — ICT FastLibrary
|
|
|
|
This repository includes **6 concepts** as a free preview.
|
|
|
|
The full **ICT FastLibrary** includes **30+ concepts**:
|
|
|
|
| Category | Concepts |
|
|
|---|---|
|
|
| Imbalances | FVG, Gap, Imbalance, RDRB + inverse versions |
|
|
| Blocks | BPR, Order Blocks, Breaker Blocks |
|
|
| Market Structure | BOS/CHoCH, CISD, MSS |
|
|
| Extra | Liquidity, SMT Divergence, DoubleTopBottom, BSL/SSL |
|
|
| Sessions | SessionContainer, SessionContainerMit |
|
|
| Custom | Build your own blocks + inverse versions |
|
|
| Pool | Full factory — reuse concepts, minimize memory |
|
|
|
|
> **[Get ICT FastLibrary on TheBotPlace](https://thebotplace.com/bot/ict-fastlibrary)**
|
|
|
|
|
|
---
|
|
|
|
## Contact
|
|
|
|
- **Platform:** [MQL5 Community](https://www.mql5.com/es/users/nique_372)
|
|
- **Profile:** https://www.mql5.com/es/users/nique_372/news
|
|
|
|
---
|
|
|
|
<p align="center">Copyright © 2026 Nique-Leo.</p>
|