Japanese candlesticks. Popular stocks and other instruments continuously change in price as traders trade on them. If we display each price change as a chart, we may obtain a very complicated chart as the price may change hundreds of thousands or even millions of times in a single trading day. Therefore, in order not to display all prices of a trading instrument within a given period (timeframe - for example, 1 day), the so-called Japanese candlesticks are used. One candlestick of a given period (e.g. 1 day) is characterized by 4 parameters: price maximum, price minimum, opening price and closing price. For example, for a daily period (timeframe), the opening of a day candle (Open) represents the price of the first trade at the beginning of the trading day. The maximum of a day candle (High) represents the maximum price reached by a trading instrument in intraday trading. The minimum of a day candle (Low) represents the minimum price reached by a trading instrument in intraday trading and the close of a day candle (Close) represents the price of the last trade at the end of the trading day:
The space between the High and Low of a candle is indicated by a vertical bar. The space between the opening and closing of a candle is denoted by a rectangle and is called the body of the candle. If the close price of a candlestick is higher than the open price (Close > Open), the body of the candlestick is usually green or white. If the close price is lower than the open price (Close < Open), the body of the candle is usually red or black.
Formed Candle. A candle is called a Formed Candle if its closing price, High and Low can no longer be changed over time. Such a candlestick describes a price that has changed in the past time period and now represents the historical price of an instrument for a given period (for example, a daily candlestick). For example, if today is August 30, 2021, then the candlestick of August 29 is considered formed (its closing price, high and low cannot change over time, because the trading day of August 29 is finished). On the contrary, if at the moment (August 30, 2021) there is trading in the instrument, the closing price of the current candle (which describes the change in price within the current trading day) can change. Such a candlestick is called Unformed (it will be formed after the end of trading on the current trading day). In this case, if the current closing price becomes higher than the current price of the trading day, the High of the current candle will be updated. If the current closing price is lower than the current Low price of the trading day, the Low of the current candle will be updated.
Local maximums/minimums - The market never rises and falls in a linear fashion - the price of stocks and other trading instruments is subject to a wave-like movement. During this movement, so-called local maximums and minimums (extrema) are formed. This notion comes from the meta-mathematical analysis of functions. The price of a trading instrument is nothing but a two-dimensional function of the price along the Y-axis depending on the time along the X-axis. The local maximum of the price is a point on the chart in the local area of which its value is higher than any value of this price from this area. For example, a local maximum may be formed from the combination of three candlesticks on the chart:
In this case, the local maximum is the value of the maximum of the second candle H2, as it is higher than the maximum of the first candle H1 and higher than the maximum of the third candle H3.
Similarly, a local minimum of a price is a point on the chart, in the local area of which its value is lower than any value of this price from this area. For example, a local minimum can be formed from a combination of three candles on the chart:
In this case, the local minimum is the minimum of the second candle L2, as it is below the minimum of the first candle L1 and below the minimum of the third candle L3.
An ascending range - a price range is called an ascending range if each successive local Low within the range is higher than the preceding local Low and each successive local High within the range is higher than the preceding local High. In the simplest case, an ascending range can be represented as two consecutive rising candles, for which the Low and High of the second candle are higher than the first (L2 > L1 and H2 > H1):
Down Range - A price range is called a down range if each successive local High within the range is lower than the previous local High and each successive local Low within the range is lower than the previous local Low. In the simplest case, a descending range can be represented as two consecutive falling candles, for which the High and Low of the second candle are lower than the first (H2 < H1 and L2 < L1):
Narrowing Range - A price range is called a narrowing range if each successive local High within the range is lower than the preceding local High, while each successive local Low within the range is higher than the preceding local Low. In the simplest case, the tapering range can be represented as two consecutive candles, for which the range of the second candle is within the range of the first candle (the High of the second candle is below the High of the first and the Low of the second candle is above the Low of the first: H2 < H1 and L2 > L1):
Expanding range - a price range is called an expanding range if every next local High within the range is higher than the previous local High, while every next local Low within the range is lower than the previous local Low. In the simplest case, an expanding range can be represented as two successive candles, for which the range of the first candle is inside the range of the second candle (the High of the second candle is higher than the High of the first, and the Low of the second candle is lower than the Low of the first: H2 > H1 and L2 < L1):
Range maximum/minimum - the maximum/minimum price that was reached by a trading instrument within a given range. For example, if you view a 23-day price range as a sequence of 23 daily candlesticks, the maximum of the range will be the maximum of 23 candlesticks - max(H1, ..., H23). The minimum of the 23-day price range will be the minimum of 23 candles - min(L1, ..., L23)
A range break is an event when the closing price of the last unformed candle becomes higher than the High or Low of the price range. If the closing price is above the High of the range, this event is called an upwards range breakout. If the closing price is below the Low of the range, such an event is referred to as a range breakdown.
A gap is an event in which the opening price of the current candle does not match the closing price of the previous candle, forming a visual 'gap' in the price chart. If the opening price of the current candle is higher than the High of the previous candle, it is said to be a gap up. If the opening price of the current candle is below the Low of the previous candle, it is said that there was a gap down.
If after a gap up the closing price of the current unformed candle becomes lower than the High of the previous candle, it is said that the gap up is closed. If after a gap down the closing price of the current unformed candle becomes higher than the Low of the previous candle, it is said that the gap down is closed.
“Pin bar” (pin for "Pinocchio") – a candlestick with a long tail and a short body shifted towards the High or Low of the candlestick. If the body is moved towards the High of the candle, this candle is called an upwards pin bar. If the body of the candle is shifted towards the Low of the candle, the candle is called a downward pin bar.
A naked maximum/minimum is a candle that has the same closing price as its High or Low.
Moving average is a common name for indicators of technical analysis of share prices and other trading instruments, the value of which at each point is determined as some average value of prices of the same trading instrument over the previous period. Moving averages are usually used for smoothing short-term fluctuations of trading instrument prices and are the most popular indicators of price trends of these trading instruments. So-called simple moving averages (SMA) and exponential moving averages (EMA) are most often used in trading.
A simple moving average (SMA) is the simplest type of moving average. The value of this indicator for a given moment in time is equal to the sum of the price values of a stock or other trading instrument, for which a simple moving average is constructed, for the last N periods, divided by the number of those periods N:
SMA = (С1 + С2 + … + СN) / N
N parameter is defined by a user in the indicator settings. As a rule, closing prices of these periods (candlesticks) are taken as the prices of the trading instrument for the previous periods.
An exponential moving average (EMA) is a type of moving average which gives greater weight to recent price data than a simple moving average (SMA). The EMA reacts more quickly to recent price changes than the SMA. The indicator is calculated using a formula for a given time period t:
EMA(t) = (C - EMA(t-1)) x multiplier + EMA(t-1),
where C - the price of a trading instrument for the current period, multiplier = 2 / (N + 1) - multiplier, where N - number of latest time periods (candlesticks), which value of a trading instrument price is used for EMA calculation, EMA(t-1) - exponential average value for the previous period. For the EMA(0) calculation, the value of a simple moving average for this time period is usually used.
See additionally: https://school.stockcharts.com/doku.php?id=technical_indicators:moving_averages
Oscillators are a group of indicators for technical analysis of prices of shares and other trading instruments which help to identify turning points and price trends in these instruments. Such oscillating indicators as "Stochastic Oscillator", "Relative Strength Index (RSI)" and others are most often used in trading.
Stochastic Oscillator - developed by George C. Lane in the late 1950s, the Stochastic Oscillator is a momentum indicator that shows the location of the close relative to the high-low range over a set number of periods. The indicator is calculated using the formula for a given time period t:
%D = 3-day SMA of %K
where %K = (С - LLV) / (HHV - LLV) * 100, HHV (Highest High Value) = max(H1, …, HN), LLV (Lowest Low Value) = min(L1, …, LN), N - the number of the most recent time periods (candles) in which the value of the trading instrument price is used to calculate the stochastic indicator.
See additionally: https://school.stockcharts.com/doku.php?id=technical_indicators:stochastic_oscillator_fast_slow_and_full
ATR (Average True Range) - an indicator of technical analysis of prices of shares and other trading instruments, which describes the average volatility of the price of a trading instrument (price change magnitude relative to its average value) for the last N time periods. The indicator is calculated according to the formula for a given time period t:
ATR(t) = ((ATR(t-1) x (N-1)) + TR(t)) / N
where ATR(t-1) - the average true range for the previous period, TR(t) = max(H(t)-L(t); |H(t) - C(t-1)|; |C(t-1)-L(t)|) - True Range for the current period, calculated as the maximum of the three values: H(t)-L(t), |H(t) - C(t-1)| and |C(t-1)-L(t)|. Here, H(t) is the maximum price of the trading instrument within the current time period t (candlestick), L(t) is the minimum price, C(t-1) is the closing price of the trading instrument within the previous time period t-1 (candlestick).
See additionally: https://school.stockcharts.com/doku.php?id=technical_indicators:average_true_range_atr
Artificial neural networks (ANN) are computing systems that are inspired by biological neural networks that constitute animal brains.
An artificial neural network allows modelling a nonlinear function with some input and output data.
A neural network has:
· Input layer, to which the input parameters associated with the state of each neuron of the input layer are passed. For example, for a financial analyst, it can be various indicators — macroeconomic, fundamental and technical.
·Output layer, in which the output parameters associated with the state of each neuron of the output layer are calculated. This is the information we would like to predict. For example, this may be the future return of the market in %, volatility, liquidity, etc.
The neural network operates with numbers, so any input and desired output information must be digitised. For example, if it is text (news), then you need to present this text as an array of numbers. Or, if we are trying to predict where the market will go, up or down, then we can encode “down” by zero, and “up” by one.
If a neural network has additional layers between the input and output layers, then they are called hidden layers, and the training of such a network is called deep learning. Additional hidden layers can help the neural network identify more complex patterns between input and desired output data.
Each layer is connected to neighbouring layers using weights and bias coefficients. The passage of information from the previous layer to the next is carried out according to the following rule: z = Act(Wy + b), where y is the vector of data on the previous layer, z — vector of data on the next layer, W is the weight matrix of the transition from the previous layer to the next, b is the vector of bias coefficients. Act is some activation function needed to eliminate linearity. There are many activation functions. For example, it could be sigmoid function:
Supervise learning of neural network means that for a given set of previously known input and output data (training data), it is necessary to select the optimal W and b coefficients so that the squared error between the exact output value and the output value obtained by propagating the input values through the neural network tend to be minimised:
For example, you want to train a neural network to predict the future percentage change in the stock price based on the past price dynamics of this stock and the dynamics of the Simple Moving Average (SMA) indicator and the Relative Strength Index (RSI) indicator. We generate data for training — for each historical moment in time we take data on indicators and stock prices. This will be the input X data for the neural network. And for each historical moment in time, we take the future change in the stock price (we know it for sure, since we are talking about historical data). This will be the output Y data for the neural network that we want to train to predict. For these data X and Y, the optimal coefficients W and b will be selected.
The search for the optimal coefficients W and b is performed by the gradient descent method using the backward propagation of errors method:
Where the gradient of E functional is expressed as follows for W:
And similarly for b:
We want to give such an analogy of training a neural network for traders. I hope it will be more understandable to you if you do not understand the mathematical apparatus. Imagine that you came up with a trading strategy that has a large number of parameters. Of course, you would like to choose the most optimal parameters for the strategy (like the coefficients W and b in the case of a neural network). What does optimal mean? Such that to maximise profits or the Sharpe Ratio, or minimise drawdown — depending on which criterion you choose. Next, you begin to iterate these parameters (train, in the case of a neural network). Parameters can be iterated with the help of “brute force” — i.e. iterate over all possible combinations of parameters. But if there are so many parameters, then your computer doesn't have enough processing power and it will take a lot of time to find an optimal one. Therefore, a number of optimisation algorithms were developed: e.g., the gradient descent method and its variations or the genetic algorithm to search for optimal parameters faster, sacrificing accuracy.
A neural network may have the same problems that arise when optimising trading strategies. The main one is overfitting, when everything works very well on past data and does not work well on out-of-sample data. In the next article we will discuss how to minimise the risk of retraining and correct test strategies.
As an example, we created a fully connected neural network from the input, output, and two hidden layers. In the input layer, we generated 45 neurons— there we will pass daily changes in S&P 500 prices for the last 15 days, the value of the SMA indicator for the last 15 days and the value of the RSI indicator for the last 15 days. The output layer consists of 1 neuron and will store the predicted percentage change of the S&P 500 the next day. Hidden layers contain 512 neurons. We will train the neural network on data from October 2019 to June 2019 and check the accuracy on data from July 2019 to September 2019.
We got the following results. The chart below shows the daily return of the S&P 500 from October 2019 to June 2019 (training data) — a blue curve. If the curve is above zero, it means that the S&P 500 has grown that day. If the curve is below zero S&P 500 has declined.
We also applied an orange curve to a blue one. This is a neural network predicted market return. This is the market return predicted by the neural network for the past dynamics of the S&P 500, SMA and RSI over the past 15 days for each historical moment. The accuracy of the prediction (the S&P 500 grows the next day or declines) is 93%. But this is training data. On test data from July 2019 to September 2019, the results were much more modest:
The accuracy of the prediction is only 49%. The neural network is clearly overfitted. But, given the simplicity of the model, one could hardly have expected a more acceptable result.
CONCLUSION:
1. An artificial neural network is a “black box” that can be trained to give us the output we need (for example, a forecast of something) according to given input data.
2. From the point of view of trading, various indicators can be passed to the input of a neural network: macroeconomic, fundamental and technical, and train it to predict the future market return, volatility, liquidity, conditions, etc.
3. A neural network, like any algorithmic trading strategy, can be overfitted. This should be monitored at least by dividing the data into training and test data.
Company name (e.g. 'Alphabet Inc.') - the full name of the instrument or company that issued the stock.
A short company name, ticker (e.g. GOOG) is the short name of an instrument traded on an exchange. It is a unique identifier within an exchange and usually contains 1 to 6 characters. For example, Apple stock’s ticker symbol is AAPL on the NASDAQ exchange. A gold futures contract on the CME has the ticker symbol GC.
The name of the trading idea on the chart (e.g. RicingFallingCandlesRangeSignal) - is one of 13 candlestick patterns that we track.
You can read more about each of them in block IV. 13 CANDLESTICK PATTERNS.
Idea type (long and short). There are two types of trades - long and short. A position is called Long if the trader buys an asset to sell at a higher price for profit. A position is called Short if the trader sells an asset to buy at a lower price to make a profit. The names Long and Short are not related to how long an open position is held, but to the historical facts of the stock market. This market can grow for quite a long time, but when a sell-off occurs, the same asset can fall in price by a comparable amount in a short period of time, which can be explained by the psychology of traders trying to get rid of an asset which is losing money as soon as possible.
Optimal maximum holding period - the number of time periods (e.g. 10 days) from the opening of a long or short position until it is liquidated completely (buy or sell). For the generated ideas, we calculate the optimal position holding time using the MFE/MAE test, using a 20-year history of the asset price.
You can read more about MFE/MAE test in block VI. QUANTITATIVE ANALYSIS. “How to find a good entry point. MFE/MAE analysis. PART 1”
The probability of an idea’s outcome is calculated as the number of positive signal outcomes divided by the total number of signals generated over the historical period (in our analysis we use the 20-year history of an asset's price). An idea’s outcome is considered positive if when we buy/sell an asset (depending on the idea type), we close the open position with a profit after X days, where X is the optimal position holding time obtained using the MFE/MAE test.
You can read more about MFE/MAE test in block VI. QUANTITATIVE ANALYSIS. “How to find a good entry point. MFE/MAE analysis. PART 1”
Signal average return (Mathematical expectation of the idea - Expectancy) - calculated as the sum of all profits and losses obtained from transactions according to all such ideas over a certain historical period (in our analysis we use a 20-year history of the asset price) divided by the total number of ideas generated over this period. The profit or loss from trade is calculated as a percentage change in the price of the asset. For example, if we buy an asset at $100 and sell it at $105, the profit from the transaction is calculated as ($105 - $100) / $100 = 5%.
The name of the trading idea (e.g. "Uptrend range: 2 consecutive growing candles") is one of 13 candlestick patterns we monitor in real-time for trading instruments, analyse over a 20-year historical period for those assets and publish if they meet the selection criteria (positive mathematical expectation and other criteria).
You can read more about 13 candlestick patterns in block IV. 13 CANDLESTICK PATTERNS.
The instrument is the name of the asset for which the idea is generated.
A time frame (e.g. 1D) - or trading period - is the interval of time used to group quotations when constructing price chart elements (bar, Japanese candlestick, line chart point). Since the price of an asset can change in real-time with a frequency that depends on the activity of bidders, as a rule, these prices are grouped within certain time periods (for example 1 day, 1 hour or 5 minutes, etc.). Within the chosen timeframe only the open, high, low, close and volume prices of the instrument are usually left. For a line chart, only one selected price (usually the closing price) can be used. We use the daily dealing period (1D) for the instrument prices. This means that we do not follow the price changes of the instrument within the day, but only record the price of the asset at the beginning of the trading day (open), the maximum (high) and minimum (low) price of the asset reached for the day and the price of the asset at the end of the trading day (close).
The current time is the current date and time in the time zone of the exchange where the instrument is traded. For example, Apple shares are traded on the NASDAQ exchange, which is located in New York City. The state of New York is in the Eastern Time zone (UTC-05:00) with daylight saving time (UTC-04:00).
The current price of an instrument is the price of the last transaction in the instrument executed by participants on the exchange on which the instrument is traded.
Take Profit is a pending order placed by a trader to buy or sell an asset at the desired price. As a rule, such a bid is put out for automatic fixing of profit on a previously opened position.
For example, a trader has bought one Apple share at $130 and expects its price to rise to $140. To automatically fix the profit (sell the purchased Apple stock for $140), the trader should submit a pending take profit order to the broker. As soon as the price of Apple reaches $140, the broker commits to selling the trader's stock and fixes the profit for the trader.
Stop Loss is a pending order placed by traders to buy or sell an asset at the desired price. As a rule, such an order is placed by traders to limit their losses when the price reaches a predetermined level.
For example, a trader bought one Apple share at $130 but is concerned that its price may fall. Also, traders have to decide for themselves if they are prepared to incur a loss on the purchased share until its price is no lower than $100. To automatically fix the loss in case the Apple stock price falls below $100, the trader should place a pending stop order at $100. If the price of Apple stock falls below $100, the broker undertakes to sell the Apple stock and fix the loss for the trader.
Quantitative analysis (QA) is the use of mathematical and statistical methods in finance and investment management. Those working in the field are quantitative analysts. They tend to specialize in specific areas which may include derivative structuring or pricing, risk management, algorithmic trading and investment management. The occupation is similar to those in industrial mathematics in other industries. The process usually consists of searching vast databases for patterns, such as correlations among liquid assets or price-movement patterns (trend following or mean reversion). The resulting strategies may involve high-frequency trading.
QA provides analysts with tools to examine and analyse past, current and anticipated future events. Any subject involving numbers can be quantified, thus QA is used in many fields including financial analysis.
In the financial services industry, QA is used to analyse investment opportunities, such as when to purchase or sell securities. Investors perform QA when using key financial ratios, such as the price-earnings ratio (P/E) or earnings per share (EPS), in their investment decision-making process (e.g. whether to purchase shares of a company's stock). QA ranges from the examination of simple statistical data (e.g. revenue) to complex calculations (e.g. discounted cash flow or option pricing).
There are hundreds of different financial assets to trade, across several categories: stocks, commodities, currencies, crypto assets, indices and ETFs. Each asset class has its own characteristics and can be traded using a variety of trading strategies. Below we will go into more detail about each category. Some positions involve ownership of underlying assets, such as long (BUY), non-leveraged positions on stocks and cryptos. Others employ CFDs, which enable a variety of options, such as leveraged trades, short (SELL) positions, fractional ownership and more.
The stock market is dynamic and presents many options for traders. Stocks are usually considered suitable for medium- to long-term investments. Each stock is affected by different market events and could go up or down in value following announcements such as earnings reports, new product launches, and changes in competitors’ stock prices.
For example, if a smartphone manufacturer receives negative press following a malfunction in one of its product series, it is possible that its direct competitors’ share prices will rise. Companies that make profits often share dividends with their shareholders at a fixed payment per share.
Buying a stock by opening a Long (BUY), non-leveraged position, means you are investing in the underlying asset, and the stock is purchased and held in your name.
However, some brokers also offer additional functions using CFD trading. With CFDs, you can open Short (SELL) positions, use leverage, and buy fractional shares. For example, you can invest as little as $100 in a stock that actually costs $500.
At OLTO we track popular stocks including:
Apple (AAPL) | Tesla (TSLA) | Google (GOOGL) | Facebook (FB) | Amazon (AMZN)
Discover the full list of financial instruments which we track at OLTO
Trading commodities is one of the most ancient trading practices in the world, dating back thousands of years. Commodities are unique, given that they have a real-world physical representation. Whether it’s an energy source, such as oil, or a precious metal like gold or platinum, commodities exist in the real world and, therefore, are also affected by real-world events.
For example, if oil reservoirs are in surplus, it is likely that prices will drop accordingly. In addition, some commodities are considered safe-haven assets, meaning they can add stability to a portfolio that consists of highly volatile assets. For example, many foreign currency traders turn to gold futures when the market becomes too volatile, as gold prices are more stable overall, while still relating to the foreign exchange market.
Commodities that trade as CFDs mean you don’t need to purchase the underlying asset to trade them. In addition, CFDs enable Short (SELL) positions, leveraged trades, and fractional ownership – even for assets that don’t offer the option in traditional trading. For example, you can invest as little as $100 in gold, even if a single unit of gold costs $1,000.
At OLTO we track popular commodities including:
Gold | Oil | Natural Gas | Silver | Platinum
Discover the full list of financial instruments which we track at OLTO
The foreign currency exchange market is the biggest market in the world, with a trading volume average of more than $5 trillion a day. It is also an incredibly volatile market, with changes happening within a matter of seconds.
Since it is such a dynamic market, currency traders are usually very active, sometimes opening and closing trades within minutes. Movement in currency is measured in very small units, known as “pips” (0.0001), and require substantial capital to generate noticeable profits.
For this reason, most trading platforms offer leveraged transactions at a fixed ratio. For example, if the ratio is set to 1:100, then for each $1 invested, the platform loans the trader an additional $99. Leveraging is considered a double-edged sword, since losses are also leveraged, and can result in funds depleting rapidly.
Each currency is affected by various factors, including central banks’ interest rate decisions, a certain country’s export statistics, and other economic events.
Currencies that trade as CFDs mean you don’t need to purchase the underlying asset to trade them. In addition, CFDs enable Short (SELL) positions and leveraged trades – even for assets that don’t offer the option in traditional trading.
At OLTO we track popular currencies including:
EUR/USD | GBP/USD | AUD/USD | USD/JPY | USD/CAD
Discover the full list of financial instruments which we track at OLTO
Growing incredibly in popularity in recent years, crypto assets, such as Bitcoin and Ethereum, have become the go-to investment option for many traders.
Crypto assets display extremely high volatility, and it is quite common to see double-digit percentage fluctuations in a single day. Bitcoin, which is the first and largest crypto, is considered to be the benchmark for this market, and other assets’ charts often move in the same direction as Bitcoin.
Buying crypto means you are investing in the underlying asset. These trades are unleveraged. Buying and selling the underlying assets are unregulated and have no investor protection.
At OLTO we track popular cryptocurrencies including:
Bitcoin (BTC) | Ethereum (ETH) | Bitcoin Cash (BCH) | Cardano (ADA) | XRP
Discover the full list of financial instruments which we track at OLTO
Every major stock market around the world has an index, or several indices, which reflect the status of a specific segment of that market. Indices are considered more stable than individual stocks since they contain many different assets which tend to balance each other out.
For example, the NASDAQ index on Wall Street aggregates major companies from the tech sector, such as Apple and Google, and since it contains rival companies, if one falls, sometimes its competitor will rise, maintaining the index’s overall balance.
Since companies vary in size and market cap, each stock has a different effect on the index, meaning some carry more weight. For example, since Apple has more weight than smaller companies within the NASDAQ index, if Apple’s stock rises significantly, it could lift the entire index’s value.
Indices that trade as CFDs are not financial assets that can be directly invested in. With a CFD, you can open Long (BUY) or Short (SELL) positions and open leveraged trades.
At OLTO we track popular indices including:
GER30 | NSDQ100 | DJ30 | SPX500 | FRA40
Discover the full list of financial instruments which we track at OLTO
An Exchange-Traded Fund (ETF) is a financial instrument comprising several assets grouped together to serve as one tradable fund. Each ETF follows a certain market strategy or index and is designed to either suit the hedging needs of a specific financial institution or to be a low-risk option for investors.
ETFs are created by financial bodies using a team of experts who tailor each fund to meet its goal. The assets in the fund are owned by its creators, and just like stocks, dividends can be distributed to investors from time to time. ETFs are usually considered long-term investment tools, as they are geared towards low risk, and are designed to yield steady profits over time.
Investing in ETFs by opening a Long (BUY), non-leveraged position, means you are investing in the underlying asset, and the ETF is purchased and held in your name. However, some brokers also offer additional functions using CFD trading. With CFDs, you can open Short (SELL) positions, use leverage, and buy fractional shares. For example, you can invest as little as $250 in an ETF that actually costs $500.
At OLTO we track popular ETFs including:
SPY | VXXB | TLT | HMMJ | QQQ
Discover the full list of financial instruments which we track at OLTO
Let's move on to the tactical vision and think about how to evaluate the quality of one or another entry point algorithm for a given trading instrument.
One such approach is MFE/MAE analysis. What is it? Consider the picture below:
Suppose we entered a long position at some point on the price chart (black arrow in the figure). We can take any time window and check for what maximum distance the price shifted in the direction of profit (green zone) and in the direction of loss (red zone) within this window after we entered the position. The value of the largest price offset in the direction of profit is called “Maximum Favourable Excursion (MFE)”. The value of the largest price offset in the direction of loss is called “Maximum Adverse Excursion (MAE)”. In the figure, the MFE value is equal to 3.93, and the MAE value is equal to 11.33. If we divide the MFE value by MAE, then we get some MFE/MAE coefficient (in our example, MFE/MAE = 0.35).
Why do we need it? Using these values (MFE and MAE), we can estimate the quality of the strategy entry algorithm. If we calculate the MFE/MAE coefficients for all trades and then take the average, then we can quantify how much advantage our entry algorithm has.
· If the ratio MFE / MAE = 1, then the entry point does not give any advantage.
· If the ratio MFE/MAE <1, then the entry point has a negative advantage — you can try to change the direction of entry into the deal (instead of a long position, use a short one and vice versa).
· If the ratio MFE/MAE > 1, then the entry point has an advantage and gives a better chance to enter a trade with less risk.
The higher the value of the MFE/MAE coefficient of 1, the better for our strategy.
It must be said that the entry point algorithm itself can be quite complicated and contain many filters. For example, while engaging in strategy automation for one public trader who trades CME futures, we counted about 7 filters for his entry algorithm. These filters need to be digitised one way or another.
Let’s consider usage of MFE/MAE coefficients by example. We will test different entry algorithms for the SPY instrument. (ETF trading stocks from the S&P 500 index). We took data for the last 25 years — since 1993. We will test entry points for the W1 timeframe.
It is necessary to decide for what period to test the data of the trading instrument and what timeframe to use to analyse the entry algorithm. For the purity of the experiment, the testing period should contain different market conditions: low- / highly- volatile, trend / non-trend.
For example, a few simple entry methods were used:
Before testing the entry points, it is necessary to determine the size of the time window for the computation of the MFE/MAE coefficients. The size of this window should be taken commensurate with the position holding time, which the trading strategy implies. In this test, we used 96 weeks (about 2 years) as the maximum time window period.
Since the size of the time window when computing the MFE/MAE is a parameter, it would be nice to see the dynamics of this coefficient, depending on the selected time window parameter.
We calculated the MFE/MAE coefficients for the five entry points indicated and sorted the entry points by decreasing the MFE/MAE coefficient for them:
The highest MFE/MAE coefficient is obtained for the “HHV/LLV breakthrough (20)” entry point. So this coefficient looks in dynamics, depending on the selected time window from 1 to 96 weeks:
In fact, the first 5 weeks the curve value is below one. This suggests that in the short term, if you hold a position for 1–5 weeks, the entry point when breaking the Donchian channel does not give an advantage (but a slight advantage will arise if we open a position in the opposite direction of the break). Starting from the 6th week, the value of the curve becomes more than one. The advantage reaches its peak somewhere on the 60th week (about 1 year) and is approximately equal to 1.9. It means that if, after Donchin’s channel breakthrough, we will be holding SPY for about 1 year, then we will have 2 times more chances to win than to lose. Holding a position longer than 1 year does not make sense, because during this period, the curve reached its peak and no further growth of the advantage can occur.
For the “Three consecutively growing/falling candles” entry point the MFE/MAE coefficients curve turned out to be the following:
This entry point is less beneficial than the “HHV/LLV breakthrough (20). The maximum value of the MFE/MAE curve is 1.6. The MFE/MAE coefficient becomes greater than one only from the 18th week of holding the position.
For the “Candle crossed EMA (20)” entry point the MFE/MAE coefficients curve turned out to be the following:
This curve is stable, growing over the period from 1 to 50 weeks. Then the growth rate of the curve decreases. The MFE/MAE coefficient becomes greater than one from the 8th week of holding the position.
For the “Two consecutively growing/falling candles” entry point the MFE/MAE coefficients curve turned out to be the following:
This curve is stable, growing over the period from 1 to 50 weeks. Then the growth rate of the curve decreases. The MFE/MAE coefficient becomes greater than one from the 8th week of holding the position.
For the “Two consecutively growing/falling candles” entry point the MFE/MAE coefficients curve turned out to be the following:
Note that the curve in the time interval from 1 to 96 weeks is in the neighbourhood of one. This suggests that a random entry point does not give any advantage. When randomly entering the price can go in the direction of profit and loss at the same distance.
There is a widespread opinion among traders that the entry point is not important, since it does not determine the profit in the deal. That exit point determines the profit in the deal, and the entry point can be selected randomly. Yes, it’s true (exit point determines the profit in the deal). But it is the qualitative entry point that allows you to enter a position with minimal risk and maximise the chances that the price will move in the right direction. Traders should continuously develop this skill throughout their career.
And finally: you can take your trading journal and carry out such an MFE/MAE analysis and assess how well you manage to determine entry points and also understand whether you are entering the deal randomly.
CONCLUSION:
1. MFE — Maximum Favourable Excursion. It is the value of the largest price offset in the direction of profit from the entry point. MAE — Maximum Adverse Excursion. It is the value of the largest price offset in the direction of loss from the entry point.
2. The ratio (coefficient) of MFE/MAE allows us to quantify how qualitative our entry point is. The higher the MFE / MAE value of 1, the more likely it is to enter a trade with less risk.
3. For greater clarity, it is better to consider the MFE/MAE coefficient in dynamics — depending on the selected time window parameter.
1. Fake reversal pattern: a local maximum/minimum formed on the market, but something went wrong and the price turned in the opposite direction.
· The local maximum is a combination of three candlesticks. The first candlestick is growing, the second and third are falling. The signal for price movement upward occurs when the price breaks the high of the second candlestick.
· The local minimum is a combination of three candlesticks. The first candlestick is falling, the second and third are growing. A downward price movement signal occurs when the price breaks through the low of the second candlestick.
2. Exit from the expanding range: the range of the penultimate candlestick is completely within the range of the last one and the price moves up or down out of this range.
· The signal for price movement upward occurs when the price breaks through the high of the last candlestick.
· The signal for price movement downward occurs when the price breaks through the low of the last candle.
3. Exit from a narrowing range: the range of the last candle is completely inside the range of the penultimate one and the price moves up or down out of this range.
· A signal for price movement upward occurs when the price breaks the high of the penultimate candlestick.
· A signal for price movement downward occurs when the price breaks the low of the penultimate candlestick.
4. The price has broken the maximum value for the last month
· A signal for price movement upward occurs when the maximum price for the last month (22 working days) is broken.
· A signal for price movement downward occurs when the minimum price for the last month (22 working days) is broken.
5. Short ema(14) crossed the long ema(22) from bottom to top
· A signal for price movement upward occurs when the short exponential moving average (with 14 days time window) crosses the long exponential moving average (with 22 days time window) from bottom to top.
· A signal for price movement downward occurs when the short exponential moving average (time window 14 days) crosses the long exponential moving average (time window 22 days) from top to bottom.
6. Opening with a gap up and then closing the gap
· A signal of price movement upward occurs when the market opens with a gap down and then closes this gap (crossing the minimum of the last formed candle from bottom to top)
· A signal of price movement downward occurs when the market opens with a gap up and then closes this gap (crossing of the maximum of the last formed candlestick from top to bottom)
7. Fake pin bar: a pin bar was formed, but something went wrong and the price turned in the opposite direction.
· A signal of price movement upward occurs when a downward pin-bar is formed and the next candlestick breaks the maximum value of the price of the last formed candlestick (pin-bar).
· A signal of price movement downward occurs when an upward pin-bar is formed and the next candlestick breaks the minimum value of the price of the last formed candlestick (pin-bar).
8. Reversal pattern: a local minimum/maximum formed on the market.
· An up signal occurs when the close price of the last formed candlestick is below the low price of the penultimate candlestick and the last formed candlestick is falling. But then the price breaks the high of the last formed candle upward.
· A down signal occurs when the close price of the last formed candle is higher than the high of the penultimate candle and the last formed candle is growing. But then the price breaks the low of the last formed candle down.
9. The stochastic indicator signal line has entered a range of 20-80%.
· An up signal occurs when the Stochastic indicator signal line crosses the 20% level from bottom to top.
· A down signal occurs when the Stochastic indicator signal line crosses the 80% level from top to bottom.
10. The last candlestick crossed the EMA moving average from bottom to top or top to bottom
· An up signal occurs when the last formed candlestick crosses the exponential moving average up.
· A down signal occurs when the last formed candlestick crosses the exponential moving average down.
11. Uptrend/ Downtrend range (2 consecutive growing/ falling candles)
· An up signal occurs when two consecutive growing candles are formed.
· A down signal occurs when two consecutive falling candlesticks are formed.
12. "Pin-bar" (Pin - from the word Pinocchio), aka "needle turn", aka "kangaroo tail". The last candlestick resembles the shape of a needle (usually this is a signal for a price rebound against the tip of the "needle").
· An up signal occurs when a growing candlestick is formed such that the distance from the candlestick's high to its opening is at least 2 times less than the candlestick's opening distance to its minimum.
· A down signal occurs when a falling candlestick is formed such that the distance from the candlestick's high to its opening is at least 2 times the distance from the candlestick's opening to its minimum.
13. Naked maximum/minimum: the last candlestick closes at its high or low.
· An up signal occurs when a rising candlestick is formed such that its close coincides with the high of that candlestick.
· A down signal occurs when a falling candlestick is formed such that its close coincides with the low of that candlestick.
Let us think again about how it is possible to evaluate whether the entry point gives some advantage when using it or not. To do this, you can apply the following test.
Suppose that we enter a long or short position at a certain point of the price chart and place a stop order and take profit order equidistant from the entry point, as shown in the figure below.
If the entry algorithm doesn’t give a probability offset, then using the strategy described above, the number of profitable and losing trades will be approximately the same. In other words, the number of profitable transactions in relation to the number of all transactions will be approximately 50%. If the percentage of profitable trades is more than 50%, then we can say that the algorithm for entering a position has a certain probability offset and this entry point can be further used to build a strategy.
Of course, the question arises: what is the distance to use from the entry point to the stop price and take profit price? For the distance from the entry point to the stop order, it is logical to take the stop, which we plan to use in our trading strategy. That is such a space between the price of opening a position and the price of a stop order, within which we are ready to suffer a loss if the price moves against the price of an open position.
For yourself, you can set a criterion for using entry points for further analysis when building a trading strategy. For example, you can set that the percentage of profitable transactions for the entry algorithm, in accordance with the described test, must be at least 60%.
Let’s see how this approach works in practice. We took the same 5 position entry algorithms as in the previous article:
Also, for the value of the stop order, we took the double Average true range (ATR) from the entry point. The following results were obtained and sorted according to the percentage of profitable transactions:
Of course, these results do not have to match the test results described in the previous article. In the first test, we do not consider the cutting of potential losses. In the second test — we do.
CONCLUSION:
1. To check the quality of the entry algorithm, use the following test: set a stop order and a take profit order equidistant from the position entry price and compute the percentage of profitable trades obtained after conducting such a test for some trading instrument.
2. If the percentage of positive trades is more than 50%, then the entry point has a probability offset at a given time interval.
3. Use the criterion by which you will select entry points for their further analysis when building a trading strategy. For example, the percentage of positive transactions that generates an entry algorithm should be more than 60%.
In this article, we will look at some statistics on the trading instrument. Using these statistics will allow us to get a general idea of the security with which we will work.
For example, we downloaded the daily data of Brent futures (CME Group) openings, closings, highs and lows prices for the last 30 years.
This is the closing price chart for this security:
Let’s calculate some statistics for Brent:
Growing days percentage: 50.01%.
Average day return: 0.023%
In fact, this means that using the Brent instrument for long-term investment is not a good idea, since the average day return is close to zero, and the percentage of a growing day of the total number actually coincides with the percentage of falling days.
Next, consider the following statistics:
The percentage of growing days if the previous 1 day fell: 40.71%
The percentage of growing days, if the previous 1 day grew: 59.72%
The percentage of growing days if the previous 2 days fell: 37.03%
The percentage of growing days, if the previous 2 days grew: 62.96%
Pay attention to how our forecast has improved, if we only bought when the previous day or the previous two days were growing. This statistic shows the nature of the Brent movement — most likely, when trading Brent, momentum strategies will be more effective than mean reversion strategies.
Let’s calculate some statistics for Brent:
Growing days percentage: 50.01%.
Average day return: 0.023%
In fact, this means that using the Brent instrument for long-term investment is not a good idea. Since the average day return is close to zero, and the percentage of growing days of the total number actually coincides with the percentage of falling days.
Next, consider the following statistics:
The percentage of growing days if the previous 1 day fell: 40.71%
The percentage of growing days, if the previous 1 day grew: 59.72%
The percentage of growing days if the previous 2 days fell: 37.03%
The percentage of growing days, if the previous 2 days grew: 62.96%
Pay attention to how our forecast has improved, if we only bought when the previous day or the previous two days were growing. This statistic shows the nature of the Brent movement — most likely, when trading Brent, momentum strategies will be more effective than mean reversion strategies.
It can be seen that, statistically, Brent tends to grow on Wednesdays (in almost 53% of cases). At the same time, in 54% of cases (100% — 46% = 54%), the Brent market is prone to falling on Mondays.
We do not recommend buying or selling Brent on Wednesdays or Mondays. We can simply take this information into account when making trades. Try to use this information as a filter when building a full-fledged strategy for Brent.
Now imagine that we buy a security only on certain days of the month (say only on the 15th day of each month) at the opening of the market and close the position before closing the market. In how many percent of cases would we be right?
The following statistics are for the Brent futures contract:
1 - 50.32%
2 - 52.27%
3 - 50.96%
4 - 45.8%
5 - 50.47%
6 - 48.87%
7 - 48.07%
8 - 47.28%
9 - 50.16%
10 - 47.61%
11 - 52.09%
12 - 48.39%
13 - 48.88%
14 - 50%
15 - 51.28%
16 - 50.96%
17 - 42.72%
18 - 49.67%
19 - 45.39%
20 - 47.61%
21 - 52.73%
22 - 49.83%
23 - 50.96%
24 - 51.75%
25 - 52%
26 - 51.44%
27 - 49.84%
28 - 48.56%
29 - 61.37%
30 - 53.16%
31 - 51.91%
as well as the graph:
It can be seen that, statistically, Brent tends to grow on the 29th of each month (in 61% of cases). At the same time, in 57% of cases, the Brent market is prone to falling on the 17th of each month.
Similarly, imagine that we buy a security only for certain months of the year, for example at the beginning of April each year, and close the position at the end of this month. In how many percent of cases would we be right?
Such statistics are shown below for the Brent:
1 - 53.57%
2 - 53.57%
3 - 57.14%
4 - 67.85%
5 - 53.57%
6 - 60.71%
7 - 57.14%
8 - 57.14%
9 - 50%
10 - 35.71%
11 - 46.42%
12 - 42.85%
as well as the graph:
If we bought Brent at the beginning of April and sold it at the end of April, we would be right 68% of the time. In fact, two of the three deals would bring a positive result. At the same time, in 64% of cases the Brent market is prone to fall in October each year.
And finally, let’s consider what it would be if we bought Brent at the beginning of one of the four quarters and sold it at the end of this quarter. In how many percent of cases would we be right?
Such statistics are shown below for the Brent:
1 - 64.28%
2 - 65.51%
3 - 57.14%
4 - 46.42%
and the graph:
From the graph it is clear that Brent tends to grow in the first, second and third quarter of the year. In the fourth quarter, Brent tends to fall.
CONCLUSIONS:
1. Calculating the global statistics for trading instruments allows you to get a general idea of this instrument with which we are going to work. In particular, you can consider on what days, months and quarters the market is prone to growth or fall.
2. Statistics can be taken into account when making trades. You can also try to use them as filters when building trading strategies for your trading instrument.
3. However, keep in mind that simply buying or selling a security using these statistics, without following the risk management, is not a good idea.