This project is read-only.


TradePlatform.NET provides communication bridge between MQL and .NET worlds. It can be used to extend MQL with rich functionality of .NET Framework as well to develop Experts, Scripts and Indicators with .NET from the ground. MT4 SDK as part of TradePlatform.NET provides base classes for your custom implementations and API for common MQL functions. For development can be used any .NET programming language like C#, VB.NET, F#, Managed C++. .NET Bridge as another part of TradePlatform.NET acts like communication tire between MQL Expert and .NET ExpertAdvisor developed with MT4 SDK. Single instance of .NET Bridge can handle many MQL Experts from many terminals, also you can build clustered handler with .NET Shells or host .NET Bridge in your custom application and control isolation level of shared usage of .NET ExpertAdvisor in thread safe mode. Also you can get access to any from connected terminals from your custom .NET application.

For developers

For MQL programmers TradePlatform.NET presents new opportunities for developing custom indicators or expert advisors. Powerful IDE Visual Studio, Debugging and C# syntax will introduce more productive development way in complex scenarios. Wide feature range of .NET stack can bring brand new ways to automated trading systems.

For .NET programmers TradePlatform.NET gives a framework to develop trading systems or market indicators for MetaTrader without deep MQL knowledge. TradePlatform.NET can be considers good integration point with other applications

Under Source Code section you can find a lot of examples.

How it works

For communication with MetaTrader on .NET side responsible .NET Bridge (TradePlatform.MT4.Core.Bridge class). It can handle simultaneously several Hosts (configured by BrideConfiguration section). Host acts like TCP servers. For each host should be configured list of available handler which are end implementations of Script, Indicators or Experts. .NET Bridge can hosted in any type of .NET application. As default host application for .NET Bridge developed .NET Shell which is console application.MQL Expert on MetaTrader's side has an including which is TCP client. Client calls server with configured address and application's meta-information when NET API function is called. .NET Bridge listening for client call and once received, transfers it to ,NET ExpertAdvisor instance according to meta-information and isolation level settings. Only one thread simultaneously allowed in .NET ExpertAdvisor. During one .NET ExpertAdvisor's method call, multiply MQL functions can be called before NET API function will be returned.

Image below demonstrates communication life cycle.

Additional Components

There are several additional .NET components included in TradePlatform.NET. Predefined templates and dedicated providers makes easier integration of .NET ExpertAdvisors with such technologies like Entity Framework, Windows Communication Foundation, Managed Extendability Framework and other .NET world technologies.

Development strategies

Custom developer can program with TradePlatform.NET in two different ways:
  • Isolated Experts, Scripts or Indicators in very similar pattern as MQL scripts designed in MetaTrader
  • Integrate communication with MetaTrader in a custom application as regular .NET library.
These two approached can be used together as well in complex implementations. Isolated .NET ExpertAdvisor has only thread flow isolation. As being fully functional managed executable and kept in same application pool it can share static members an use all .NET framework power.


MT4 SDK allows you extend its functionality by creating API for your custom functions on both MQL and .NET sides. It also gives higher than ExpertAdvisor level of abstraction for customized communication scenarios. See Advanced development page for details.

Usage Scenarios

TradePlatform.NET not only meant like a way to program for MetaTrader in C#. Considering .NET platform features TradePlatform.NET gives good integration point with third party services and components and makes possible completely new trading scenarios.

Last edited Oct 28, 2012 at 11:25 AM by vladkalos, version 9


macaulayahmed Mar 7, 2013 at 7:33 PM