0

I would like to know if there is a way to run a MetaTrader 4 script from outside MetaTrader.

I think it could be an option like terminal.exe /run myScript.ex4

I need to run it every N seconds from VBA Excel code. No problem about running a piece of code each N amount of seconds. The problem I have is how can I run a script using Windows' command?

Richard Steele
  • 95
  • 1
  • 10

1 Answers1

0

This is not a way it could ever work IMHO ( after decades in this domain ... )

Launching a process in O/S is the easy part, passing a few parameters onto the process is also easy, yet the newly process ( The MetaTrader Terminal in this case ) has many configuration options and can have many GUI-Graph instances setup ( USDJPY + GBPJPY + AUDUSD + GBPUSD + EURUSD + ... ) and the intention to launch a script must also know, onto which GUI-Graph instance such a script-execution ought start.

Not easy, indeed.

A few years ago, there were attempts to mix some configurations via an "auto-loader"-tape alike setup in profile + to inject some pre-configured HotKey "button-press" into a single-GUI-Graph MT4 process.

Definitely a lot of work to have it replicated at scale and the more keep it working safely, indeed.


There might be a much smarter option

try to re-factor your processing architecture and try to implement a semi-persistent distributed infrastructure ( your-process + MT4-process + script-process + ... ) where intelligent multi-agent communication asks online for a remote service or a context-specific response delivery and the whole problem starts to work in much different dynamics...

Having decided to go this way a few years ago, I can compare the costs and benefits -- having the MT4-side integrated into a smart-grid with a failure-resilient-robust "remote"-logging, with external AI/ML-prediction engine, with remote Risk-Management engine.

Having designed the smart-grid service infrastructure so as to having met a design-goal of keeping the End-to-End latency < 90 ms ( well indeed under your requirement of start-next-run-each-N-seconds )

Excel-based trading tools were common piece of art in 1st half of 1990-ies, where REUTERS inter-banking trading services were using Excel-mediated tools.

It is 2018+ :o)

user3666197
  • 1
  • 6
  • 50
  • 92