2025-11-28 20:22:05 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| Ea.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 "Main.mqh"
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-01-31 19:44:40 -05:00 | | | CBreakEvenPanel panel;
|
2025-11-28 20:22:05 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Expert initialization function |
|
| | | //+------------------------------------------------------------------+
|
| | | int OnInit()
|
| | | {
|
| | | //--- Atr
|
| | | atr_ultra_optimized.SetVariables(_Period, _Symbol, 0, 14);
|
| | | atr_ultra_optimized.SetInternalPointer();
|
| | |
|
| | | //---
|
| | | const int width = 500;
|
| | | const int height = 390;
|
| | |
|
| | | //---
|
| | | panel.CreateGUI(width, height);
|
| | |
|
| | | //---
|
2026-09-13 08:47:52 -05:00 | | | TSN::account_status.AddLogFlags(InpLogLevelAccountStatus);
|
| | | TSN::account_status.OnInitEvent();
|
2025-11-28 20:22:05 -05:00 | | |
|
2026-01-31 19:44:40 -05:00 | | | //---
|
2026-09-13 08:47:52 -05:00 | | | CAutoCleaner::AddFunction(TSN::CAccountStatus_Deinit);
|
2026-01-31 19:44:40 -05:00 | | | //CAutoCleaner::AddFunction(CBasicEvents::Deinit);
|
| | |
|
2025-11-28 20:22:05 -05:00 | | | //---
|
| | | return(INIT_SUCCEEDED);
|
| | | }
|
| | | //+------------------------------------------------------------------+
|
| | | //| Expert deinitialization function |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnDeinit(const int reason)
|
| | | {
|
| | | //---
|
| | | panel.OnDeinitEvent(reason);
|
2026-01-31 19:44:40 -05:00 | | | CAutoCleaner::Deinit(reason);
|
2025-11-28 20:22:05 -05:00 | | | }
|
| | | //+------------------------------------------------------------------+
|
| | | //| Expert tick function |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnTick()
|
| | | {
|
| | | //---
|
| | | panel.OnTickEvent();
|
| | | }
|
| | | //+------------------------------------------------------------------+
|
| | | //| TradeTransaction function |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnTradeTransaction(const MqlTradeTransaction& trans,
|
| | | const MqlTradeRequest& request,
|
| | | const MqlTradeResult& result)
|
| | | {
|
| | | //---
|
2026-09-13 08:47:52 -05:00 | | | TSN::account_status.OnTradeTransactionEvent(trans);
|
2025-11-28 20:22:05 -05:00 | | | }
|
| | | //+------------------------------------------------------------------+
|
| | | //| ChartEvent function |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnChartEvent(const int id,
|
| | | const long &lparam,
|
| | | const double &dparam,
|
| | | const string &sparam)
|
| | | {
|
| | | //---
|
| | | panel.ChartEvent(id, lparam, dparam, sparam);
|
| | | }
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | void OnTimer()
|
| | | {
|
| | | panel.OnTimerEvent();
|
| | | }
|
| | | //+------------------------------------------------------------------+
|