ICTLibraryExamples/Base/MarketStruct/Trend/Cisd.mq5
76 lines
3.2 KiB
MQL5
Nique_372
2025-12-09 13:38:58 -05:00
//+------------------------------------------------------------------+
//| Cisd.mq5 |
//| Copyright 2025, Niquel Mendoza. |
//| https://www.mql5.com/es/users/nique_372/news |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, Niquel Mendoza."
#property link "https://www.mql5.com/es/users/nique_372/news"
#property version "1.00"
#property strict
Nique_372
2026-02-01 13:11:51 -05:00
#define DEFGLOBAL_SIMPLE
Nique_372
2026-01-06 06:46:34 -05:00
#include "..\\..\\..\\DefGlobal.mqh"
Nique_372
2025-12-09 13:38:58 -05:00
Nique_372
2026-02-01 13:11:51 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
Nique_372
2025-12-09 13:38:58 -05:00
sinput group ""
sinput group "---| CISD "
input color clr_cisd_a = clrBlue; //bullish cisd color
input color clr_cisd_b = clrRed; //bearish cisd color
input int16_t lenth_cisd = 16; //swing collection period. this to identify liquidity zones
input int num_canlde_find_cisd = 10; //number of candles to find the beginning of the cisd impulse (in candles)
input int inp_max_espera_manipulacion_cisd = 60;//maximum wait for taking liquidity from a swing (in candles)
input string coment3 = "Once the liquidity is taken, choose the maximum wait for the break of the beginning of the impulse that the liquidity takes: "; //-->
input int inp_max_espera_roptura_cisd = 30; //Maxima waits in candles
Nique_372
2026-02-01 13:11:51 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int8_t idx_controler_d1 = INVALID_INDEX;
CCisd cisd;
Nique_372
2025-12-09 13:38:58 -05:00
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
Nique_372
2026-01-06 06:46:34 -05:00
g_new_bar_manager.GetPosExecute(PERIOD_D1, idx_controler_d1);
Nique_372
2025-12-09 13:38:58 -05:00
//--- indicator buffers mapping
cisd.Create(_Symbol, _Period);
cisd.SetGraphic(clr_cisd_a, clr_cisd_b, 1, STYLE_SOLID, 7);
cisd.SetGen(inp_max_espera_manipulacion_cisd, inp_max_espera_roptura_cisd, num_canlde_find_cisd, ZIGZAG, lenth_cisd);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
Nique_372
2026-02-01 13:11:51 -05:00
ICTGen_OnDeinitEvent(reason);
Nique_372
2025-12-09 13:38:58 -05:00
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
const datetime curr_time = TimeCurrent();
Nique_372
2026-01-06 06:46:34 -05:00
g_new_bar_manager.Execute(curr_time);
Nique_372
2025-12-09 13:38:58 -05:00
//---
Nique_372
2026-01-06 06:46:34 -05:00
if(CNewBarManager_IsNewBarM1(g_new_bar_manager))
Nique_372
2025-12-09 13:38:58 -05:00
{
Nique_372
2026-01-06 06:46:34 -05:00
const bool new_day = CNewBarManager_IsNewBar(g_new_bar_manager, idx_controler_d1);
ICTGen_FuncionOnBarM1(new_day, curr_time);
Nique_372
2025-12-09 13:38:58 -05:00
cisd.OnNewBar();
}
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+