Exploring the Gopalakrishnan Range Index for Market Trends
Written on
Chapter 1: Understanding Market Regimes
In the realm of trading, certain indicators are designed specifically to identify market regimes and volatility, rather than just directional movements. This article delves into the Gopalakrishnan Range Index (GRI), a tool that provides insights into the current market conditions.
Recently, I've released a new book following the success of my previous publication. This latest work includes advanced trend-following indicators and strategies, along with a dedicated GitHub page for continuously updated code. The book is also optimized for printing costs, maintaining its original color scheme. If you’re interested, feel free to check out the Amazon link below, or contact me on LinkedIn for a PDF version.
Creating the Gopalakrishnan Range Index
Commonly referred to as the GAPO index, the GRI quantifies the relative strength between the highest and lowest prices over a specified lookback period. If the difference between the highest highs and the lowest lows increases during this period, the indicator will rise. Conversely, a stable reading indicates that the market has not achieved new highs or lows, resulting in a flat reading.
Any time a new high or low is established, the value of the indicator adjusts accordingly, making it a trending indicator.
This video discusses the use of market regime filters in systematic trading strategies, offering valuable insights into how to leverage the GRI effectively.
Technical Functions for Data Manipulation
# Function to add columns to an array
def adder(Data, times):
for i in range(1, times + 1):
new_col = np.zeros((len(Data), 1), dtype=float)
Data = np.append(Data, new_col, axis=1)
return Data
# Function to remove columns starting from a specific index
def deleter(Data, index, times):
for i in range(1, times + 1):
Data = np.delete(Data, index, axis=1)return Data
# Function to eliminate rows from the beginning of an array
def jump(Data, jump):
Data = Data[jump:,]
return Data
Example Operations:
- Adding 3 empty columns to an array:
my_ohlc_array = adder(my_ohlc_array, 3)
- Removing 2 columns following the column indexed at 3:
my_ohlc_array = deleter(my_ohlc_array, 3, 2)
- Deleting the first 20 rows:
my_ohlc_array = jump(my_ohlc_array, 20)
Note that OHLC refers to Open, High, Low, and Close, which are standard components of historical data files.
The GRI Calculation
def gri_index(Data, lookback, high, low, where):
Data = adder(Data, 1)
for i in range(len(Data)):
try:
Data[i, where] = abs(np.log(max(Data[i - lookback + 1:i + 1, high]) - min(Data[i - lookback + 1:i + 1, low])) / np.log(lookback))except ValueError:
passreturn Data
One limitation of the GRI is its inability to indicate the direction of the trend, which requires separate analysis.
The second video illustrates how to enhance your trading strategy using the GRI, offering practical tips and insights.
Chapter 2: Developing Strategies with the GRI
The GRI can be integrated into various trend-following strategies. Here are some approaches:
- If the GRI is on the rise, it suggests the market is trending. Setting thresholds can help identify when the market is considered to be in a trend.
- A flat GRI indicates that the market is not making significant moves, where the highest point can serve as a resistance level, and the lowest point as support.
- Combining the GRI with the MACD indicator can help confirm trends. For instance, a MACD cross paired with a rising GRI can provide stronger conviction for traders.
If you are keen on exploring more technical indicators and strategies, my book could be of interest to you.
Final Thoughts
I have recently launched an NFT collection aimed at supporting various humanitarian and medical initiatives. The Society of Light consists of limited collectibles, with a portion of proceeds from each sale directed to a charity linked to the corresponding avatar. Here are some benefits of owning these NFTs:
- High Potential Gains: By focusing on marketing efforts for The Society of Light, I aim to enhance their secondary market value. Keep in mind, trading in this market also contributes a share of royalties to charity.
- Art Collection and Portfolio Diversification: Collecting avatars that represent positive causes is rewarding. Investing can serve altruistic purposes while also providing financial returns.
- Flexible Donations: This allows for customizable allocations to your preferred charitable organizations.
- Free Book Offer: Buyers of any NFT will receive a complimentary PDF copy of my latest book.
Click here to purchase an NFT and join me in supporting the fight against discrimination.