<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ritesh Singh</title>
    <description>The latest articles on DEV Community by Ritesh Singh (@ritesh_singh).</description>
    <link>https://dev.to/ritesh_singh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4001852%2F83cb234d-67c2-4b1a-be4d-1e7018c9b3bb.png</url>
      <title>DEV Community: Ritesh Singh</title>
      <link>https://dev.to/ritesh_singh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ritesh_singh"/>
    <language>en</language>
    <item>
      <title>I’m an ML Engineer. I got tired of "AI Trading Bot" scams, so I coded my own Cash Swing Trading Engine in public. (No advice, just math)</title>
      <dc:creator>Ritesh Singh</dc:creator>
      <pubDate>Fri, 03 Jul 2026 05:10:53 +0000</pubDate>
      <link>https://dev.to/ritesh_singh/im-an-ml-engineer-i-got-tired-of-ai-trading-bot-scams-so-i-coded-my-own-cash-swing-trading-4a4c</link>
      <guid>https://dev.to/ritesh_singh/im-an-ml-engineer-i-got-tired-of-ai-trading-bot-scams-so-i-coded-my-own-cash-swing-trading-4a4c</guid>
      <description>&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faiirp11k5itjigef1pd0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faiirp11k5itjigef1pd0.png" alt="StockMind UI Screenshot" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclaimer: I am not a financial advisor or a SEBI registered entity. I am an Machine Learning engineer working in industry for more than 8+ years.&lt;/p&gt;

&lt;p&gt;Like most developers, I wanted my savings to work for me, but the retail trading space is full of traps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overfitted AI Bots:&lt;/strong&gt; Feeding raw stock prices into LSTM/deep learning models just memorizes noise. They look perfect in backtests, but blow up live.&lt;br&gt;
&lt;strong&gt;Lagging Indicators:&lt;/strong&gt; 1970s charts (RSI/MACD) are lagging averages that get front-run by HFT servers at microsecond speeds.&lt;br&gt;
&lt;strong&gt;Shitty performance of current Mutual Funds :&lt;/strong&gt; 90% of the stocks has given negative return in last 2 years. I was tired of handing over commission to them. Hence decided to try something to build&lt;br&gt;
So, After more than 8 months of struggle, I built StockMind—an automated quant engine focused on Cash Equity Swing Trading.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚫 Why F&amp;amp;O (Futures &amp;amp; Options) is Excluded
&lt;/h2&gt;

&lt;p&gt;SEBI states that 90% of retail F&amp;amp;O traders lose money. The math is structurally rigged against us:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theta (Time Decay):&lt;/strong&gt; Options decay to zero on expiry. In cash equity, you have holding power to wait out drawdown cycles.&lt;br&gt;
&lt;strong&gt;Leverage trap:&lt;/strong&gt; 5x margin leverage means a small 2% market dip triggers a force liquidation at the absolute bottom.&lt;br&gt;
&lt;strong&gt;Friction drag:&lt;/strong&gt; Frequent options trades bleed up to 10-15% of your capital annually in STT, GST, and brokerage fees.&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 The Math &amp;amp; Modeling Implemented
&lt;/h2&gt;

&lt;p&gt;Instead of predicting price ticks, the engine uses structural probability:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sector Rotation&lt;/strong&gt;: Ranks sector indices daily using Relative Strength (RS) against the Nifty 50. All buy signals in weak sectors (bottom 30%) are automatically blocked.&lt;br&gt;
&lt;strong&gt;Quality + Momentum Screen:&lt;/strong&gt; Excludes high-debt companies (Debt-to-Equity &amp;gt; 1.5) and prioritizes high return (ROE &amp;gt; 15%), filtering only macro uptrends (Price &amp;gt; 150-day SMA).&lt;br&gt;
**Friction-Adjusted Backtests: **Adds a flat 0.25% cost per trade to simulate real-world STT and bid-ask slippage.&lt;/p&gt;

&lt;h2&gt;
  
  
  📈 Metrics &amp;amp; Performance
&lt;/h2&gt;

&lt;p&gt;Backtested metrics over the last 5 years (adjusted for 0.25% cost per trade):&lt;/p&gt;

&lt;p&gt;CAGR: [24.5%] | Max DD: [-12.3%] | Sharpe: [1.65]&lt;br&gt;
Here is my current live paper-trading performance. I have started trading with real money as well. Will share the result soon in next post.&lt;/p&gt;

&lt;p&gt;Paper Trade performance.&lt;/p&gt;

&lt;p&gt;⚠️ Current Weaknesses&lt;/p&gt;

&lt;p&gt;Manual Login: Have to log in manually to Zerodha Kite every morning to generate the API session token (no free automated headless login).&lt;br&gt;
Daily timeframes only: Runs end-of-day data for swing trading. Not designed for day traders. Its more for medium to long term perspective.&lt;br&gt;
💻 Open Source &amp;amp; Dashboard&lt;/p&gt;

&lt;p&gt;Live App: &lt;a href="https://www.thestockmind.com" rel="noopener noreferrer"&gt;(https://www.thestockmind.com)&lt;/a&gt;&lt;br&gt;
Telegram Channel: &lt;a href="https://t.me/stockmindAI" rel="noopener noreferrer"&gt;https://t.me/stockmindAI&lt;/a&gt;&lt;br&gt;
Would love to get feedback from other developers and quants on the slippage modeling and sector rotation index.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>maths</category>
    </item>
  </channel>
</rss>
