Posts

Average True Range Calculation for Forex

Image
Average True Range: A measure of Volatility! Developed by J. Welles Wilder, the Average True Range (ATR) is an indicator that measures volatility. True Range Wilder started with a concept called True Range (TR), which is defined as the greatest of the following:  Method 1: Current High less the current Low  Method 2: Current High less the previous Close (absolute value)  Method 3: Current Low less the previous Close (absolute value) Calculation – Average True Range Typically, the Average True Range (ATR) is based on 14 periods and can be calculated on an intraday, daily, weekly or monthly basis. For this example, the ATR will be based on daily data. Because there must be a beginning, the first TR value is simply the High minus the Low, and the first 14-day ATR is the average of the daily TR values for the last 14 days. After that, Wilder sought to smooth the data by incorporating the previous period's ATR value. Current ATR = [(Prior ATR x 13) + Current TR] / ...

Data Management for Forex Trading

Data Management! “Garbage in, Garbage out!” When we have inaccurate data, our tests and outputs will be corrupt. This could cause massive losses for the user. Hence, before we test and optimise our Robots, we need to make sure that our data is clean. Data Management and Cleaning is a large field with many in-depth areas of study. For the purpose of this course, we are going to focus on Data Cleaning with regards to market data. What is dirty market data? Essentially, dirty market data is data that inaccurately reflect the current state of the market. Types of problems: 1) Duplicate Entries 2) Missing Entries 3) Wrong Entries Process data… Steps: 1) Data Check Before we check, we need to know what our acceptable level of cleanliness is. Eg. If we are doing trading intraweek on Open and Close prices, we can afford to ignore errors due to Sunday Candles and those related to High, Close and Volume. Next, we should have an understanding of what clean data looks like. Eg. ...

Why EA? Trading robot for Forex

Why EA?! Advantages and Disadvantages! Commercial EA sellers tend to oversell their robots, labeling them as no-brainer money-making machines. But of course we know that this is just half-truths at best. Hence, it is important to understand the advantages and disadvantages of EAs in order to ensure it fits with your career/financial/life goals. Advantages Freedom Expert Advisors give you independence from your computer screens. An EA can execute your trading systems without any human intervention and therefore you can be sleeping (assuming you set some alerts), working a full-time job or tanning at the beach while the expert advisor is doing all the trading for you. Speed EAs have the ability to execute orders at an extremely rapid speed. If there is a 100 pip market movement in 2 minutes it is very unlikely that you will have the time to do as many things as a computer could. Given the ideal trading environment, an EA is able to open, close or modify positions in split second...

The 3 Main Types of Code in MQL4

The 3 Main Types of Code in MQL4 1. Expert Advisor (EA) is a mechanical trading system linked up to a certain chart. An Expert Advisor starts to run when an event happens that can be handled by it: events of initialization and deinitialization, event of a new tick receipt, a timer event, depth of market changing event, chart event and custom events. An Expert Advisor can both inform you about a possibility to trade and automatically trade on an account sending orders directly to a trade server. Expert Advisors are stored in terminal_directory\MQL4\Experts. (MQL4 Reference) Translation: An EA is a trading strategy in a coded form. Its capabilities includes, but is not limited to, opening and closing positions, sending notifications, creating graphics and storing information. 2. Custom Indicator is a technical indicator written independently in addition to those already integrated into the client terminal. Like built-in indicators, they cannot trade automatically and are in...

Definition of Holy Grail

Definition of Holy Grail In trading, Holy Grail is usually defined as a trading strategy that is has high long term profitability with consistent returns. In short, it is the ultimate trading strategy. We believe the Holy Grail (based on this definition) doesn’t exist. Our definition of Holy Grail New definition: The trader is the Holy Grail. We believe long term profitability with consistent returns do exist. However, this is not due to a single strategy. The trader is the Holy Grail. This trader: 1) Understands his portfolio of trading strategies 2) Understands how to design, backtest and optimise strategies 3) Understands when to maintain his portfolio, when to execute, modify or shut down strategies according to changing market conditions

MT4 or MT5 for trading Forex Algorithm trading?

Why MetaTrader 4? There are many software that we can use to build and implement Trading Robots..MT4 is the most suitable for someone new to algorithmic trading. Advantages Free This is the most important reason. Free data   This is the second most important reason. We can get free live data from the Broker and historical data is available from Metaquotes and online sources like Dukascopy. Many other trading software require us to buy past and live data from either the broker or external vendors. This is not only costly but it is inconvenient (especially when starting out). Access to different markets We can test and trade FX, Equities Indices, Equities (Stock), Commodities and Fixed Income. (Other than FX the rest are CFDs) Ease of learning the coding language The MQL4 language is similar to C++. There are many libraries and resources available online to guide new coders. Disadvantages Lowest bar is 1min    Fortunately with a bit of magic (coding) we ...

Mt4 Forex Programming Language

Image
In this blog, I will tell you how to write code in the Mt4 trading platform. Our very first step is to write "Hello World" program which is traditional way to start any Program language :) The code for the program is here: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 //+------------------------------------------------------------------+ //|                                                    Tutorial1.mq4 | //|                                        Copyright 2018, Ali Hassam | //| ...