Menu
Brokers
MT4 Forex Brokers
MT5 Forex brokers
PayPal Brokers
Skrill Brokers
Oil Trading Brokers
Gold Trading Brokers
Web Browser Platform
Brokers with CFD Trading
ECN Brokers
Bitcoin FX Brokers
PAMM Forex Brokers
With Cent Accounts
With High Leverage
Cryptocurrency Brokers
Forums
All threads
New threads
New posts
Trending
Search forums
What's new
New threads
New posts
Latest activity
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Reply to thread
Forums
Service Forums
Announcements
Highliting MQL4 and MQL5 Code
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
[QUOTE="Enivid, post: 22453, member: 1"] 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: [plain][code=mql4][/code][/plain] For MQL5: [plain][code=mql5][/code][/plain] Or simply use the Insert Code option from the toolbar: [ATTACH type="full" alt="insert-code.png"]14882[/ATTACH] And then select the right language - MQL4, for example: [ATTACH type="full" alt="mql4-code.png"]14883[/ATTACH] 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: [URL='http://forum.mql4.com/']MQL4.com[/URL]'s highlighting is a joke, [URL='http://www.mql5.com/en/forum']MQL5.com[/URL]'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); } [/code] Looks much better when it is highlighted: [code=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); } [/code] 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. [/QUOTE]
Insert quotes…
Verification
Post reply
Top
Bottom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…