2025-12-05 12:17:19 -05:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| BosChoch.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);
|
|
|
|
|
CBosChoch bos_choch;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Expert initialization function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
int OnInit()
|
|
|
|
|
{
|
2025-12-10 17:38:17 -05:00
|
|
|
//--- Creacion del bos choch
|
2025-12-05 12:17:19 -05:00
|
|
|
bos_choch.Create(_Symbol, _Period);
|
|
|
|
|
bos_choch.SetGrapich(clrBlue, clrBlue, clrRed, clrRed, STYLE_DOT);
|
2025-12-10 17:38:17 -05:00
|
|
|
bos_choch.Init(4, clrBlue, clrRed, "Arial", 7, true, 30, MODE_SWING_NO_STRICT, false, 500);
|
2025-12-05 12:17:19 -05:00
|
|
|
|
2025-12-10 17:38:17 -05:00
|
|
|
//---Test para obtener el swing usado y modificarlo (CUIDADO)
|
|
|
|
|
bos_choch.InitSwingPointer(); // Inciilizamos puntero interno
|
|
|
|
|
CSwingBarDefault swing; // Default
|
|
|
|
|
swing.CreateByHandle(bos_choch.HandleSwing()); // Creacion
|
|
|
|
|
Print("Tipo de swing usado: ", EnumToString(swing.TypeSwing())); // Tipo de swing usado
|
|
|
|
|
#define BoolToStr(b) (b ? "true" : "false")
|
|
|
|
|
PrintFormat("Swing length = %d | Swing state = %s", swing.LenthAntes(), BoolToStr(swing.InitialStateObj())); // 4 - false
|
|
|
|
|
|
|
|
|
|
// Cambaimso el clor de los swings (high)
|
|
|
|
|
swing.SwingHighColor(clrAliceBlue);
|
|
|
|
|
|
2025-12-05 12:17:19 -05:00
|
|
|
//---
|
|
|
|
|
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
|
2025-12-10 17:38:17 -05:00
|
|
|
bos_choch.OnNewBar();
|
2025-12-05 12:17:19 -05:00
|
|
|
ICTGen_FuncionOnEndBar(); //Finlizar con OnEndBar
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//+------------------------------------------------------------------+
|