2026-01-14 07:05:58 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| Fvg.mq5 |
|
| | | //| Copyright 2025, Leo. |
|
| | | //| https://www.mql5.com/es/users/nique_372/news |
|
| | | //+------------------------------------------------------------------+
|
| | | #property copyright "Copyright 2025, Leo."
|
| | | #property link "https://www.mql5.com/es/users/nique_372/news"
|
| | | #property version "1.00"
|
| | | #property strict
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | #include "..\\Utils\\MetricSaver.mqh"
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | #include "..\\..\\DefGlobal.mqh"
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | int8_t idx_controler_d1 = INVALID_INDEX;
|
| | | int8_t idx_controler_curr = INVALID_INDEX;
|
| | | CFvgBar fvg;
|
2026-02-01 13:11:51 -05:00 | | | // Mencionasr que aqui NO uso CBasicEvents, NI account status DADO que no LOS NECESITO
|
| | | // Este ea solo ejeucta fvg no gestion de posicon riskmananget o clases herederas de CAccoutnGestor o CAllBasicEvents
|
2026-01-14 07:05:58 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Expert initialization function |
|
| | | //+------------------------------------------------------------------+
|
| | | int OnInit()
|
| | | {
|
| | | //---
|
| | | CMetricsSave::Start(FILE_LIB);
|
| | |
|
| | | //---
|
| | | g_new_bar_manager.GetPosExecute(PERIOD_D1, idx_controler_d1);
|
| | | g_new_bar_manager.GetPosExecute(_Period, idx_controler_curr);
|
| | |
|
| | | //--- indicator buffers mapping
|
2026-03-23 12:25:01 -05:00 | | | //const int atr_pos_hanlde = ICTAtr_Create(PERIOD_CURRENT, _Symbol, 14, true);
|
| | | //CAtr* atr_ptr = ICTAtr_GetAtrPointer(atr_pos_hanlde);
|
2026-01-14 07:05:58 -05:00 | | |
|
| | | //---
|
| | | fvg.Create(_Symbol, _Period);
|
| | | fvg.SetGrapich(clrGreen, clrRed, clrGreen, clrRed, STYLE_SOLID, true, 1, true, 10, 1, STYLE_DOT); //Configuramos los objetos graficos
|
2026-10-25 12:04:40 -05:00 | | | fvg.Set(500, defined_pattern, fvg_1_vela, TSN::CreateDiffptr(TSN::MODE_DIFF_BY_ATR, _Symbol, NULL, 1, 0.00)); //Configuraciones generales
|
2026-01-14 07:05:58 -05:00 | | |
|
| | | //---
|
| | | return(INIT_SUCCEEDED);
|
| | | }
|
| | | //+------------------------------------------------------------------+
|
| | | //| Expert deinitialization function |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnDeinit(const int reason)
|
| | | {
|
| | | //---
|
2026-02-01 13:11:51 -05:00 | | | ICTGen_OnDeinitEvent(reason);
|
2026-01-14 07:05:58 -05:00 | | | CMetricsSave::Destroy();
|
| | | }
|
| | | //+------------------------------------------------------------------+
|
| | | //| Expert tick function |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnTick()
|
| | | {
|
| | | //---
|
| | | const datetime curr_time = TimeCurrent();
|
| | | g_new_bar_manager.Execute(curr_time);
|
| | |
|
| | | //---
|
| | | if(CNewBarManager_IsNewBarM1(g_new_bar_manager) && CNewBarManager_IsNewBar(g_new_bar_manager, idx_controler_curr))
|
| | | {
|
| | | const bool new_day = CNewBarManager_IsNewBar(g_new_bar_manager, idx_controler_d1);
|
| | | ICTGen_FuncionOnBarM1(new_day, curr_time);
|
| | | fvg.OnNewBar();
|
| | | }
|
| | | }
|
| | | //+------------------------------------------------------------------+
|