<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muslem Rahimi on Medium]]></title>
        <description><![CDATA[Stories by Muslem Rahimi on Medium]]></description>
        <link>https://medium.com/@muslemrahimi?source=rss-85abbeefc94a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZpAHP209pSB5WKkskWJqsQ.jpeg</url>
            <title>Stories by Muslem Rahimi on Medium</title>
            <link>https://medium.com/@muslemrahimi?source=rss-85abbeefc94a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:13:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muslemrahimi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Ultimate Beginner’s Guide to Options (Because Y’all Need to Know What You’re Buying)]]></title>
            <link>https://muslemrahimi.medium.com/the-ultimate-beginners-guide-to-options-because-y-all-need-to-know-what-you-re-buying-14c17e45e442?source=rss-85abbeefc94a------2</link>
            <guid isPermaLink="false">https://medium.com/p/14c17e45e442</guid>
            <category><![CDATA[options-trading]]></category>
            <category><![CDATA[options]]></category>
            <dc:creator><![CDATA[Muslem Rahimi]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 21:03:17 GMT</pubDate>
            <atom:updated>2026-02-23T21:03:55.696Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*KZdYW5u11rCccYQc" /></figure><p>I’ve noticed way too many people on this sub have no clue what options are or how they work. This is seriously concerning — how are we supposed to get to the moon if we don’t know how to build the rocket? So I’m writing this quick reference guide to help retail traders out, specifically the newer, younger, or less experienced traders. If you already know options, feel free to skip this. I’m keeping it as short and sweet as possible while still being comprehensive.</p><p>I love seeing gain porn, but I hate the thought of people losing their life savings, tuition money, or inheritance because they came here, saw a ticker with rocket emojis, and bought a 0 DTE call that’s 30% out of the money with everything they have. You gotta know how to play blackjack before you sit at the table.</p><h3>The Basics</h3><p>An option gives you the <strong>right</strong> (if buying) to buy (call) or sell (put) 100 shares of a stock at a specific price (strike price) on or before the expiration date. European options can only be exercised on the expiration date, but we’re dealing with American options here.</p><p><strong>Simple rules:</strong></p><ul><li>Think stock goes up? Buy calls (bullish)</li><li>Think stock goes down? Buy puts (bearish)</li><li>Think stock stays flat or drops? Sell calls</li><li>Think stock stays flat or rises? Sell puts</li></ul><p>When you buy an option, you pay a premium to the seller who’s taking on the risk of the trade.</p><p>When you sell an option, you have an <strong>obligation</strong> (not a right) to buy (if selling puts) or sell (if selling calls) 100 shares at the strike price whenever the buyer decides to exercise — this is the risky part.</p><h3>Understanding “The Money”</h3><p><strong>For Calls:</strong></p><ul><li><strong>At the Money (ATM)</strong> — Strike price equals current stock price</li><li><strong>In the Money (ITM)</strong> — Strike price is BELOW current stock price (can be exercised immediately)</li><li><strong>Out of the Money (OTM)</strong> — Strike price is ABOVE current stock price (stock must rise to be exercisable)</li></ul><p><strong>For Puts:</strong></p><ul><li><strong>At the Money (ATM)</strong> — Strike price equals current stock price</li><li><strong>In the Money (ITM)</strong> — Strike price is ABOVE current stock price (can be exercised immediately)</li><li><strong>Out of the Money (OTM)</strong> — Strike price is BELOW current stock price (stock must fall to be exercisable)</li></ul><h3>Buying Calls</h3><p>This is the most popular strategy on <a href="https://www.reddit.com/r/wallstreetbets/">r/wallstreetbets</a>. Let’s use $AAPL as our example. It’s trading at $252.31, and you believe Iphone 17 sales during Christmas will push it to $280 by year-end. You’d buy a call.</p><p><strong>What you’re seeing:</strong></p><ul><li>Strike Price — The price the stock needs to exceed for exercise</li><li>Break Even — The price needed to not lose money (Strike + Premium)</li><li>To Break Even — Percentage change required in the stock</li><li>% Change — Daily change in the option’s price (percentage)</li><li>Price — Current option premium</li></ul><p><strong>Example Trade:</strong> Let’s buy the Jan 16, 2026 $280 call for $4.65 per share. Since options control 100 shares, you pay 4.65*100*20 = $9,300 total, where 20 is the number of contracts you buy. In this case our max loss is -$9,300 and our max gain is unlimited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fo5Rs0pwWI-LMfqT" /></figure><p>Before expiration, three things can happen:</p><ul><li><strong>AAPL rises →</strong> Option value increases → Can sell anytime for profit</li><li><strong>AAPL falls →</strong> Option value decreases → Can sell anytime to limit losses</li><li><strong>AAPL trades sideways →</strong> Option loses value from time decay (theta)</li></ul><p><strong>On January 16, 2026 (expiration day):</strong></p><ul><li><strong>Stock at $300:</strong> Option is worth $20 intrinsic value ($300 — $280). Profit = ($20×100×20)–$9,300(\$20 × 100 × 20) — \$9,300($20×100×20)–$9,300 = <strong>$30,700</strong></li><li><strong>Stock at $284.65:</strong> Just above breakeven (strike + premium). You could exercise if you have capital and are still bullish, otherwise sell to minimize loss.</li><li><strong>Stock at or below $280:</strong> Option expires worthless. <strong>Max loss = –$9,300</strong></li></ul><p><strong>Selling Naked Calls</strong></p><p>If you’re neutral to bearish (say you think Samsung’s new lineup crushes iPhone 17 hype), you could sell that same $280 call.</p><ul><li>You’d receive $465 upfront per contract (since premium is $4.65 × 100).</li><li>With 20 contracts, that’s a total credit of $9,300.</li><li>If AAPL stays flat or drops, you keep it all.</li><li>If AAPL rises, you start losing money.</li></ul><p>⚠️ HUGE WARNING: Selling naked calls has UNLIMITED risk.</p><p><strong>If AAPL jumps to $300, you’re obligated to sell at $280.</strong></p><ul><li>You buy 2,000 shares at $300 = $600,000.</li><li>You sell them at $280 = $560,000.</li><li>Loss = –$40,000, minus the $9,300 premium you collected = –$30,700 net.</li></ul><p>If it goes to $310, loss balloons to –$50,700 net. Every +$10 in stock price = another $20,000 loss (because 20 contracts × 100 shares).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xAxFEFBSkMaW_el1" /></figure><p><strong>Selling Naked Puts</strong></p><p>Neutral to bullish strategy. You think AAPL will stay flat or rise, so you sell the $250 put expiring Jan 16, 2026.</p><ul><li>You collect $500 per contract upfront (premium $5 × 100 shares).</li><li>With 5 contracts, that’s a total credit of $2,500.</li><li>If AAPL rises or stays above $250, you keep the premium.</li><li>If AAPL drops below $250, you start losing money.</li></ul><p>⚠️ WARNING: Risk is capped at $250 per share (the strike price, since a stock can’t go below $0), but losses can still be substantial:</p><ul><li>If AAPL drops to $240, you must buy 500 shares at $250 = $125,000, but the stock is worth $120,000, so loss = $5,000, minus the $2,500 premium = –$2,500 net.</li><li>If AAPL drops to $200, you buy 500 shares at $250 = $125,000, but stock is worth $100,000, loss = $25,000, minus $2,500 premium = –$22,500 net.</li><li>Max loss = $25,000 — $2,500 = $22,500 if stock goes to $0.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IPQFdiKREhOMy8cW" /></figure><h3>Options Pricing</h3><p>Every option’s price has two components:</p><p><strong>Intrinsic Value</strong></p><ul><li>The “real” value if exercised right now</li><li>Formula: |Current Price — Strike Price| (for ITM options only)</li><li>OTM options have zero intrinsic value</li></ul><p><strong>Example:</strong></p><ul><li>AAPL trading at <strong>$252.31</strong></li><li>You own the <strong>$250 call</strong></li><li>Intrinsic value = $252.31 — $250 = <strong>$2.31 per share</strong></li><li>If the option costs <strong>$4.65</strong>, the difference ($4.65 — $2.31 = $2.34) is <strong>extrinsic value</strong> (time value + implied volatility premium)</li></ul><p><strong>Extrinsic Value</strong></p><p>This is affected by:</p><p><strong>Time (Theta):</strong></p><p>I made a whole separate reddit post <a href="https://www.reddit.com/r/stocknear/comments/1nnugml/why_retail_traders_keep_burning_money_on_options/">here</a> to explain the non-intuitive movements of options and why most retail traders just don’t understand how it works. But theta is one of the most common mistakes why you lose money and just dont understand why. Read my previous reddit post for more detailed answers but in short ALL options lose time value, regardless of being ITM or OTM. Even if the stock price was the same for the last 3 days your option contract can lose -20% of its initial value because of theta decay.</p><ul><li>More time to expiration = higher premium</li><li>The theta curve accelerates around the 45 day mark, see the figure below. You can see that as an option gets closer to its expiration it will lose value, regardless of if it is in or out of the money IT WILL DEPRECIATE.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_AW6W1zR5GUDRUia" /></figure><p><strong>Implied Volatility (IV):</strong></p><ul><li>Stable stocks (like $KO) = low IV = cheaper options</li><li>Volatile stocks = high IV = expensive options</li><li>Each option has different IV based on strike and expiration</li></ul><p><strong>IV Crush Warning:</strong> After earnings, volatility often drops dramatically. Your option can lose half its value even if the stock doesn’t move. BE EXTREMELY CAREFUL HOLDING THROUGH EARNINGS.</p><p><strong>Do I Have to Hold Until Expiration?</strong></p><p>Absolutely not!</p><p>You <strong>don’t have to hold until expiration</strong>.</p><ul><li>Say you buy the <strong>AAPL Jan 16, 2026 $280 call</strong> at <strong>$4.65 per share</strong>. If AAPL jumps from <strong>$252.31 to $265</strong> by next Friday, the option itself could be worth <strong>$9.00 per share</strong>.</li><li>That’s a <strong>$4.35 × 100 × 20 = $8,700 profit</strong> without ever exercising.</li></ul><p><strong>Breakeven calculations only matter if you plan to exercise at expiration.</strong> Most traders just trade the options themselves.</p><p>Because of time decay and market swings, it’s usually smarter to <strong>take profits on the option itself</strong> rather than exercising and using the shares.</p><p>Let me be very clear: <strong>YOU CAN SELL THE OPTION ANYTIME.</strong> You <strong>don’t need the stock to be above the strike price</strong> to make a profit. Even if the stock is below the strike, if the option price has jumped 20%, you can sell it to someone else and lock in gains -&gt; no exercising required.</p><p><strong>Understanding the Order Book:</strong></p><ul><li>Bid — Highest price a person is willing to pay for the option and the amount of options asking to be bought at that price</li><li>Ask — Lowest price a person is willing to sell the option and the amount of options offered to be sold at that price</li><li>Mark — Often in between the Bid and Ask, what you see on the main options tree</li><li>Previous Close — The price of the most recent option sold</li><li>High — Highest price paid during the trading day for the option</li><li>Low — Lowest price paid during the trading day for the option</li><li>Volume — number of contracts traded during the trading day</li><li>Open Interest — number of total contracts not settled</li></ul><p>Bid-Ask Spread is the different between the Bid and Ask, in this case $.19. The closer the bid ask spread, the more likely you are to get an order filled. Slippage occurs as the spread moves up or down depending on if the movement of the stock. If the stock is rising rapidly and you are trying to buy a call, by the time you enter the order the Bid-Ask Spread might have moved up dramatically, and your order might not get filled.</p><p>Open Interest is important as well. If very low open interest, Selling or Buying to close may be very difficult depending on how popular the options contract is.</p><p>The lower the open interest and the wider the Bid-Ask Spread is, the more likely you are to get fucked by market makers. They will not be willing to meet at the mark or change their bid/ask and will expect you to do it. If they are moving millions of options a day, $.10 is a lot to them and they will profit off of it.</p><p><strong>The Greeks</strong></p><p>Your new best friends (or worst enemies):</p><ul><li><strong>Delta:</strong> Option price change per $1 stock move. Calls positive, puts negative. Approaches 1.0 as option goes deeper ITM.</li><li><strong>Gamma:</strong> Rate of delta change. Explodes near the strike price</li><li><strong>Theta:</strong> Daily time decay in dollars. Always working against option buyers</li><li><strong>Vega:</strong> Sensitivity to volatility changes. Drops in vega hurt both calls and puts</li><li><strong>Rho:</strong> Interest rate sensitivity (least important)</li></ul><p><strong>Fun fact: You can calculate how much leverage you get from the option compared to normal shares from the delta</strong></p><p>Leverage = (Delta × stock price) ÷ option price</p><p>In simple terms, leverage changes over time and is not fixed. If you buy call options with 5x leverage and think you get 5 times more return for every 1% return of the stock you are dead wrong. Delta changes overtime and so does your leverage.</p><p>Delta also tells you how likely your option will expire ITM e.g. a call option with delta 0.4 means the option has 40% probability to expire ITM.</p><p>I hope this helps you actually understand what you’re buying before you YOLO. If you made it this far, I’m impressed. Now go make massive tendies and help us beat the boomer hedge funds. Our generation is revolutionizing investing and making it accessible to everyone.</p><p>Just remember — with great options knowledge comes great responsibility (to not blow up your account).</p><p>Helpful links:</p><ul><li><a href="https://stocknear.com/options-calculator">Options Calculator</a></li><li><a href="https://stocknear.com/stocks/AAPL/options">Options Activity for Stocks</a></li><li><a href="https://stocknear.com/options-flow">Realtime Options Flow Orders</a></li><li><a href="https://stocknear.com/options-screener">Options Screener to find the best option based on your custom filters.</a></li></ul><p>PS: Depending on feedback, I might write more guides.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14c17e45e442" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guide: Short-Term Volatility Strategy with Stocknear]]></title>
            <link>https://muslemrahimi.medium.com/guide-short-term-volatility-strategy-with-stocknear-428f0e6f4637?source=rss-85abbeefc94a------2</link>
            <guid isPermaLink="false">https://medium.com/p/428f0e6f4637</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[volatility]]></category>
            <category><![CDATA[earnings]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Muslem Rahimi]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 23:06:32 GMT</pubDate>
            <atom:updated>2024-12-20T23:11:13.790Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8k6_LZbrfbcV2jAOxnHhUw.jpeg" /></figure><h3>Introduction</h3><p>Today, I want to share a different use case of <strong>Stocknear</strong>: identifying highly volatile stocks that have the potential to yield substantial short-term returns. Before we jump in, it’s crucial to note that this strategy is <strong>high-risk</strong> and is based on my personal experience, which shows a <strong>65% win rate</strong>.</p><p>Effective <strong>risk management</strong> is essential, and accepting losses as <strong>statistical outcomes</strong> — not emotional setbacks — will help you stay disciplined. On average, this strategy has yielded positive returns of <strong>+15% to +30%</strong>. However, be prepared for setbacks; for example, on <strong>December 18, 2024</strong>, during the FOMC meeting, I took a <strong>-99% loss</strong> on my knockout certificates for <strong>Micron Technology</strong>.</p><h3>⚠️Disclaimer:</h3><p><em>This strategy is not beginner-friendly and is suitable only for investors with a high-risk tolerance. The information provided is for </em><strong><em>educational purposes only</em></strong><em> and should </em><strong><em>not</em></strong><em> be considered financial advice. I am </em><strong><em>not responsible</em></strong><em> for any trading decisions, outcomes, or losses incurred from using this strategy. Please conduct your own research and consult with a qualified financial advisor before making any investment decisions.</em></p><h3>Earnings-Based Volatility Strategy</h3><p>Trading around earnings announcements can be one of the most lucrative — yet challenging — strategies in the market. Here’s a comprehensive guide to navigating these high-impact events with <a href="https://stocknear.com/">Stocknear’</a>s Analysis Platform.</p><h3>Step 1: Build Your Edge Through Domain Expertise</h3><p>Smart investing starts with leveraging your unique knowledge and experiences. Just as Warren Buffett famously stays within his “circle of competence,” you’ll make better investment decisions by focusing on industries you truly understand.</p><p>Your most valuable investing insights often come from your daily life and professional expertise. Consider:</p><p><strong>Professional Knowledge</strong></p><ul><li>What industry do you work in?</li><li>Which market dynamics do you understand better than most?</li><li>What emerging trends do you spot before they become mainstream?</li></ul><p><strong>Personal Experience</strong></p><ul><li>Which products consistently impress you with their quality?</li><li>What services are you happy to pay for month after month?</li><li>Which brands do you find yourself recommending without being asked?</li></ul><p><strong>Real-World Example:</strong> If you’re a software developer, you might have unique insights into which cloud services are gaining traction, which development tools are becoming industry standards, or which AI platforms are actually delivering value versus just hype. This professional knowledge gives you an edge in evaluating tech companies that Wall Street analysts might miss.</p><p><strong>Pro Tip:</strong> The goal isn’t to know everything about every stock, but to become an expert in a specific area where you can develop a genuine competitive advantage.</p><h3>Step 2: Master the Art of Fundamental Analysis</h3><p>Understanding a company’s financial health is crucial before investing. Think of fundamental analysis as giving a company a thorough health checkup — you want to ensure all vital signs are strong before committing your capital.</p><p><strong>Revenue and Profitability</strong></p><ul><li>Track the company’s revenue growth trajectory and compare it to operating expenses</li><li>Look for expanding profit margins over time, which indicate improving operational efficiency</li><li>Pay special attention to recurring revenue streams, which provide stable, predictable income</li></ul><p><strong>Valuation Metrics</strong></p><ul><li>Earnings per Share (EPS): The company’s profit allocated to each share</li><li>Price-to-Earnings (P/E) Ratio: Helps determine if the stock is overvalued or undervalued compared to peers</li><li>Price-to-Sales (P/S) Ratio: Particularly useful for evaluating high-growth companies that aren’t yet profitable</li></ul><p><strong>Financial Health</strong></p><ul><li>Examine the debt-to-equity ratio to assess financial leverage</li><li>Review total debt levels and the company’s ability to service that debt</li><li>Check cash flow statements to ensure the business can fund its operations</li></ul><p><strong>Beyond the Numbers: Strategic Context Matters</strong></p><p>Raw numbers don’t tell the complete story. Consider Uber’s early years — while the company posted significant losses, this was part of a deliberate strategy to achieve market dominance. By investing heavily in expansion and user acquisition, Uber built an increadible network effect that competitors struggled to match.</p><p><strong>Ask yourself these strategic questions:</strong></p><ol><li>Is the company investing in growth opportunities that could lead to future profits?</li><li>Does their market position justify current spending patterns?</li><li>How does their financial profile compare to successful companies at similar growth stages?</li></ol><p><strong>Pro Tip:</strong> When analyzing fundamental data, always look at trends over multiple quarters or years rather than isolated numbers. This helps you distinguish between temporary setbacks and concerning patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*mTdwRja4OpAMjDL0ckjTNQ.png" /><figcaption>Stocknear Fundamental Data table</figcaption></figure><h3>Step 3: Leveraging Professional Analyst Insights</h3><p>Wall Street analysts, while not infallible, can provide valuable perspectives that complement your own research. Here’s how to effectively incorporate their analysis into your investment decisions.</p><p><strong>Understanding Analyst Performance</strong></p><p>Not all analyst recommendations are created equal. The best analysts typically demonstrate:</p><ul><li>Consistent accuracy in their price targets</li><li>Deep sector expertise and industry connections</li><li>A proven track record of identifying market opportunities</li><li>Clear, data-driven reasoning behind their calls</li></ul><p><strong>How to Evaluate Analyst Ratings</strong></p><p><strong>Quality Metrics</strong></p><ul><li>Track record of successful calls</li><li>Historical win rate on recommendations</li><li>Average return generated from their picks</li><li>Sector-specific expertise and focus</li></ul><p><strong>Red Flags to Watch</strong></p><ul><li>Frequent dramatic changes in recommendations</li><li>Poor timing on upgrades and downgrades</li><li>Consistently missing major market developments</li></ul><p><strong>Making Analyst Insights Actionable</strong></p><p><strong>Key Questions to Consider:</strong></p><ol><li>What specific catalysts do analysts identify?</li><li>How do their valuations compare to your own analysis?</li><li>What risks do they highlight that you might have missed?</li><li>Are there consistent themes across multiple analyst reports?</li></ol><p><strong>Beyond the Ratings</strong></p><p>Look deeper than simple buy/sell recommendations:</p><ul><li>Read the detailed analysis behind the ratings</li><li>Pay attention to changes in price targets</li><li>Consider the timing of rating changes</li><li>Watch for consensus shifts among multiple analysts</li></ul><p><strong>Pro Tips:</strong></p><ul><li>Use analyst reports as one input among many, not as your sole decision factor</li><li>Pay special attention when highly-ranked analysts disagree with consensus</li><li>Look for analysts who admit and learn from their mistakes</li><li>Consider the potential conflicts of interest in analyst coverage</li></ul><p>Remember: The best investors combine multiple perspectives — their own analysis, professional insights, and market sentiment — to make well-rounded investment decisions.</p><p>You can check out all Top Wallstreet Analyst on Stocknear:</p><p><a href="https://stocknear.com/analysts">https://stocknear.com/analysts</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ix4pnlseS0tnr_KQCdvKdg.png" /></figure><h3>Step 4: Understanding AI-Powered Market Analysis</h3><p>Modern investing increasingly leverages artificial intelligence to identify patterns and predict market movements. Here’s how to effectively incorporate Stocknear’s AI-driven insights into your investment strategy.</p><p><strong>Understanding Stocknear’s AI Scores</strong></p><p>The model processes vast amounts of historical market data to identify complex price patterns, analyze correlations across market factors, and calculate probability-based future scenarios. It generates a score from 1 (Strong Sell) to 10 (Strong Buy), with higher scores indicating a greater likelihood of a bullish outcome over the next three months.</p><p><strong>How to Use AI Scores Effectively</strong></p><p><strong>Short-Term Trading</strong></p><ol><li>Use AI scores as confirmation signals</li><li>Compare scores across similar stocks</li><li>Monitor score changes over time</li><li>Look for divergences from market sentiment</li></ol><p><strong>Pro Tips:</strong></p><ul><li>Combine AI Score insights with traditional analysis methods</li><li>Use AI scores as one of multiple confirmation signals</li><li>Remember that AI models can’t predict unexpected events</li></ul><h3>Step 5: Historical Volatility Analysis</h3><p>Understanding how a stock has behaved during past earnings events can provide crucial insights into potential trading opportunities. Here’s how to conduct thorough volatility analysis that can enhance your earnings-based trading strategy.</p><p><strong>The Power of Historical Volatility Patterns</strong></p><p><strong>Why It Matters</strong></p><ul><li>Past price reactions help calibrate expectations</li><li>Volatility patterns tend to be consistent over time</li><li>Historical moves inform position sizing decisions</li><li>Helps identify stocks with predictable behavior</li></ul><p><strong>Key Metrics to Analyze</strong></p><p>Creating Your Analysis Framework</p><ol><li><strong>Pattern Recognition</strong></li></ol><ul><li>Look for consistent reaction types</li><li>Track how long moves typically last</li><li>Monitor sector correlation effects</li></ul><ol><li><strong>Risk Assessment</strong></li></ol><ul><li>Calculate maximum adverse moves</li><li>Identify common reversal points</li><li>Understand typical stop-loss levels</li><li>Plan position sizes based on historical volatility</li></ul><p><strong>Pro Tips:</strong></p><p>Past performance doesn’t guarantee future results, but understanding historical volatility provides a framework for making more informed trading decisions during earnings season.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LnyyeQT1DR9oHdYLZY_q2g.png" /><figcaption>Past Earnings Volatility table of Stocknear</figcaption></figure><h3>Final Step: Executing Your Volatility Trading Strategy</h3><p>After thorough research and analysis, it’s time to put your strategy into action. Here’s your comprehensive execution framework to help maximize potential returns while managing risks.</p><p>Building Your Trading Action Plan</p><p><strong>Pre-Trade Checklist</strong></p><ul><li>Compile all your analysis findings</li><li>Verify earnings announcement timing</li><li>Set clear entry and exit points</li><li>Determine position size based on risk tolerance</li><li>Prepare contingency plans for different scenarios</li></ul><p><strong>Position Sizing Strategy</strong></p><p><strong>Start Conservative</strong></p><ul><li>Begin with smaller positions to test your strategy</li><li>Use only risk capital you can afford to lose</li><li>Consider limiting initial trades to 1–2% of your portfolio</li><li>Scale positions based on proven success</li></ul><p><strong>Risk Management Framework</strong></p><p><strong>Define Your Parameters</strong></p><ol><li>Maximum loss per trade</li><li>Profit-taking targets</li><li>Position holding periods</li><li>Stop-loss levels</li><li>Risk-to-reward ratios</li></ol><p><strong>Setting Realistic Expectations</strong></p><p><strong>Target Returns</strong></p><ul><li>Focus on consistent small wins rather than home runs</li><li>Consider historical volatility ranges</li><li>Account for market conditions and sector trends</li><li>Be prepared to adjust targets based on experience</li></ul><p><strong>Exit Strategy Components</strong></p><p><strong>Profit Taking</strong></p><ul><li>Scale out of positions systematically</li><li>Set multiple price targets</li><li>Consider trailing stops for winning trades</li><li><strong>Don’t get greedy</strong> — stick to your plan</li></ul><p><strong>Loss Management</strong></p><ul><li>Honor your stop-losses</li><li>Avoid averaging down on losing positions</li><li>Learn from each trade — keep detailed records</li><li>Maintain emotional discipline</li></ul><p><strong>Pro Tips:</strong></p><ul><li>Document every trade decision and outcome</li><li>Review and analyze your performance regularly</li><li>Adjust your strategy based on actual results</li><li>Stay patient — consistency beats aggressive trading</li></ul><p><strong><em>Remember:</em></strong> The most successful traders aren’t those who make the biggest gains on single trades, but those who consistently execute well-planned strategies over time.</p><p>Success in volatility trading comes from disciplined execution, careful risk management and continuous improvement of your strategy. Take your time, trust your analysis and always prioritize your initial plan over aggressive returns.</p><h3>❤️ Discover More on Stocknear</h3><p>If you found this post insightful, the whole strategy and all the data used are available on <a href="https://stocknear.com/"><strong>Stocknear</strong></a>. Stocknear is a 100% open-source platform dedicated to helping investors with comprehensive tools for stock discovery, options analysis and more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=428f0e6f4637" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Most Important Concept in Finance]]></title>
            <link>https://muslemrahimi.medium.com/the-most-important-concept-in-finance-6a129e7e3076?source=rss-85abbeefc94a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a129e7e3076</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[risk-management]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[diversification]]></category>
            <category><![CDATA[trading-tips]]></category>
            <dc:creator><![CDATA[Muslem Rahimi]]></dc:creator>
            <pubDate>Wed, 17 Apr 2024 19:28:59 GMT</pubDate>
            <atom:updated>2024-04-17T19:28:59.310Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*REFNF8c8Kb-pLH1Ie71aZg.png" /><figcaption>Everyone will lose eventually. Learn how to cut the loss quickly.</figcaption></figure><p>You may have heard that Danny Kahneman died on March 27th, aged 90. Today, we will talk about his best idea and why it is so vital for long-term investors.</p><p>Kahneman (and his late research collaborator Amos Tversky) pioneered the study of cognitive biases and heuristics, revolutionizing our understanding of human decision making. Their research, notably in <strong>Prospect Theory</strong>, has had a significant impact on subjects as diverse as economics and public policy. They received a <strong><em>Nobel Prize</em></strong> for their efforts.</p><h3>What’s Prospect Theory?</h3><p>Prospect theory, also known as “<strong>loss aversion</strong>,” revolutionized conventional thinking.</p><p>Before prospect theory, economists largely adhered to “rational choice theory,” assuming that individuals consistently made decisions to maximize their utility through rational calculations. This theory presumed stable preferences, perfect information and consistent decision-making. It portrayed humans as rational actors consistently seeking the highest satisfaction or utility.</p><p>However, humans are inherently imperfect and prone to irrational behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*WwnNG-iMO1aCwl3XSQ2CCA.jpeg" /></figure><p>Recognizing these human tendencies, Kahneman (and Tversky) developed prospect theory.</p><p>They proposed that individuals evaluate potential gains and losses in comparison to a reference point, exhibiting a tendency to place greater weight on losses than equivalent gains, a phenomenon termed <strong>loss aversion</strong>. Additionally, prospect theory introduced the notion of “diminishing sensitivity,” wherein the perceived value of gains and losses diminishes as their magnitude increases. For instance, winning <strong>$1000</strong> does not feel <strong>10x</strong> as rewarding as winning <strong>$100</strong>, despite rational expectations.</p><p>His research asked, then answered, questions like:</p><ul><li><strong>Why do we sell our winners too soon and hold onto our losers too long?</strong></li><li><strong>Why don’t we expect occasional “hot streaks” to happen randomly (like 5 heads coin flips in a row)?</strong></li><li><strong>Why will we say yes to a risk with an 80% chance of success, but say no when asked instead if we’d incur the same risk with a 20% chance of failure?</strong></li><li><strong>Why is money lost not the same as money gained?</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*s4-HBtP_TVgRRlkUpnFZuw.png" /></figure><p>Prospect theory is a fundamental truth of the human condition. But why should the long-term investor care?</p><p>Money is deeply intertwined with our emotions. It can evoke feelings of joy, security, greed, or despair. These emotional reactions often lead to irrational financial decisions.</p><p>Losses can be particularly difficult, making us fearful, risk-averse, and prone to panic. In response, many investors overreact by making changes to their portfolios at the worst possible times.</p><h3>Prospect Theory and The Long-Term Investor</h3><p><strong><em>If you’re a long-term investor, you need to understand prospect theory.</em></strong></p><p>It’s a flaw, indeed. We tend to place undue emphasis on losses, an irrational quirk inherent in every individual. This flaw infiltrates our minds, subtly influencing our thoughts and decisions, whispering:</p><ul><li>“Your portfolio is down. <em>Maybe hold it longer and it will be up again...</em>“</li><li>“Your portfolio is down. <em>Time to panic and sell everything.”</em></li><li><em>“…run away and then </em><strong><em>never</em></strong><em> subject yourself to this again.”</em></li><li><em>“…do something (even though it’s suboptimal), and do it </em><strong><em>now!</em></strong><em>“</em></li></ul><p>When Emmanuel Kant, Socrates and the Oracle at Delphi each echoed the sentiment “<strong>Know thyself</strong>” the stock market likely wasn’t their focus. Yet, they spoke to the essence of understanding human flaws. To know your flaws is the first step to overcoming them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*_hlUHLBs6FeJQVQoVYcSyw.jpeg" /></figure><p><strong>Loss aversion</strong> is a crucial problem that investors should be aware of and should be addressed from day one.</p><h3>How to Fight Against Loss Aversion!</h3><p>The ability to deal with losses is what separates successful investors from unsuccessful investors. You’re in trouble if losses cause you to overreact or make big mistakes at the worst possible moments.</p><p>The tendency to “sell to survive” in the face of losses is not a good investment strategy. But how can we proactively combat our natural loss aversion?</p><p>The key is to make allocation decisions with our irrationality in mind. As Kahneman and Tversky’s research has shown, the pain of loss is often twice as acute as the joy of winning. Recognizing this inherent bias is the first step.</p><h3>Counteracting Loss Aversion</h3><p>To counteract loss aversion, we need to consciously override our emotional reactions. This means sticking to a well-thought-out investment plan, even when losses occur. It’s about maintaining discipline and not letting fear drive our decision-making.</p><h3>The Importance of Perspective</h3><p>Keeping the big picture in mind is also crucial. Short-term losses are inevitable, but a long-term, diversified approach can help smooth out the volatility. Remembering that losses are a normal part of investing, not a personal failure, can also help us stay the course.</p><p>Enter diversification. Diversification’s fundamental benefit is reducing portfolio risk (pain) while maintaining portfolio reward.</p><p>The perfectly rational investor knows the losses are temporary and would stomach the larger loss from 100% stocks to achieve larger gains. But we’re flawed and monkey-brained. We care too much about losses. For many investors, the 90/10 portfolio is easier to stomach and stick with, i.e. 90% should be invested in less volatile assets such as ETFs and 10% and more risky stocks. While irrational, that’s reality; that’s the world we live in. That’s why Kahneman and Tversky’s work is impactful.</p><h3>The “Scar tissue” that we all carry with us</h3><p>Loss aversion can lead to persistent behavioral patterns, like avoiding investing after a negative experience. Consider those who suffered heavy losses during events like the GameStop saga or Enron’s collapse. Some concluded, “Stocks are too risky; I’m done with investing.” Less dramatic instances also occur, such as investors witnessing significant declines during market downturns like the Dot Com bubble burst or the Great Financial Crisis.</p><p>For some, one bad experience is enough to keep them out of the market indefinitely, leaving their money idle. This is far from ideal. I’d prefer to see investors maintain a steady, albeit conservative, portfolio mix throughout their investing journey rather than reacting impulsively to losses and retreating entirely. While a 90/10 portfolio might be overly cautious for some, it acknowledges the reality of loss aversion and helps mitigate its impact.</p><h3>❤️ Enjoyed the Blog Post</h3><p>If you found this blog post helpful and would like to receive more content like this in the future, I would greatly appreciate it if you could show your support by clicking on the clap icon and following me. Your feedback and encouragement will help me continue to create valuable content. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a129e7e3076" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How the Stock Market is Corrupted by Market Makers]]></title>
            <link>https://muslemrahimi.medium.com/how-the-stock-market-is-corrupted-by-market-makers-046533a0db52?source=rss-85abbeefc94a------2</link>
            <guid isPermaLink="false">https://medium.com/p/046533a0db52</guid>
            <category><![CDATA[market-makers]]></category>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[gamestop]]></category>
            <category><![CDATA[wall-street-bets]]></category>
            <dc:creator><![CDATA[Muslem Rahimi]]></dc:creator>
            <pubDate>Sat, 04 Nov 2023 12:48:48 GMT</pubDate>
            <atom:updated>2023-11-04T18:56:49.357Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve explored the stock market, you’ve probably heard of “Market Makers.” In this article, we’ll break down what Market Makers are and discuss why they faced allegations of corruption during the GameStop Rally.</p><p>When you’re buying a stock, you’ll come across something called the bid-ask price spread. It’s made up of the bid price, which is the highest price a buyer is willing to pay for a share and the ask price, which is the lowest price a seller will accept for a share. For example, if you want to buy Apple stock at $100, the bid price is $99.8, and the ask price is $100.2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SSaQNftX_6Xv-U-nTrXvzQ.png" /></figure><p>In this case, the spread amounts to $0.4, calculated as $100.2 (ask price) minus $99.8 (bid price). Stock prices are affected by the forces of supply and demand. When there are more buyers, you’ll see an increase in bid prices and when more sellers are involved, there will be more offers or asks.</p><h3>Who makes the bid-ask spread?</h3><p>Who determines the bid-ask spread? In theory, it’s shaped by the supply and demand created by retail and institutional investors. You can only buy a stock if there’s a seller, and you can only sell if there’s a buyer. However, in practice, this system isn’t foolproof. On one side, we have long-term investors who buy and hold onto their stocks, while on the other, we have apes who are going all-in or all-out. So, how can we guarantee fair prices for everyone in this chaotic system to buy and sell stocks? Let me introduce you to Market Makers…</p><h3>What Is a Market Maker?</h3><p>A Market Maker is a company or person who soley buys and sells stocks to fullfill the supply and demand principle. But wait.. why would anyone wanna do that and how can they make a profit with this? The only catch for Market Makers is that they need to hold onto their positiion, but they make their money from the price difference. Their entire strategy revolves around buying and selling stocks to ensure stocks remain liquid and capitalize on the spread. <br> <br> Coming back from our previous example if the spread of Apple is $0.4 that means for them they make a profit of $0.4 for each trade. Sounds not that much right…? <br> <br> The real trick to Market Makers’ profits lies in the sheer volume of trades they execute — they buy and sell millions of stocks. In our example, this would translate to a profit of $0.4 multiplied by 10⁶, which amounts to a substantial $400,000.</p><h3>What is the connection between Robinhood and Market Makers?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mPUPjArizx393R0jQSDJjg.jpeg" /></figure><p>You’re undoubtedly familiar with the GameStop Rally saga, which resulted in a spectacular short squeeze, sending the stock price to the moon. Additionally, you may recall that one of the major trading platforms suddenly restricted the purchase of $GME stocks. Robinhood justified their actions by stating they aimed to safeguard shareholders and the company. <br> <br> Robinhood’s behavior seemed strange to many. How can you stop people from trading a company’s stock when free markets don’t allow it? This is not just the wrong thing to do but also illegal, a point we’ll discuss in a moment. <br> <br> Understanding Robinhood’s partnership sheds light on the whole scenario. Ever wondered how Robinhood manages to offer zero-commission trading at such low costs? A major reason is that one of the largest Market Makers paid Robinhood a whopping $100 million to be their exclusive Market Maker. Yes, you heard that right. Instead of Robinhood paying the Market Maker, it’s the other way around. <br> <br> Now, you might be wondering why this is the case. From a conventional perspective, it’s quite clear: whoever controls the supply and demand pipeline essentially controls the market. <br> <br> So, who is this Market Maker, you ask? Well, it’s Citadel Securities, the same name that might ring a bell as a well-known hedge fund. While, on the surface, these two entities may seem separate, the reality reveals a significant connection — Kenneth C. Griffin is the founder and majority owner of both Citadel Group and Citadel Securities. <br> <br> I’m pretty confident that Citadel’s Market Makers won’t be spilling the beans to their hedge fund pals at Citadel. Pinky promise!</p><p>Much like the tale of FTX and Alameda Research, where both companies share the same owner, Sam Bankman-Fried, proudly declared, “Both my companies, FTX and Alameda Research, are entirely separate entities.” So, there’s credibility to his statement. It’s not as if he’s committed any crimes or ended up behind bars.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dy3Am5Ds2uIP17iBz5CFyg.jpeg" /></figure><p>Throughout the entire GameStop short-squeeze rally, a prominent hedge fund by the name of Melvin Capital took a substantial blow. The hit was so severe that their recovery seemed unlikely, and it was apparent that they would face significant losses (a welcome outcome for r/WSB). However, Citadel Group made a surprising move by coming to Melvin Capital’s rescue. They invested a whopping $2.75 billion in exchange for non-controlling revenue shares of the fund. <br> <br> Do you understand now why Robinhood stopped retail investors to buy more Gamestop stocks? Because the Market Makers Citadel did not want to hurt the bottom line of their Citadel Hedge Fund Boss. <br> <br> This was one of the most blatant instances of power abuse and stock market corruption, yet it was revealed by r/WallstreetBets’s diamond-handed apes rather than insiders or investigative journalists. The world was shown by a group of redditors just how fucking corrupt the market is. The moment the wealthy began to lose money and the middle class/poor began to gain it, the trading halted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*cWHjOU3Fs1jXYI8cYfPKTQ.jpeg" /></figure><p>What we witnessed during the GameStop Rally was just a brief glimpse into the deep-seated corruption that occurs behind the closed doors of these hedge funds. It’s essential to understand that the GameStop event was not an isolated incident; it merely shed light on the business-as-usual practices of these corrupt individuals, which we had the chance to witness for the first time. <br> <br> <br> In the wake of all the scandals and corruption, Robinhood and Citadel Securities found themselves summoned before a congressional committee. In this grand spectacle, our ever-vigilant legislators played the role of diligent truth-seekers, aiming to extract the evidence needed to firmly, and finally, put these companies behind bars and ensure that justice was served. <br> <br> And what did we get as a result? Well, let’s just say, it was a resounding nothing! <br> <br> Let me leave you with this thought: at <a href="https://stocknear.com/">stocknear,</a> we remain committed to fueling the flame of resistance against the big Hedge Funds. Our mission is to empower and support small investors in making profitable trades, ensuring that every success achieved chips away at the profits of those corrupted firms. Join us in our quest to level the playing field and let the small investors triumph in the market. Together, we’ll continue to stand up against the status quo, striving for a fair and just financial world. Learn more on our website and become part of this movement for change.</p><h3><strong>Key Takeaways</strong></h3><ol><li>Market makers play a crucial role in ensuring trade execution and maintaining liquidity in financial markets.</li><li>Citadel Securities paid a significant $100 million to secure its role as Robinhood’s Market Maker.</li><li>Citadel Securities, the Market Maker, and Citadel Group, the hedge fund, appear as separate entities, but both are (in)directly founded and owned by Kenneth Griffin.</li><li>Citadel Group’s hedge fund had a hand in influencing GameStop orders to aid Melvin Capital during the short squeeze, ultimately coming to their financial rescue.</li><li>The WallStreetBets community uncovered a significant conflict of interest involving the Citadel Market Maker, revealing its corrupt influence on the stock market in support of their Citadel Hedge Fund.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=046533a0db52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My PhD Diary: The First 3 Months]]></title>
            <link>https://muslemrahimi.medium.com/my-phd-diary-the-first-3-months-eba6446f8b6d?source=rss-85abbeefc94a------2</link>
            <guid isPermaLink="false">https://medium.com/p/eba6446f8b6d</guid>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[phd]]></category>
            <dc:creator><![CDATA[Muslem Rahimi]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 12:46:39 GMT</pubDate>
            <atom:updated>2023-03-15T13:16:26.308Z</atom:updated>
            <content:encoded><![CDATA[<p>Follow my journey as I completed a three-year PhD program in physics, sharing personal experiences and the valuable lessons I’ve learned along the way.</p><h3>Why the series?</h3><p>Throughout this series of blog posts, I aim to share my personal experience and unique insights into the PhD path in theoretical physics. From the initial stages of choosing my research topic, all the way up to the final stages of defending my thesis, I will provide tips and advice to help you navigate this journey.</p><p>Whether you’re currently a PhD student or considering pursuing one, my ultimate goal is to provide valuable insights that will help you achieve success and maximize your PhD experience. I hope to provide you with practical advice that will reduce the risk of depression and burnout to a minimum in order to fully enjoy the ride and make the most of this unique journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*orAcShMOJTCOjH-_" /></figure><h3>Background</h3><p>In October 2019, I embarked on a journey towards a PhD in theoretical particle physics. This field had always piqued my curiosity, especially after attending the lectures “Introduction to Quantum Field Theory” and “Advanced Quantum Field Theory” during my master’s program in Munich. Although the lectures were fascinating, they were also quite intimidating, with their hardcore mathematical content. Among the physics students, “theoretical lectures” were considered to be very difficult and not a popular career choice for most students.</p><p>However, the idea that all you needed was a laptop, pen and paper to understand nature was mind-blowing to me. As someone who is already an introvert and doesn’t go out much, the idea of sitting in front of a desk and calculating things seemed like a lot of fun. I was excited to pursue this field and learn more about it through my PhD program.</p><h3>But why Theoretical Physics ?</h3><p>In a future blog post, I will delve into the details of theoretical particle physics and what it involves. For now, in a nutshell, it is the study of how fundamental particles in the universe interact with each other. But why do we need to research this? Well, by understanding the evolution of the building blocks of the universe, we can gain insights not only into our immediate surroundings but also the broader evolution of the universe as a whole. At its core, the study of these fundamental interactions allows us to gain a better understanding of how nature functions on the most fundamental level.</p><p>The particles that make up almost the entire universe are collectively known as the <a href="https://en.wikipedia.org/wiki/Standard_Model">Standard Model</a>. Through the study of theoretical particle physics, we can explore the interactions of these particles and gain a deeper understanding of the universe we inhabit.</p><h3>First Day</h3><p>On my first day as a PhD student, my supervisor introduced me to the potential projects for my doctoral research. It came as a surprise to me that a PhD could involve a single substantial project known as <strong>monographic</strong> dissertation or several smaller ones known as <strong>cumulative </strong>dissertation. Each path has its own pros and cons to consider.</p><p>Opting for a big project means that your work could have a significant impact on the academic community, potentially acquiring high citation rates upon completion. However, the downside is that it may take several years to finish, and failure to do so could result in wasted time and resources a.k.a. depression.</p><p>On the other hand, undertaking multiple smaller projects could result in faster progress and the chance to explore different research areas. The downside, however, is that these projects may not necessarily have a groundbreaking impact and may not accumulate as many citations.</p><p>Regardless of the chosen path, it’s important to recognize that each PhD journey is unique and should be tailored to your goals and interests. It’s crucial to consider both the potential impact and feasibility of the project(s) before beginning on your research journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*CC1Ai9Fbfs8RLpca.jpg" /></figure><h3>My Choice</h3><p>For me, the path to a cumulative dissertation was the clear choice because I am passionate about exploring a diverse range of research fields rather than concentrating on a single problem. However, earning a cumulative PhD is also incredibly challenging. Depending on the regulations of your faculty’s examination committee, you may be required to publish a minimum number of papers before submitting your cumulative dissertation. In my case, I had to publish at least four papers in an international, peer-reviewed journal in order to meet the requirements for acceptance.</p><p>Publishing papers is a crucial part of your academic journey. However, the process of completing and publishing a paper is not always straightforward. From my own experience, a “small project” can take anywhere from 6 to 18 months to finish it. Sometimes, what appears to be a small project can turn into a much larger endeavor, requiring additional months of work.</p><p>To address this challenge, I found that working on multiple projects simultaneously was an effective solution. This approach allowed me to make progress on different projects and ensure that I always had something to work on, regardless of the roadblocks encountered in any one project.</p><h3>But!!!</h3><p>Don’t take on too many projects at once. It’s tempting to take on as many projects as possible, especially when you’re passionate about your work. But be careful not to fall into the rookie mistake of juggling too many projects at the same time. I learned this the hard way during my PhD, when I was working on five different projects simultaneously. The result? High pressure, burnout, and ultimately, depression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*azy1SPxgz5O2ndD1.jpg" /></figure><p>To avoid making the same mistake, I recommend limiting yourself to two or three projects at most. Taking on too many projects can lead to low productivity and motivation, making it difficult to give each project the attention it deserves.</p><p>Remember, quality is more important than quantity. So resist the urge to take on too much, and instead, prioritize your projects wisely. Your mental health and productivity will thank you for it!</p><h3>Do you even have a choice ?</h3><p>It’s important to note that not all supervisors offer their students the freedom to choose their own research path. In many cases, supervisors direct their students towards a pre-existing project that their research group has been working on for a year or more, essentially treating the student as an additional labor worker in the project. This can limit your ability to explore your own research interests and pursue projects that align with your career goals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*p2TirYMd5SbRzeNg.jpg" /></figure><h3>Communicate your concerns. Nobody can read your mind !</h3><p>Therefore, it is crucial to have an open and honest conversation with your potential supervisor about the research projects available to you before accepting a PhD position. This way, you can avoid any unpleasant surprises.</p><p>Unfortunately, I’ve witnessed fellow PhD students who were working on projects that didn’t align with their interests or goals. They didn’t stand up for themselves, assuming that their professors knew best. As a result, they experienced low productivity rates, depression, and burnout.</p><p>To avoid this situation, it’s essential to be honest with yourself and have an open discussion with your supervisor. If you find yourself uninterested in a particular project, communicate your feelings and request to work on something more appealing to you. A good supervisor will listen to your needs and work with you to find the right project that aligns with your goals and interests.</p><p>Remember, a PhD journey is a long and challenging road, but it doesn’t have to be miserable. Pursuing projects that ignite your passion and curiosity can make all the difference. Don’t be afraid to speak up and advocate for yourself — your mental health and overall well-being are just as important as your academic success.</p><h3>The First 3 Months</h3><p>With the bureaucracy and project selection process behind me, the real journey towards earning my PhD began. My supervisor and I agreed on a project, and we started planning. As with any new endeavor, the first step was to immerse myself in the topic. I spent my first 3 months reading extensively — not just books, but also older and newer papers related to the specific problem my project aimed to solve. This allowed me to gain a better understanding of the current state of the field.</p><p>My focus during this time was on learning and applying what I had read. This involved a great deal of computation, as I worked to reproduce the results of the papers I had studied. Whenever I struggled to reproduce a result or didn’t fully understand a concept, I reached out to my professor for guidance and support. This stage of the journey was challenging, but also incredibly rewarding as I began to build a solid foundation of knowledge in my field.</p><h3>Questions and more Questions…</h3><p>It’s common to have a lot of questions at the start of learning something new. However, it’s important to remember that your supervisor is likely very busy and has limited time to spare. Therefore, it’s essential to ask the right questions . The right questions are typically not question that solves the problem on the spot but rather questions where your professor understand your problem, understand your current approach and then discusses with you how your approach is going wrong or gives you a new idea to solve the issue. Avoid lengthy introductions and questions that involve long calculations, as these are unlikely to be answered in a short amount of time.</p><p>This process may take time and involve multiple cycles of discussion and calculation, but it’s essential for making progress in your research. Don’t be afraid to ask questions, but be mindful of your supervisor’s time and focus on asking questions that will move your research forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*zWEYaRulEjoeJBwu.jpg" /></figure><p>I know that it is quite common to encounter complex problems that require in-depth understanding and analysis. While it may be daunting to articulate your questions, take it as an opportunity to practice breaking down complicated problems into concise and clear ones that your colleagues and supervisor can understand. This skill of simplifying things is essential in the research field, enabling you to communicate effectively with others in and outside your field, receive helpful insights, and move forward with your research.</p><h3>Conclusion</h3><ul><li>Have an honest conversation with your potential supervisor about the projects they’re working on and whether they align with your interests.</li><li>Decide whether a monographic or cumulative dissertation suits your personality better, and ask your supervisor if you have a choice.</li><li>Don’t be afraid to communicate with your supervisor if you’re struggling with a project or if you’re not interested in a particular area of research.</li><li>In the early months of your PhD, plan to spend time reading and studying the relevant literature in your field.</li><li>Ask plenty of questions, but be sure to focus on the right ones that will help push your research forward.</li></ul><h3>What’s next ?</h3><p>Thanks for reading about my PhD journey so far! I hope this post gave you some insights into what it’s like to start a PhD program and the challenges that come with it. I’m excited to share more about my experiences in future blog posts, where I’ll take you through my process step-by-step for different stages of the program. Whether you’re considering pursuing a PhD or just curious about the process, I hope my posts will be helpful and informative. Stay tuned for more!</p><h3>❤️ Enjoyed the blog post</h3><p>If you found this blog post helpful and would like to receive more content like this in the future, I would greatly appreciate it if you could show your support by clicking on the clap icon and following me. Your feedback and encouragement will help me continue to create valuable content. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eba6446f8b6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stock Price Prediction with Regression Models]]></title>
            <link>https://muslemrahimi.medium.com/stock-price-prediction-with-regression-models-365487c48809?source=rss-85abbeefc94a------2</link>
            <guid isPermaLink="false">https://medium.com/p/365487c48809</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[stock-price-prediction]]></category>
            <category><![CDATA[regression-modeling]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[stock-market]]></category>
            <dc:creator><![CDATA[Muslem Rahimi]]></dc:creator>
            <pubDate>Sat, 11 Mar 2023 13:49:37 GMT</pubDate>
            <atom:updated>2023-03-20T16:06:27.862Z</atom:updated>
            <content:encoded><![CDATA[<p>Build different regression models to forecast future stock prices.</p><p>In this blog post, I will demonstrate how to use different regression models to forecast the close prices for the next 30 days. To assess their accuracy, we will test the models by comparing the predicted prices to the actual values from past dates. The full code can be in my<a href="https://github.com/MuslemRahimi/regression_models"> github repository</a>.</p><p>To experiment with stock price prediction without worrying about configuring the code to run on your local machine, simply visit my website. Everything is pre-coded and ready to use out of the box, allowing you to begin forecasting stock prices immediately.</p><p><a href="https://stocknear.com/">https://stocknear.com</a></p><p><em>Disclaimer:</em></p><p>Please be advised that the following information does not constitute investment advice, nor am I a qualified financial advisor. It is important to understand that when analyzing data, the mere existence of a particular outcome does not necessarily prove causation. Therefore, please approach any information you read here with a healthy dose of skepticism. Nevertheless, I encourage you to enjoy the process of experimenting with and exploring these concepts. Remember, learning is always valuable regardless of the outcome.</p><h3>Getting dataset</h3><p>To obtain your favorite stock data we can use the library yfinance. In this example we will predict the price of the stock “AMD”.</p><pre>import yfinance as yf<br><br>ticker = &#39;AMD&#39;<br>start_date = datetime(2010,1,1)<br>end_date = datetime.now()<br>df = yf.download(ticker, start=start_date, end = end_date, interval=&quot;1d&quot;)<br>df = df.reset_index()</pre><h3>Normalize your data</h3><p>Data normalization is essential for the effective performance of most machine learning algorithms. To normalize data and achieve optimal results, we can use the MinMax() function from the sklearn library, which scales the data within a range of 0 to 1.</p><pre>from sklearn.preprocessing import MinMaxScaler<br><br>dates = self.data[&#39;Date&#39;]<br>df = self.data[&#39;Close&#39;]<br>scaler= MinMaxScaler(feature_range=(0,1))<br>#scaler = StandardScaler()<br>df=scaler.fit_transform(np.array(df).reshape(-1,1))</pre><p>Alternatively you can also choose StandardScaler() to see if you can get better results :).</p><h3>Split your data</h3><p>To ensure the accuracy and effectiveness of our model, we’ve divided our data into separate training and test sets — a widely accepted best practice in the field. In this specific instance, I’ll be dividing the dataset into 95% training data and 5% test data, but feel free to adjust the ratio to better suit your needs.</p><pre>test_size = 0.05 # 5 % of all the data is the test data<br>test_split_idx = int(df.shape[0]*(1-test_size))<br>train_data = df[:test_split_idx].copy()<br>test_data = df[test_split_idx:].copy()</pre><h3>Prepare your data</h3><p>In order to train our model, we must rely on input data — also known as “features” — to accurately predict desired outcomes, or “labels.” In this specific case, we’ll be using the close price of the last 10 days, as represented by the variable “lookback” in the code snippet below, as our features.</p><p>The ultimate objective is to predict the price for the following day. To accomplish this, we define the function “create_dataset( … )” that can effectively prepare the dataset and properly extract dataX (features) and dataY (labels).</p><pre><br>lookback = 10<br><br>def create_dataset(dataset):<br>    dataX, dataY = [], []<br>    for i in range(len(dataset)-lookback-1):<br>        a = dataset[i:(i+lookback), 0]<br>        dataX.append(a) #features<br>        dataY.append(dataset[i + lookback, 0]) #labels<br>    return np.array(dataX), np.array(dataY)<br><br><br>X_train, y_train = create_dataset(train_data)<br>X_test, y_test = create_dataset(test_data)</pre><p>By following these steps, we now have fully prepared datasets that can be utilized in our model.</p><h3>Pick a model and let it train</h3><p>There are many regression models available in the market, which offer us a wide range of choices to select from. With such a diverse selection of models at our disposal, we have the opportunity to choose the most suitable one that meets our specific needs and requirements.</p><p>Linear regression is one popular choice. Training a machine learning model has become increasingly simplified in recent times, as demonstrated by the following code, which is self-explanatory and requires only three lines of code:</p><pre>from sklearn.linear_model import LinearRegression<br><br>model = LinearRegression()<br>model.fit(X_train,y_train)</pre><h3>Test your model</h3><p>It is always important to evaluate the performance of your model during the training phase and to test it with new, unseen data that was not utilized during training.</p><p>This allows for a comprehensive assessment of the model’s ability to generalize and make accurate predictions beyond the data it was trained on.</p><pre>#====Start-Testing====#<br>train_predict=model.predict(X_train)<br>train_predict = train_predict.reshape(-1,1)<br>test_predict=model.predict(X_test)<br>test_predict = test_predict.reshape(-1,1)<br><br>#Denormalize your data to get back to the old form close price<br>train_predict = scaler.inverse_transform(train_predict)<br>test_predict = scaler.inverse_transform(test_predict)<br>original_ytrain = scaler.inverse_transform(y_train.reshape(-1,1)) <br>original_ytest = scaler.inverse_transform(y_test.reshape(-1,1)) <br><br>metric = metric_score(original_ytrain, train_predict, original_ytest, test_predict)</pre><p>In the last line of code, the function “metric_score( … )” is called, providing a quantitative evaluation of the model’s performance during training and testing. This evaluation is based on calculated variance and r2 scores, as demonstrated in the code below.</p><pre>from sklearn.metrics import explained_variance_score,r2_score<br><br>def metric_score(original_ytrain, train_predict, original_ytest, test_predict):<br>  res = pd.DataFrame(index=[&#39;metrics&#39;])<br>  res[&#39;train_variance_score&#39;] = explained_variance_score(original_ytrain, train_predict)<br>  res[&#39;test_variance_score&#39;] = explained_variance_score(original_ytest, test_predict)<br><br>  res[&#39;train_r2_score&#39;] = r2_score(original_ytrain, train_predict)<br>  res[&#39;test_r2_score&#39;] = r2_score(original_ytest, test_predict)<br>  res=res.reset_index(drop=True)<br>  return res</pre><p>If you’re wondering about the variance score and r2 score, here’s a simple explanation that should answer your question.</p><p><strong>explained_variance_score:</strong></p><p>The variance score in regression quantifies the extent to which the independent variables (used for prediction) explain the variance in the dependent variable (the variable being predicted).</p><p>It is computed as the ratio of the predicted values to the variance of the actual values. However, it’s crucial to bear in mind that the variance score is only a measure of the model’s ability to fit the training data and not indicative of its performance on unseen data. In short, a variance score closer to 1.0 is preferable, while a score closer to 0 implies poor model performance.</p><p><strong>r2_score:</strong></p><p>The r2 score quantifies the goodness of fit of a regression model to the data, ranging from 0 to 1, where 0 denotes no variability is explained and 1 implies that all variability is explained. Typically, a higher r2 score signifies a better model fit, yet it is not a guarantee of model accuracy or generalization ability to make predictions on new data.</p><p>For linear regression model we obtain the result:</p><pre>   train_variance_score  test_variance_score  train_r2_score  test_r2_score<br>   0.99823               0.962397             0.99823         0.962284</pre><h3>Predict the stock price for the next 30 days</h3><p>We have now reached the stage where we can actually predict the stock price for the next 30 days, as we had planned from the beginning. The approach is straightforward: we take the last “lookback” days (in our case, 10 days) from our test data to predict the stock price for the next day. We save the predicted value and use it to predict the stock price for the following day.</p><p>We can repeat this process as many times as we want, but the further into the future we predict, the more the model’s performance may deteriorate since it relies on synthesized data from its own predictions. While synthesized data can sometimes be useful (e.g., in <a href="https://de.wikipedia.org/wiki/Generative_Adversarial_Networks">Generative Adversarial Neural Networks</a>), in our case, it can corrupt the results. Nonetheless, predicting the stock price 30 days into the future is still a valuable result that has not been overly compromised.</p><pre>from datetime import datetime, timedelta<br><br>#====Start-Predicting-N-Days====#<br>pred_ndays = 30<br>x_input=test_data[len(test_data)-lookback:].reshape(1,-1)<br>temp_input=list(x_input)<br>temp_input=temp_input[0].tolist()<br><br>model_output=[]<br>i=0<br><br>skip_date = self.data[&#39;Date&#39;].iloc[-1]<br>check_date = correct_weekday(skip_date)<br><br>future_dates = []<br>while len(model_output) &lt; pred_ndays:<br>    while_date = correct_weekday(skip_date + timedelta(i))<br><br>    if while_date != check_date:<br><br>        check_date = while_date<br><br>        future_dates.append(check_date)<br><br>        if len(temp_input) &gt; lookback:<br>            x_input = np.array(temp_input[1:])<br>            x_input = x_input.reshape(1,-1)<br><br>            yhat = model.predict(x_input)<br><br>            temp_input.extend(yhat.tolist())<br>            temp_input = temp_input[1:]<br>            model_output.extend(yhat.tolist())<br>        else:<br>            yhat = model.predict(x_input)<br>            temp_input.extend(yhat.tolist())<br>            model_output.extend(yhat.tolist())<br><br>    else:<br>        pass<br>    <br>    i += 1<br><br>    # Check if model_output has reached desired length i.e. 10 close price prediction<br>    if len(model_output) &gt;= pred_ndays:<br>        break<br><br><br>future_dates = pd.DataFrame(future_dates)<br><br>future_dates[&#39;Date&#39;] = future_dates[0]<br><br>new_pred_df = (np.array(model_output).reshape(-1,1)).tolist()<br>new_pred_df = pd.DataFrame(scaler.inverse_transform(new_pred_df).reshape(1,-1).tolist()[0])<br><br>pred_res = pd.DataFrame()<br>pred_res[&#39;Date&#39;] = future_dates[&#39;Date&#39;]<br>pred_res[&#39;yhat&#39;] = new_pred_df<br><br>print(pred_res)<br>#====End-Predicting-N-Days====#</pre><p>In case you are wondering about the purpose of the function “correct_weekday”, let me explain it to you. This function is a precautionary measure to ensure that the model only predicts prices for weekdays when the stock market is open and not for weekends when the market is closed. By using this function, we can restrict the prediction dates to only mondays to fridays.</p><pre>def correct_weekday(select_date):<br>  #monday is 0 and sunday is 6<br>  state = None<br>  if select_date.weekday() &gt; 4:<br>          select_date = select_date - timedelta(select_date.weekday()-4)<br>  else:<br>      pass<br>  return select_date</pre><p>The function is a useful workaround, however, it’s not perfect as it doesn’t take into account special holidays or other events that could cause the stock market to be closed. If you want to expand the code and incorporate a more comprehensive solution please let me know. I would be curious how you solved this problem :)</p><h3>Results:</h3><p>Running the model we’ve built will provide you with the close price of AMD for the next 30 days.</p><pre>  Date        yhat<br>0 2023-03-13  82.813671<br>1 2023-03-14  82.914976<br>2 2023-03-15  83.160334<br>3 2023-03-16  83.370078<br>4 2023-03-17  83.572198<br>5 2023-03-20  83.771417<br>6 2023-03-21  83.969681<br>7 2023-03-22  84.168923<br>8 2023-03-23  84.368702<br>9 2023-03-24  84.569060<br>......................<br>......................<br>29 2023-04-21  81.5617</pre><p>Let’s visualize the performance of our model by plotting the training and test predictions against the actual prices.</p><p>We can also plot the predicted prices for the next 30 days to get an idea of the model’s performance in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jgGzz2_a5pQ9VR90rXkPPw.png" /></figure><p>So far so good! We can see that the model predicts both the training and test sets with high accuracy. As for the new predictions of the future, the model tells us that the closing price will be more stable and is expected to saturate around $82-$84 per share.</p><p>Since we cannot rely solely on one model to accurately estimate the future (I wish there was one model to rule them all), we can apply the same procedure to the support vector regressor and random forest regressor models to evaluate their performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPnpjEHCDhcB1dF1lt68XA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iN4KxmmkjGFqu68nRJwc3g.png" /></figure><p>The performance of each model is summarized in the bar chart below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SjFftRb8Lr92E08U6Kie8w.png" /><figcaption>Metric score of the three regression models</figcaption></figure><h3>Conclusion</h3><p>In this blog post, we delved into the process of predicting your preferred stock’s price for the next 30 days. Our aim is to use past data, such as the closing price from 10 days ago, to estimate the price for tomorrow. Through experimentation, we can determine the optimal number of days to look back for the most accurate results. To evaluate the effectiveness of this approach, we tested three commonly used regression models: linear regression, support vector regressor, and random forest regressor. By analyzing the performance of each model on both training and test datasets, we gained insights into their reliability for forecasting the next 30 days’ stock prices.</p><h3>Links</h3><p>To quickly test the code without the hassle of installing libraries and compiling it on your local machine, visit <a href="https://stocknear.com/">https://stocknear.com</a>. You can find everything we have discussed and more on my website, which offers a user-friendly interface to begin predicting stock prices for your favorite stocks instantly.</p><p>The full code can be found on my <a href="https://github.com/MuslemRahimi/regression_models">github repository</a>.</p><h3>❤️ Enjoyed the blog post</h3><p>If you found this blog post helpful and would like to receive more content like this in the future, I would greatly appreciate it if you could show your support by clicking on the clap icon and following me. Your feedback and encouragement will help me continue to create valuable content. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=365487c48809" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>