Institutional FOREX Strategist | Trader | Data Science Enthusiast. Author of the Book of Back-tests: https://www.amazon.com/dp/B089CWQWF8

How to Create a Function that Fetches Market Sentiment Data.

Market sentiment is an extremely important part of trading. It allows us to understand the positioning of the players who potentially could move the markets. Knowing that the majority of hedge funds are bullish on an asset gives us more confidence to invest in it. Similarly, knowing that almost all of the hedge funds are bullish on an asset could give us a signal that the market may be overly bullish and that it is wiser to wait before investing or even be brave enough to initiate a contrarian position in case the fundamentals start to justify it.

In this article, we will discuss the famous Commitment of Traders Report — COT and present a way to easily get the values using Python. Next we will see how to combine them with their respective assets or currency pairs. But first, we will introduce the concept of the Commitment of Traders Report before we move on to the more technical elements. …


An overwhelming number of traders use the famous Relative Strength Index to help with their decisions, and although it can only serve as a confirming indicator, it nevertheless, has its weight in many trading decisions or at the very least timing the decisions. The RSI has been created by J. Welles Wilder in 1978 as a momentum indicator with an optimal look-back period of 14 bars. It is bounded between 0 and 100 with 30 and 70 as the agreed-upon oversold and overbought zones respectively. The RSI can be used through 3 known techniques:

  • Oversold and overbought zones as indicators of possible short-term corrections or reversals.


Presenting and Back-testing a Volatility-Adjusted Stochastics Oscillator.

We all know the famous Stochastics Oscillator that is introduced to us when first starting out with Technical Analysis. It is one of the mainstream indicators alongside the MACD and the RSI. It is known to be quite volatile and moves around from overbought and oversold areas in sometimes one time period.

The Stochastics Oscillator has always fascinated me because of its simplicity and usage of the known normalization function. I also use it in my systematic trading as I find that it has its place within the overall framework. However, I believe that we should always be creative with what we learn and as such, in this article, we will see how to modify this indicator and turn it into something more dynamic and more reflecting of the recent volatility. …


An Improved Version of Moving Averages. A Study in Python.

Trading is all about finding reactionary levels from where we assume prices will take a certain direction. And from that assumption, we initiate either a long (Buy) position or a short (Sell) position. Many techniques can be used to find support and resistance levels such as pivot points, Fibonacci retracements, and graphical levels. However, these techniques are all static in time, i.e. they do not move with real time data. In contrast, moving averages are dynamic and do a great job at finding support and resistance levels. …


Introducing the Ichimoku Kinko Hyo and Back-testing Its Strategy.

Ichimoku Kinko Hyo or Ichimoku is not just a strategy, but a full trading system. It builds on price bars to generate its signals. Developed around the late 1930’s by Goichi Hosoda, the system grew to be widely popular in Japan and other locations around the world. It has been quoted as being hard to understand due to its many elements on the chart, but we will soon see that approaching it step by step will make it a crystal-clear indicator.

The name Ichimoku Kinko Hyo means instant look at the cloud chart (also known as equilibrium chart) and this comes from the fact that the indicator has clouds. …


Can Correlation be Predictive? A Python Study.

Correlation is the degree of linear relationship between two or more variables. It is bounded between -1 and 1 with one being a perfectly positive correlation, -1 being a perfectly negative correlation, and 0 as an indication of no linear relationship between the variables (they relatively go in random directions). The measure is not perfect and can be biased by outliers and non-linear relationships, it does however provide quick glances to statistical properties. Two famous types of correlation exist and are commonly used:

  • Spearman correlation measures the relationship between two continuous or ordinal variables. Variables may tend to change together, but not necessarily at a constant rate. …


What if we Use Pattern Recognition Algorithms on Technical Indicators?

As we know, pattern recognition is the search and identification of recurring patterns with approximately similar outcomes. When used on prices, we get some good results on some strategies and some bad results on others. Our job now is to be creative and expand our research horizon. In this article, we will back-test a pattern that I have found after a lot of research, but this time, we will not apply the pattern on the assets’ prices, rather on technical indicators, specifically, the Relative Strength Index — RSI. Why is this?

We want to see whether pattern recognition works well on price-derived indicators or not, and from there we want to see if we get quality trading signals or not. But first, let us quickly go through the Astral pattern and the RSI so that we know where we stand. …


A Python Study on the Strength of the ADX Indicator to Detect Trends.

How do we know whether we are ranging or trending? And for that matter, how can we measure the strength of the trend? Sure, we can take a look at the chart and maybe overlay some moving averages but that still does not tell us much.

Created by Welles Wilder, the Average Directional Index — ADX is a complex indicator that is used to determine the strength or absence of a trend, be it bullish or bearish. Generally, it is accompanied by a Negative Directional Index (-DI) and a Positive Directional Index (+DI). In this article, we will see how to calculate the ADX, code a function in python that does it for us, back-test a simple strategy using only the ADX, and then discuss the results before back-testing another strategy that relies on the ADX as a filter for the current market state. …


Creating a Strategy Based on the Filtered Momentum Indicator.

Momentum is an interesting concept in financial time series. Most strategies are either trend-following or mean-reverting. Momentum is the strength of the acceleration to the upside or to the downside, and if we can measure precisely when momentum has gone too far, we can anticipate reactions and profit from these short-term reversal points. One way to measure momentum is by the Momentum Indicator.

The idea of this article is to code the Momentum Indicator and then create volatility bands around it to make it bounded. This should give trading ideas whenever the indicator touches its upper or lower volatility band. We will later back-test this strategy and simplify the process by creating what I call the Filtered Momentum Indicator — FMI using a simple transformation. …


Developing a Market Timing Pattern for Financial Trading.

Pattern recognition is the search and identification of recurring patterns with approximately similar outcomes. This means that when we manage to find a pattern, we have an expected outcome that we want to see and act on through our trading. For example, a double top/bottom pattern is a classic technical pattern that signals an imminent trend reversal. The literature differs on the predictive ability of this famous configuration. In this article, we will discuss a new objective pattern that can help find local tops and bottoms. …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store