und werden Sie Mitglied unserer Fangruppe
Veröffentliche einen Link auf das Skript, damit die anderen ihn auch nutzen können
Bewerten Sie es im Terminal MetaTrader 5
- Ansichten:
- 8341
- Rating:
- Veröffentlicht:
- 2017.06.19 14:07
-
Benötigen Sie einen Roboter oder Indikator, der auf diesem Code basiert? Bestellen Sie ihn im Freelance-Bereich Zum Freelance
FileLog is a simple MQL4 class for flexible logging to files and the terminal console.
Github Repository: https://github.com/RGunning/MQL4Logger
Log File will be saved in:
- <Data folder>\MQL4\Files\
- <Data folder>\tester\files\
Usage
CFileLog* logger = new CFileLog("example.log",WARNING,true); logger.Error(StringFormat("%s %d %s",__FILE__, __LINE__, "Something unexpected happen")); logger.Info(StringFormat("%s %d %s",__FILE__, __LINE__, "Calculation Done)); logger.debug(StringFormat("%s %d The result of %s is %d",__FILE__, __LINE__,string1, value1));
Don't forget at the end of your EA/Indicator/Script:
Delete logger;
Log levels:
- TRACE
- DEBUG
- INFO
- WARNING
- ERROR
- CRITICAL
Log functions:
- Trace()
- Debug()
- Info()
- Warning()
- Error()
- Critical()
Example
A working example of the logger in action can be seen in FileLogExample.mq4.
Console:
File:
![Market Watch Cleaner](https://c.mql5.com/i/code/script.png)
This script removes all instruments with spread higher than the specified maximum requested and it also removes all non-trade enabled instruments from Market Watch, which allows you to concentrate on items you may want to trade without all the clutter.
![Automatically bring charts one by one to the top](https://c.mql5.com/i/code/indicator.png)
This indicator helps to move charts one by one to the the front, just like slide show,and make your hands free.
![Multi Timeframe Bollinger Bands](https://c.mql5.com/i/code/indicator.png)
This is a multi timeframe indicator for Bollinger Bands. With it you can plot the Bollinger Bands of the higher timeframes without changing the current chart. This allows you to more clearly understand the price context by seeing the levels of the other timeframes on the same chart.
![Tipu EA](https://c.mql5.com/i/code/expert.png)
A simple EA based on Tipu Trend indicator and Tipu Stops indicator.