65 lines
2.5 KiB
MQL5
65 lines
2.5 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| 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 <ICTLibraryEasy\\Main.mqh>
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
CBarControler bar_controlerd1(PERIOD_D1, _Symbol);
|
|
CBarControler bar_controler_curr(_Period, _Symbol);
|
|
CFvgBar fvg;
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Expert initialization function |
|
|
//+------------------------------------------------------------------+
|
|
int OnInit()
|
|
{
|
|
//--- indicator buffers mapping
|
|
const int atr_pos_hanlde = ICTAtr_Create(PERIOD_CURRENT, _Symbol, 14, true);
|
|
CAtr* atr_ptr = ICTAtr_GetAtrPointer(atr_pos_hanlde);
|
|
|
|
//---
|
|
fvg.Create(_Symbol, _Period);
|
|
fvg.SetGrapich(clrGreen, clrRed, clrGreen, clrRed, STYLE_SOLID, true, 1, true, 10, 1, STYLE_DOT); //Configuramos los objetos graficos
|
|
fvg.Set(500, defined_pattern, fvg_1_vela, CreateDiffInstance(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();
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| Expert tick function |
|
|
//+------------------------------------------------------------------+
|
|
void OnTick()
|
|
{
|
|
//---
|
|
const datetime curr_time = TimeCurrent();
|
|
const bool new_day = bar_controlerd1.IsNewBar(curr_time);
|
|
|
|
//---
|
|
if(bar_controler_curr.IsNewBar(curr_time))
|
|
{
|
|
ICTGen_FuncionOnBar(new_day, curr_time); //Primero siempre ejecutar FUncionOnBar
|
|
fvg.OnNewBar(); //Ejecutamos OnNewBar
|
|
ICTGen_FuncionOnEndBar(); //Finlizar con OnNewBar
|
|
}
|
|
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//---
|