| //+------------------------------------------------------------------+
|
| //| BslSsl.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"
|
|
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| int8_t idx_controler_d1 = INVALID_INDEX;
|
| CBSLSSL bsl_ssl;
|
|
|
| //+------------------------------------------------------------------+
|
| //| Expert initialization function |
|
| //+------------------------------------------------------------------+
|
| int OnInit()
|
| {
|
| //--- Inicialización general obligatoria
|
| g_new_bar_manager.GetPosExecute(PERIOD_D1, idx_controler_d1);
|
|
|
| //--- Crear el concepto
|
| if(!bsl_ssl.Create(_Symbol, _Period, 0, 0, true))
|
| {
|
| Print("ERROR al crear BSL/SSL");
|
| return INIT_FAILED;
|
| }
|
|
|
| //--- Configuración gráfica
|
| bsl_ssl.SetGrapich(
|
| clrBlue, // Texto BSL
|
| clrDodgerBlue, // Línea BSL
|
| clrRed, // Texto SSL
|
| clrTomato, // Línea SSL
|
| STYLE_SOLID, // Estilo líneas
|
| 2 // Grosor
|
| );
|
|
|
| //--- Configuración adicional opcional
|
| bsl_ssl.SetStart(0, 50); // Rango de velas
|
| bsl_ssl.ExtensionMinutes(30); // Extensión solo visual
|
| bsl_ssl.Initialize(); // Crear líneas
|
|
|
| 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);
|
| bsl_ssl.OnNewBar();
|
| }
|
| }
|
| //+------------------------------------------------------------------+
|