- GuruFinance Insights
- Posts
- I Found A New Profitable Trading Strategy with Python
I Found A New Profitable Trading Strategy with Python
Apple's New Smart Display Confirms What This Startup Knew All Along
Apple has entered the smart home race with its new Smart Display, firing a $158B signal that connected homes are the future.
When Apple moves in, it doesn’t just join the market — it transforms it.
One company has been quietly preparing for this moment.
Their smart shade technology already works across every major platform, perfectly positioned to capture the wave of new consumers Apple will bring.
While others scramble to catch up, this startup is already shifting production from China to its new facility in the Philippines — built for speed and ready to meet surging demand as Apple’s marketing machine drives mass adoption.
With 200% year-over-year growth and distribution in over 120 Best Buy locations, this company isn’t just ready for Apple’s push — they’re set to thrive from it.
Shares in this tech company are open at just $1.90.
Apple’s move is accelerating the entire sector. Don’t miss this window.
Past performance is not indicative of future results. Email may contain forward-looking statements. See US Offering for details. Informational purposes only.
🚀 Your Investing Journey Just Got Better: Premium Subscriptions Are Here! 🚀
It’s been 4 months since we launched our premium subscription plans at GuruFinance Insights, and the results have been phenomenal! Now, we’re making it even better for you to take your investing game to the next level. Whether you’re just starting out or you’re a seasoned trader, our updated plans are designed to give you the tools, insights, and support you need to succeed.
Here’s what you’ll get as a premium member:
Exclusive Trading Strategies: Unlock proven methods to maximize your returns.
In-Depth Research Analysis: Stay ahead with insights from the latest market trends.
Ad-Free Experience: Focus on what matters most—your investments.
Monthly AMA Sessions: Get your questions answered by top industry experts.
Coding Tutorials: Learn how to automate your trading strategies like a pro.
Masterclasses & One-on-One Consultations: Elevate your skills with personalized guidance.
Our three tailored plans—Starter Investor, Pro Trader, and Elite Investor—are designed to fit your unique needs and goals. Whether you’re looking for foundational tools or advanced strategies, we’ve got you covered.
Don’t wait any longer to transform your investment strategy. The last 4 months have shown just how powerful these tools can be—now it’s your turn to experience the difference.
Testing a trading approach centered on the PVI indicator on Microsoft stock with the aim of surpassing the stock’s performance. The Positive Volume Index is an accumulated metric utilizing volume shifts to identify areas where institutional investors may be active.
The PVI aids in evaluating the vigor of a trend and potentially confirming price reversals, applicable not only to individual securities but also to popular market indices.
Today, I’m examining a strategy for Microsoft that incorporates the Positive Volume Indicator alongside the Relative Strength Indicator. The strategy is straightforward, highlighting the efficacy of simplicity in trading strategies and the potential for success without resorting to complex machine learning models. Let’s delve deeper!
“In the financial realm, rising volume signals optimism, propelling stock prices upward and setting the stage for prosperity.” — Richard D. Wyckoff
The Positive Volume Index Formula

When computing the Positive Volume Index (PVI) for today, we consider the chosen price series, which could be, for instance, the Close Price. If today’s volume exceeds yesterday’s volume, we employ the first formula; otherwise, we utilize the second formula.
Let’s Get In To It
1. Load packages, download data and calculate Technical Indicators.
msft_prices = pd.read_csv('path_to_the_file/msft_1hour_data.csv')
msft_prices['date'] = pd.to_datetime(msft_prices['date'])
msft_prices = msft_prices.set_index('date')
msft_prices['pvi'] = pandas_ta.pvi(close=msft_prices['close'],
volume=msft_prices['volume'],
length=20)
msft_prices['rsi'] = pandas_ta.rsi(close=msft_prices['close'],
length=20)
msft_prices['rsi_lag_1'] = msft_prices['rsi'].shift()
msft_prices

2. Define The Trading Signal Long & Short.
msft_prices['signal_1'] = msft_prices['pvi'].diff().apply(lambda x: 1 if x>1 else (-1 if x<-1 else np.nan))
msft_prices['signal_2'] = msft_prices.apply(lambda x: 1 if (x['rsi_lag_1']<50)&(x['rsi']>50)
else (-1 if (x['rsi_lag_1']>50)&(x['rsi']<50) else np.nan), axis=1)

MSFT Stock Price & 2 Signals
Here’s the strategy breakdown based on the plotted signals:
Long signals are denoted by green triangles, while short signals are represented by red triangles.
Strategy Conditions:
If Signal_1 equals 1 AND Signal_2 equals 1, we enter a LONG position.
If Signal_1 equals -1 AND Signal_2 equals -1, we enter a SHORT position.
Take Profit and Stop Loss:
Take Profit is set at 2%.
Stop Loss is set at 2%.
Intraday Expectations:
Intraday strategies typically aim to capture short-term movements, necessitating tight take profit and stop loss levels.
3. Plot the results

Returns chart

Sharpe ration: 0.92
The strategy started with a portfolio value of $100,000 and ended with a final portfolio value of $126,312, yielding approximately a 26.3% return over the past two years.
While the strategy appears promising, there’s room for enhancement. Additional filters can be incorporated to weed out unfavorable trades or refine signal conditions. Discovering effective strategies demands meticulous effort and attention to detail.
Interestingly, despite the prevailing hype surrounding Machine Learning (ML) and advanced techniques, it’s evident that a super complex model isn’t necessarily required to generate potential returns. Many individuals are keen on implementing ML strategies, assuming they can easily integrate ML into their trading strategies. However, it’s worth noting that the process is more intricate than simply relying on automated solutions like ChatGPT. Success in trading demands a comprehensive approach and a thorough understanding of market dynamics.