Skip to content

Algo‐Trading NVIDIA with Williams %R & MACD Indicators

Al Va edited this page Mar 26, 2024 · 3 revisions

Algo-Trading NVIDIA with Williams %R & MACD Indicators

nvidia_future

The focus of this article is still on the NVIDIA stock to ensure the most efficient execution of an algo-trading strategy by examining the Williams %R &MACD technical indicators. Williams %R moves between zero and -100. A reading above -20 is overbought. A reading below -80 is oversold. When the MACD line crosses from below to above the signal line, the indicator is considered bullish (accompanied by positive histogram bars, indicating upward momentum). The further below the zero line the stronger the signal. When the MACD line crosses from above to below the signal line, the indicator is considered bearish (accompanied by negative histogram bars, suggesting downward momentum). The further above the zero line the stronger the signal. Let’s delve into the specifics of the algo-trading workflow in Python:

  • Creating the working directory YOURPATH and importing libraries

  • Getting NVIDIA historical stock data during 01/2021–03/2024 open high low close volume datetime
    2024-03-19 867.00000 905.44000 850.09998 893.97998 67217100.0 2024-03-20 897.96997 904.09998 882.22998 903.71997 47906300.0 2024-03-21 923.00000 926.47998 904.04999 914.34998 48037200.0 2024-03-22 911.40997 947.78003 908.34003 942.89001 58521500.0 2024-03-25 940.00000 967.65991 935.09998 962.25403 40951376.0

  • Calculating and plotting the Williams %R indicator

nvda_williamsr

  • Calculating and plotting the MACD indicator

nvidia_macd

  • Calculating the Williams %RMACD (WR-MACD) trading strategy, position, daily returns, and cumulative returns nvidia_dailyreturn nvidia_cumreturn

  • Backtesting: calculating the profit gained from the WR-MACD strategy by investing $10k in NVDA Profit gained from the WR-MACD strategy by investing $10k in NVDA: 5014.22 Profit percentage of the WR-MACD strategy : 50%

  • Comparing backtest results against the SPY benchmark Benchmark profit by investing $10k : 2882.3 Benchmark Profit percentage : 28% WR-MACD Strategy profit is 22% higher than the Benchmark Profit

Conclusions

  • Considering the current trends, indicators, and patterns, the technical outlook for NVDA is bullish and overbought, with bearish momentum.
  • The MACD study has been used to identify stock buy and sell signals. When the MACD crosses above the signal line, it may be time for the longs to enter the market, whereas when a cross below the signal line occurs, it may be time for the shorts to enter the market.
  • As previously mentioned, the %R is used to measure momentum. %R oscillates within a fixed range between the values of 0 and -100. Williams himself set the parameters of overbought as any reading between 0 and -20.
  • Disclaimer: Technical Analysis is blind to the fundamentals and looks only at the trading data for NVIDIA.

References

Nikhil-Adithyan/Algorithmic-Trading-with-Python An Algo-Trading Sneak Peek at Top AI-Powered Growth Stocks — 1. NVIDIA Useful FinTech SaaS Products, Guides & Blogs for Quant Trading Deploying Streamlit Stock Fundamental Analysis App — NVIDIA Example Plotly Dash TA Stock Market App NVIDIA Rolling Volatility: GARCH & XGBoost IQR-Based Log Price Volatility Ranking of Top 19 Blue Chips NVIDIA Returns-Drawdowns MVA & RNN Mean Reversal Trading

Clone this wiki locally