Dear Forum users!
I am glad to announce that EarnForex.com Forum now fully supports MQL4 and MQL5 highlighting. If you insert a peace of code, be it indicator, expert advisor, script or something else, written in MQL4 or MQL5, you can now highlight with a simple highlight tag.
For MQL4:
[code=mql4][/code]
For MQL5:
[code=mql5][/code]
Or simply use the Insert Code option from the toolbar:

And then select the right language - MQL4, for example:

Our forum is currently the only forum supporting full MQL4/MQL5 highlighting. It closely resembles the highlighting seen in MQL Editor. Even official MetaQuotes forums can't beat us here: MQL4.com's highlighting is a joke, MQL5.com's is good but lacks some features. So, if you need to discuss MQL code, EarnForex.com Forum is your choice. If you want to discuss pink unicorns - choose other forums.
Now, it's recommended to use highlighting when you write your posts. After all, something like this:
Looks much better when it is highlighted:
If you find any bugs or glitches in the MQL highlighting system or would like to suggest some other features, please post your reply here.
I am glad to announce that EarnForex.com Forum now fully supports MQL4 and MQL5 highlighting. If you insert a peace of code, be it indicator, expert advisor, script or something else, written in MQL4 or MQL5, you can now highlight with a simple highlight tag.
For MQL4:
[code=mql4][/code]
For MQL5:
[code=mql5][/code]
Or simply use the Insert Code option from the toolbar:
And then select the right language - MQL4, for example:

Our forum is currently the only forum supporting full MQL4/MQL5 highlighting. It closely resembles the highlighting seen in MQL Editor. Even official MetaQuotes forums can't beat us here: MQL4.com's highlighting is a joke, MQL5.com's is good but lacks some features. So, if you need to discuss MQL code, EarnForex.com Forum is your choice. If you want to discuss pink unicorns - choose other forums.
Now, it's recommended to use highlighting when you write your posts. After all, something like this:
Code:
#property copyright "EarnForex.com"
#property link "http://www.earnforex.com"
#property version "1.00"
#property description "Displays the Market Profile indicator for the daily trading sessions."
#property indicator_chart_window
input datetime StartFromDate = D'';
input bool StartFromToday = true;
input int DaysToCount = 2; // Number of days for which to count the Market Profile
input int ColorScheme = 0; // 0 - Blue to Red, 1 - Red to Green, 2 - Green to Blue
input color MedianColor = clrWhite;
input color ValueAreaColor = clrWhite;
int DigitsM; // Amount of digits normalized for standard 4 and 2 digits after dot
datetime StartDate; // Will hold either StartFromDate or Time[0]
double onetick; // One normalized pip
int SecondsInPeriod; // Will hold calculated amount of seconds in the selected timeframe period
bool FirstRunDone = false; // If true - OnCalculate() was already executed once
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void OnInit()
{
IndicatorSetString(INDICATOR_SHORTNAME, "MarketProfile");
// Normalizing the digits to standard 4- and 2-digit quotes
if (_Digits == 5) DigitsM = 4;
else if (_Digits == 3) DigitsM = 2;
else DigitsM = _Digits;
if (_Period == PERIOD_M30) SecondsInPeriod = 1800;
if (_Period == PERIOD_M15) SecondsInPeriod = 900;
if (_Period == PERIOD_M5) SecondsInPeriod = 300;
onetick = NormalizeDouble(1 / (MathPow(10, DigitsM)), DigitsM);
}
Looks much better when it is highlighted:
MQL5:
#property copyright "EarnForex.com" #property link "http://www.earnforex.com" #property version "1.00" #property description "Displays the Market Profile indicator for the daily trading sessions." #property indicator_chart_window input datetime StartFromDate = D''; input bool StartFromToday = true; input int DaysToCount = 2; // Number of days for which to count the Market Profile input int ColorScheme = 0; // 0 - Blue to Red, 1 - Red to Green, 2 - Green to Blue input color MedianColor = clrWhite; input color ValueAreaColor = clrWhite; int DigitsM; // Amount of digits normalized for standard 4 and 2 digits after dot datetime StartDate; // Will hold either StartFromDate or Time[0] double onetick; // One normalized pip int SecondsInPeriod; // Will hold calculated amount of seconds in the selected timeframe period bool FirstRunDone = false; // If true - OnCalculate() was already executed once //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { IndicatorSetString(INDICATOR_SHORTNAME, "MarketProfile"); // Normalizing the digits to standard 4- and 2-digit quotes if (_Digits == 5) DigitsM = 4; else if (_Digits == 3) DigitsM = 2; else DigitsM = _Digits; if (_Period == PERIOD_M30) SecondsInPeriod = 1800; if (_Period == PERIOD_M15) SecondsInPeriod = 900; if (_Period == PERIOD_M5) SecondsInPeriod = 300; onetick = NormalizeDouble(1 / (MathPow(10, DigitsM)), DigitsM); }
If you find any bugs or glitches in the MQL highlighting system or would like to suggest some other features, please post your reply here.
Last edited: