You may have heard of the phrase "to catch a falling knife" before in trading, which is typically used to describe someone buying a depreciating asset over and over again despite repeated price-falls, in hopes that he is getting it at a bargain. Today we look at how this phrase it to be understood in trading as a trade made during a retracement, and what a retracement is.
Essentially, when a trader "catches a falling knife", he is making an educated trade and guessing where a retracement ends. A retracement is a technical term used to describe a minor pullback (i.e. decrease) in the direction of a financial instrument. Key to note is that a retracement should be temporary, unlike a reversal, and it should not indicate a shift in the prevailing uptrend. (Note: we can speak of positive retracements too (i.e. increases in price) but for this article, we focus on negative ones.)
Well, if you're a trader, you should always be thinking whether a dip in the price of an asset is a long-term downtrend or a temporary market blip. Selling stock in a retracement only to see it rocket upwards days later is painful, but holding onto stock in a reversal can be devastating for traders.
So to be sure what a retracement is, let's discuss in context and take a look at a real-life price chart of the Singapore stock market. Nikko AM STI ETF tracks the Straits Time Index, indicative of the Singapore market performance. Below, I generated a custom plotly chart of its prices from 5 Oct 2011 to 12 Aug 2013:
Three general rules follow:
Other than these simple chart patterns, we should look at other indicators that point toward a retracement as well:
That's about it for now, we can discuss more about what constitutes a trend reversal in future, and more complicated ways to calculate the scope of a retracement, such as Fibonacci Retracements. Python code for the chart above in full, appended below for reference:
## Loading Libraries
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import pandas as pd
import yfinance as yf
## Accessing stock price data from yfinance
sti_df=yf.download(
tickers="G3B.SI",
period="max",
interval="1d",
progress=False,
auto_adjust=True
)
## Change the "date" index into a "date" column
sti_df = sti_df.reset_index()
sti_df["Date"] = pd.to_datetime(sti_df["Date"])
## Selecting a certain period of the STI history
start_date = '2011-10-05'
end_date = '2013-08-12'
mask = (sti_df["Date"] >= start_date) & (sti_df["Date"] <= end_date)
sti_segment = sti_df.loc[mask]
sti_segment["Type"] = "General Uptrend"
## Selecting retracement periods
retrace_start1 = '2011-10-28'
retrace_start2 = '2012-04-02'
retrace_start3 = '2012-10-05'
retrace_start4 = '2013-05-22'
retrace_end1 = '2011-12-20'
retrace_end2 = '2012-06-05'
retrace_end3 = '2012-11-16'
retrace_end4 = '2013-06-25'
retrace_mask1 = (sti_segment["Date"] >= retrace_start1) & (sti_segment["Date"] <= retrace_end1)
retrace_mask2 = (sti_segment["Date"] >= retrace_start2) & (sti_segment["Date"] <= retrace_end2)
retrace_mask3 = (sti_segment["Date"] >= retrace_start3) & (sti_segment["Date"] <= retrace_end3)
retrace_mask4 = (sti_segment["Date"] >= retrace_start4) & (sti_segment["Date"] <= retrace_end4)
sti_segment["Type"][retrace_mask1] = "Retracement"
sti_segment["Type"][retrace_mask2] = "Retracement"
sti_segment["Type"][retrace_mask3] = "Retracement"
sti_segment["Type"][retrace_mask4] = "Retracement"
## Creating retracement and uptrend dataframes
sti_retracement = sti_segment.copy()
sti_retracement["Close"][sti_retracement["Type"] == "General Uptrend"] = np.nan
sti_retracement["Type"] = "Retracement"
sti_upwards = sti_segment.copy()
sti_upwards["Close"][sti_upwards["Type"] == "Retracement"] = np.nan
sti_upwards["Type"] = "General Uptrend"
## Creating final dataframe of relevant STI data
sti_merged = pd.concat([sti_retracement, sti_upwards])
## Generating an empty Plotly chart object
fig = go.Figure()
## Creating the Plotly chart object for STI prices
fig = px.line(
sti_merged,
x="Date",
y="Close",
title="Historical Prices for Nikko AM Singapore STI ETF",
color="Type"
)
fig.update_traces(connectgaps=False)
fig.update_traces(
line_width=2,
)
fig.update_layout(
xaxis_title="Date",
xaxis_gridcolor="grey",
yaxis_title="Closing Price",
yaxis_gridcolor="grey",
font_color="black",
title_font_size=20,
title_x=0.5,
paper_bgcolor='white',
plot_bgcolor='white'
)
## Create a support line
fig.add_trace(go.
Scatter(
x=["2011-10-05", "2013-08-12"],
y=[2.59, 3.13],
name='Support Line',
line=dict(dash='dash')
)
)
## Final formatting details
fig.data[0].line.color = "lightcoral"
fig.data[0].line.width = 4
fig.data[1].line.color = "black"
fig.data[2].line.color = "black"
Once you know how to identify retracements, you can move on to determine their scope and magnitude.
Find more Finalytics stories on my blog. Have a suggestion? Contact me at [email protected].