06 · Trade Balance and Growth¶
Objective. Measure the non-oil trade balance, its evolution between 2021 and 2025, and the growth of each trade flow, and then compare the February–September balance of 2025 and 2026.
Definitions.
- Total exports = domestic exports + re-exports.
- Trade balance = total exports − imports. A negative value is a deficit.
- Coverage ratio = total exports ÷ imports × 100, the percentage of import value financed by export value.
- Growth = year-on-year percentage change.
Annual figures use complete years (2021–2025). Oil trade is not part of this dataset, so the balance shown is the non-oil balance only.
%load_ext autoreload
%autoreload 2
import pandas as pd
import plotly.express as px
from scripts.analysis import load_trade, full_years, study_window, BASE_YEAR, CONFLICT_YEAR
from scripts.plotly_theme import use_metro, RED, BLUE, ORANGE, GREEN
use_metro()
pd.options.display.float_format = "{:,.1f}".format
TYPE_COLORS = {"import": RED, "export": BLUE, "re-export": ORANGE}
df = load_trade()
fy = full_years(df)
1. Annual balance¶
def balance_table(data, by="year"):
t = data.pivot_table(index=by, columns="trade_type", values="price_bhd", aggfunc="sum")
t = t / 1e6 # BHD millions
t["total_exports"] = t["export"] + t["re-export"]
t["balance"] = t["total_exports"] - t["import"]
t["coverage_%"] = t["total_exports"] / t["import"] * 100
return t[["import", "export", "re-export", "total_exports", "balance", "coverage_%"]]
annual = balance_table(fy)
annual
temp = annual.reset_index()
fig = px.bar(
temp,
x="year",
y="balance",
text_auto=",.0f",
color=temp["balance"] >= 0,
color_discrete_map={
True: GREEN,
False: RED
}
)
fig.update_layout(
title="Annual Non-Oil Trade Balance, 2021–2025",
xaxis_title="Year",
yaxis_title="Trade Balance (BHD m)",
showlegend=False
)
fig.update_xaxes(type="category")
fig.show()
temp = annual.reset_index()
fig = px.line(
temp,
x="year",
y="coverage_%",
markers=True
)
fig.update_layout(
title="Annual Export Coverage Ratio",
xaxis_title="Year",
yaxis_title="Export Coverage (%)"
)
fig.add_hline(
y=100,
line_dash="dash",
annotation_text="100% Coverage"
)
fig.update_xaxes(type="category")
fig.show()
2. Year-on-year growth¶
growth = annual[["import", "export", "re-export"]].pct_change() * 100
growth
temp = (
growth
.dropna()
.reset_index()
.melt(id_vars="year", var_name="trade_type", value_name="growth_%")
)
fig = px.bar(
temp,
x="year",
y="growth_%",
color="trade_type",
barmode="group",
text_auto=".1f",
color_discrete_map=TYPE_COLORS,
)
fig.update_layout(
title="Annual Growth Rate by Trade Type",
xaxis_title="Year",
yaxis_title="Growth Rate (%)",
legend_title_text="Trade Type"
)
fig.update_xaxes(type="category")
fig.add_hline(y=0, line_dash="dash")
fig.show()
# Compound annual growth rate, 2021 -> 2025
years = annual.index.max() - annual.index.min()
cagr = (annual.iloc[-1] / annual.iloc[0]) ** (1 / years) * 100 - 100
cagr[["import", "export", "re-export", "total_exports"]].rename("CAGR_2021_2025_%")
3. Balance during the 2026 conflict (February–September)¶
conflict_balance = balance_table(study_window(df))
conflict_balance
change = conflict_balance.loc[CONFLICT_YEAR] - conflict_balance.loc[BASE_YEAR]
change.rename(f"change_{BASE_YEAR}_to_{CONFLICT_YEAR}")
Findings¶
- Bahrain runs a persistent non-oil trade deficit. The deficit was smallest in 2022 (BHD −155 m), when domestic exports grew by 24.4%. It then widened each year to BHD −1,113 m (2023), −1,190 m (2024) and −1,255 m (2025).
- The deficit widened because exports fell back while imports kept rising. Domestic exports fell 21.3% in 2023 and have not regained their 2022 level (BHD 4.97 bn in 2022 vs 4.12 bn in 2025). Imports grew at a compound 3.9% per year (2021–2025), against 1.3% for total exports.
- Exports finance about 80% of imports. The coverage ratio fell from 97.3% (2022) to 79.7% in 2024 and 2025.
- The conflict reduced trade but not the coverage ratio. In February–September 2026 imports fell by BHD 1,059 m and total exports by BHD 861 m compared with the same months of 2025. The deficit for the period therefore narrowed from BHD −827 m to −629 m, but only because both flows contracted. The coverage ratio was essentially unchanged (79.6% → 79.1%). A smaller deficit in this case signals lower activity, not an improvement in the trade position.