Yes, this is possible
MQL4 language, incl the "New"-MQL4 ( aka MQL4.5 ), has syntactical support for importing DLL-based services, that allow re-integration of tools, the closed-syntax of the MQL4 does not allow to gain in a more natural way.
//+------------------------------------------------------------------+ // msMOD(s) 2014 >>> [dev]_test_(python)_.PUB__(mql).SUB_with_KBD_and_SIG___StatefullGrammarFSA
//| Ver 4.00, Build 509 [dev]__********.mq4 | // msMOD(s) 2013
//+------------------------------------------------------------------+ //
#property copyright "[dev] msMOD(s) (c) 1987-2014" //
// ---------------------------------------------------------------------<#import>.start
#import "msLIB_services.ex4"
void msLIB.aSnapshot.MAKE();
#import
// ---------------------------------------------------------------------<#import>.end
// ZMQ LIBRARY |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <mql4zmq.mqh> // Include the libzmq.dll abstraction wrapper
// |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This way your code, be it MQL4-Script
or MQL4-ExpertAdvisor
can communicate with external processes, incl. any reasonably working DBMS.
Beware
There are few important features a code-design and integration architecture should bear in mind. MQL4, since the earliest days, is not a plain sequential-processor, namely the MQL-CustomIndicator
is by far distant from this paradigm. The code ( except for the case of MQL4-Script
) acts as an event-driven factory, that is initiated by asynchronous flow of incoming Market Events. User is responsible for all measures to not violate real-time stability of this Alpha&Omega principle-of-MQL4-principles. In other words, a poor design, that may get some I/O-blocking ( due to RDBMS processing et al ), will be most probably a reason for Trading Terminal crash(es), which is the last thing anybody is willing to experience ( be it in live-trading or back-testing phase ), isn't it?
So, a sound non-blocking, heterogenous, parallel multi-processing integration architecture & code-design is to be used for this task.
It works great, if done professionally
Keeping the said in mind allows very smart, fast and (almost) unlimited architectures to work together with Trading Terminal(s). Having multiple cases with near-real-time messaging between MT4/MQL4 code and AI/ML engine via python, fast FIX-Protocol streaming engine for real-time data input from Liquidity Pool provider, using a remote NVIDIA/GPU computation fabric, remote co-integrated IRC/skype/email Signal provisioning channels.
So a can do philosophy is in place. SQL is nothing extra in this sense. Puting labels is trivial in the same sense. Just of your imagination, MQL4 allows to build ( again, using a near-real-time design ) responsive/interactive GUI-layer, that allows, within a few [msec] stability barrier, work with the Trading Terminal in a pure-graphical manner ( long ago before a One-Click-Trading marketing tag came with just a click-To-Buy / click-To-Sell ) working fully interactively with line-controlled / graphical-objects visual trading aids, be it for a fully automated trade-execution ( with an indirect GUI-configuration of the rules-set ), or for an Augmented Trading style.

Yes, can make your MT4 Trading Terminal a sort of "remote-programmable charting display", driven not by FX-Market, but from a Cloud-processor, where your remote Strategy Testing Engine rulez ...
