ICTLibraryExamples/Base/Bloques/Imbalance/Rdrb.mq5
Nique_372 Nique_372 149e87cc82
2026-10-23 21:51:38 -05:00
66 lines
2.6 KiB
MQL5
//+------------------------------------------------------------------+
//| Rdrb.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
#include "..\\..\\..\\DefGlobal.mqh"
#define DEFGLOBAL_SIMPLE
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int8_t idx_controler_d1 = INVALID_INDEX;
CRdrbBar rdrb;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
g_new_bar_manager.GetPosExecute(PERIOD_D1, idx_controler_d1);
//--- indicator buffers mapping
const int atr_pos_hanlde = ICTAtr_Create(PERIOD_CURRENT, _Symbol, 14, true);
TSN::CAtr* atr_ptr = ICTAtr_GetAtrPointer(atr_pos_hanlde);
//---
rdrb.Create(_Symbol, _Period);
rdrb.SetGrapich(clrGreen, clrRed, clrGreen, clrRed, STYLE_SOLID, true, 1, true, 10, 1, STYLE_DOT); //Configuramos los objetos graficos
rdrb.Set(500, defined_pattern, fvg_se_actuliza, TSN::CreateDiffptr(TSN::MODE_DIFF_BY_ATR, _Symbol, atr_ptr, 1, 0.00)); //Configuraciones generales
//---
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);
rdrb.OnNewBar(); //Ejecutamos OnNewBar
}
}
//+------------------------------------------------------------------+
//---