Creating a Gopalakrishnan Range Index for Trading Insights
Written on
Chapter 1: Understanding the Gopalakrishnan Range Index
In the realm of trading, certain indicators serve to identify market regimes and volatility rather than directional trends. This article delves into the Gopalakrishnan Range Index (GRI), which provides crucial insights into the market's current state.
Following the success of my previous publication, "Trend Following Strategies in Python," I have authored a new book that introduces advanced contrarian indicators and strategies. This book includes a dedicated GitHub page for ongoing code updates. If this piques your interest, feel free to explore the Amazon link below for a sample, or check the end of the article for a PDF purchase option.
Creating the GRI Index
Commonly referred to as the GAPO index, the GRI measures the relative strength of price movements by comparing the highs and lows over a specified lookback period. When the difference between the highest highs and lowest lows during this period increases, the GRI rises accordingly. Conversely, a stable reading indicates that the market has neither achieved a new high nor a new low.
Each time a new high or low is registered, the GRI adjusts its value to reflect this change, which is why it functions as a trending indicator.
# Function to add multiple 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 a specified number of columns from an index
def deleter(Data, index, times):
for i in range(1, times + 1):
Data = np.delete(Data, index, axis=1)return Data
# Function to skip a number of rows from the beginning
def jump(Data, jump):
Data = Data[jump:, ]
return Data
# Example: Adding three empty columns to an array
my_ohlc_array = adder(my_ohlc_array, 3)
# Example: Deleting two columns after the column indexed at 3
my_ohlc_array = deleter(my_ohlc_array, 3, 2)
# Example: Deleting the first 20 rows
my_ohlc_array = jump(my_ohlc_array, 20)
# Remember: OHLC refers to Open, High, Low, and Close, standard historical data
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
While the GRI is a useful tool for analyzing market trends, it does not indicate the trend's direction; that assessment is left to the trader.
Chapter 2: Developing Strategies Using the GRI
To leverage the GRI in various trend-following strategies, we can apply the following approaches:
- Identifying Trends: A rising GRI suggests a trending market, allowing us to establish thresholds for identifying market trends.
- Using Support and Resistance: A flat GRI indicates that the highest market point acts as resistance, while the lowest point serves as support.
- Combining with MACD: Pairing the GRI with the MACD indicator enhances trend confirmation. For instance, when a MACD crossover occurs alongside a rising GRI, it strengthens our confidence in the trade.
For further insights, consider my weekly market sentiment report, which evaluates current positioning and forecasts future directions across major markets using both complex and straightforward models.
Chapter 3: Conclusion
In summary, my goal is to contribute to the domain of objective technical analysis by advocating for transparent techniques and strategies that undergo rigorous back-testing before implementation. This effort aims to enhance the credibility of technical analysis, dispelling its reputation for subjectivity and lack of scientific grounding.
If you're new to trading techniques or strategies, I recommend following these steps:
- Maintain a critical mindset, free from emotional biases.
- Conduct back-testing using real-life scenarios.
- Optimize promising strategies and perform forward testing.
- Always factor in transaction costs and slippage in your evaluations.
- Incorporate risk management and position sizing into your analyses.
Even after thorough testing, remain vigilant and monitor your strategies, as market dynamics can shift, rendering a previously profitable strategy ineffective.
For those interested in the PDF version of my book, it is available for €9.99. Please provide your email address in the payment note to ensure it is sent to the correct location. Once received, remember to download it via Google Drive.
This video titled "A Complete Guide To Range Trading Strategy - Simple & Powerful" provides an in-depth exploration of effective range trading strategies.
In this video, "How To Massively Profit From Trading Ranges - My Unique Strategy," the host shares unique techniques for maximizing profits in range trading.