ICTLibraryExamples/Base/MarketStruct/Trend/Mss.mq5
Nique_372 Nique_372 dc4dbf8a3f
2026-02-01 13:11:51 -05:00
76 lines
3.1 KiB
MQL5
//+------------------------------------------------------------------+
//| Mss.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
#define DEFGLOBAL_SIMPLE
#include "..\\..\\..\\DefGlobal.mqh"
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
sinput group ""
sinput group "---| MSS "
input color clr_mss_a = clrBlue; //bullish mss color
input color clr_mss_b = clrRed; //bearish mss color
input int16_t lenth_mss = 16; //swing collection period. this to identify liquidity zones
input int inp_max_espera_manipulacion_mss = 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_mss = 30; //Maxima waits in candles
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int8_t idx_controler_d1 = INVALID_INDEX;
CMss mss;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
g_new_bar_manager.GetPosExecute(PERIOD_D1, idx_controler_d1);
//--- indicator buffers mapping
mss.Create(_Symbol, _Period);
mss.SetGraphic(clr_mss_a, clr_mss_b, 1, STYLE_SOLID, 7);
mss.SetGen(inp_max_espera_manipulacion_mss, inp_max_espera_roptura_mss, ZIGZAG, lenth_mss);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
ICTGen_OnDeinitEvent(reason);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
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);
mss.OnNewBar();
}
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+