MT4Logger Documentation
This tool is a DLL library that can be used from any trading development application, such as MetaTrader and TradeStation.
Description
As you know, MetaTrader4 has limited debugging capabilities. For complex system product development, it's simply one of the best debugging tools on the market. Currently, MetaTrader4 doesn’t support stop placements or line-by-line viewing. The only way to perform a debug is to display variables onscreen or to use the Print() and Alert() functions. However, since Alert blocks ticks, it can’t debug. Print can debug, but its output is inside the Terminal window (along with the outputs of every other process). To solve these issues, we developed an easier way with MetaTrader4 to debug Expert Advisors, Indicators, and scripts. MT4Logger is an effective tool that can simplify the entire process.
Features
- Compatible with TradeStation, MetaTrader4, MetaTrader5, NinjaTrader, and many others
- Written in C++
- Free of charge FOREVER
- Customizable colors and fonts
- Multithread safe
- Can be used from different sources simultaneously
- Output channels included (to ensure optimal overview)
- Save registry settings for easy restoration
- “Always on Top” function
- Colored output
- Ability to hide channels
- Automatic time stamping
- Automatic scrolling
- Programmatically clear output
Compatibility
- MetaTrader4 supports all builds (including new releases)
- Tested with TradeStation 8.x/9.x, and will be compatible with all upcoming versions
- Old and new versions are compatible with any language (requires the ability to install DLL files for your platform).
Licence
MT4Logger is freeware, so users can embed it anywhere. NO CHARGE.
Installation & Demofiles
Installation may vary by application. DLL files must be placed in an application’s DLL include path or the Windows’ DLL include path; for example, the 64-bit shared library include path is %windir%\SysWOW64. In MetaTrader4 (builds 0600 and below), the library path is %MetaTrader4%\experts\libraries. In TradeStation, the include path is %TSPATH%\Program\.
You may need to enable DLL execution because it's sometimes disabled by default (for security reasons). This tool was released as a DLL, so you’ll need to enable DLL Execution.
Screenshoots
Functions
int loggerInit(str Channel,int BackgroundColor, int TextColor)
This function initializes the logger and returns a handle. At same time, you can define the Channel Tab’s back- and foreground color. The channel parameter requires a string to manage the channel. A channel is the name of a tab inside the logger window
int loggerClose(int Handle)
This function closes the handle. Use the inside deinit() function of MetaTrader4 to perform a cleanup. It’s recommended not to forget this function.
int loggerClear(int Handle)
Use this function to clear the content of channels being handled (similar to the "Clear" button in LOGGER)
int loggerAdd(int Handle,string content,int TextColor)
Here we can connect to the content. In defined colors, this function adds a line to LOGGER. If enabled, added lines will auto scroll with timestamps that follow the computer’s local time.
int loggerShow(int Handle,int show)
Using this function shows and hides the logger window. Setting the variable to 0 hides; setting to 1 shows.
Demonstration
Metatrader Demo #1
Metatrader Demo #2
Downloads
| Version | Description | Download |
|---|---|---|
| 1.0.7 |
|
Download v107 (Metatrader Build > 520 supported) |
| 1.0.1 |
|
Download v101 (Metatrader Build < 520 supported) |
