Currency trading and what is MQL4 for?
Legacy signals
Legacy popularity: 1,987 legacy views
Forex trading have been another alte
ative to trading stock and shares. Because of the volatility and availability of trading 24/6, it is more popular among traders switching over to Forex trading.
There are many platforms available for trading forex and one of the popular one is metatrader4 from metastock. It is a powerful software platform for trade execution, chart indicator trading and expert advisor software. This expert advisor is programming codes written to automate the trading strategy to allow the computer to trade like a human. MQL4 or MetaQuotes Language is the programming language for programming of trading strategy.
MQL4 Program Structure
The programming structure and syntax resemble C language. The programming language has similar data types, operation & expressions, operators, function and variables declaration. It comes with preprocessor and predefined variables, init(), deinit() and start() which run your main program codes. Below are some important function that you will be using in your programming
Date & Time Functions
This is a group of functions that provides trader with access to data of the datetime type. It comes with handy selection of available function for quick access to Day, Month, Year, TimeHour, TimeMinute and others. This is particular usefull if you wan to limit your program to run during certain quite hours or only selected weekdays of every week. You can also program block out date for news release that will major impact the currency price.
Technical Indicator Functions
This is a group of functions used specifically for technical chart trading. MQL comes with really to use indicator for more then 30+ custom indicator. The list includes and not limited to Simple Moving Average, Bollinger Bands, Commodity Channel Index, Moving Average Convergence/Divergence, Relative Strength Index, Stochastic, etc
Trade Functions
This group of functions for executing trade related order and management of trade issues. You can execute trade open and trade close, selection of particular trade, retrieve the order history, change order parameters like stop loss, profit take, etc and also check the order status. The most commonly used are OrderSend(), OrderModify() and Orderclose().
Account Functions
This group of function is for management of account information. This is particular important if you are checking and limiting the account information and performing money management. You can create checking statement for account number, name and company. In additional, you can check account balance, equity, margin and leverage for calculating your lot size.
Common Functions
This group of function contains alert, comment and pop out message box to notify trader user of any issue for the program. I personally use it to alert low account balance to ask user to top up their trading account balance and alert user if they are not using the correct trading current for the Expert advisor, require them to double check.
File Functions
Many programs may not use this as this may not be relevant to their trading strategy but I used it to store some account information, date, time and some trades order information. This is usefully if you want your program to pickup from last running state when encounter program crash, hang or power failure. I personally tested and find this very usefull when you running on VPS or dedicated server where power outage may happen at 0.1% (99.9% uptime) or maintenance time (where your server will be off and restart).
You can find my codes in my Best Forex Ranking Cook Book Zip files for working *.MQL4 files. For more information visit my website bestforexranking dot com.
Source: http://www.bestforexranking.com
Article author
About the Author
I am currently hosting http://www.bestforexranking.com which provides reviews, articles and strategies. Am giving away a free eBook (with 40+ Forex Trading strategies) by signing up to my email newsletter. Go get your free copy today.
Further reading
Further Reading
Article
Nvidia Strategy
Nvidia StrategyrnNvidia Strategy and Nvidia Corporation is an American multinational technology company incorporated in Delaware and based in Santa Clara, California.rnIt is a software and fabless company that designs graphics processing units, application programming interfaces for data science and high-performance computing as well as system on chip units for the mobile computing and automotive market.rnStock Strategy rnNvidia is a dominant supplier of artificial intelligen
June 9, 2024
Article
Understanding the Investment Risk Ladder
Understanding the Investment Risk LadderrnHere are the major asset classes, in ascending order of risk, on the investment risk ladder. CashrnA cash bank deposit is the simplest, most easily understandable investment assetâand the safest. It not only gives investors precise knowledge of the interest that theyâll earn but also guarantees that theyâll get their capital back. On the downside, the interest earned from cash socked away in a savings account seldom beats inflat
October 24, 2023
Article
How Should We Celebrate the Anniversary
How Should We Celebrate the Anniversary of the Birth of Prophet Muhammad (PBUH)? For Muslims, Prophet Muhammad (PBUH) is the best creature ever. He is the last messenger and prophet sent by the Almighty Allah to guide people from the darkness of ignorance to light of Divine guidance. At any human scale, he (PBUH) is a man of extraordinary achievements. This is a fact admitted not only by Muslims, but by non-Muslim thinkers and philosophers also. Having put Prophet Muhammad (P
August 25, 2023
Article
This is Jesus, Son of Mary, the Word of Truth
This is Jesus, Son of Mary, the Word of Truth rn Festivals and celebrations are considered one of the distinctive characteristics and key features of societies around the world as they constitute a major part of cultural fabric for people. This means that there is hardly any human society without festivals, whether they are related to religious occasions or non-religious ones. While there are some Islamic festivals like, Eid al-Fiá¹r and Eid al-Adha, there are also various c
August 14, 2023