<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[QuantInsti Articles]]></title><description><![CDATA[Thoughts, stories and ideas.]]></description><link>https://www.quantinsti.com/articles/</link><image><url>https://www.quantinsti.com/articles/favicon.png</url><title>QuantInsti Articles</title><link>https://www.quantinsti.com/articles/</link></image><generator>Ghost 3.15</generator><lastBuildDate>Sun, 10 May 2026 11:52:08 GMT</lastBuildDate><atom:link href="https://www.quantinsti.com/articles/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[AI Forex Backtesting with LLM Regime Labels: DeepSeek vs KMeans in Python]]></title><description><![CDATA[ Learn how to build an AI-powered forex backtest using DeepSeek LLM regime labels vs KMeans. Includes Python code, walk-forward optimization, and OOS results.]]></description><link>https://www.quantinsti.com/articles/ai-forex-backtest-llm-regime-labels-deepseek-python/</link><guid isPermaLink="false">69e27f1174e6f000074e6ba2</guid><category><![CDATA[AI for Trading]]></category><dc:creator><![CDATA[Jose Carlos Gonzales Tanaka]]></dc:creator><pubDate>Fri, 08 May 2026 11:46:39 GMT</pubDate><content:encoded><![CDATA[<p><strong>TL;DR: </strong>This post builds a forex backtest where a DeepSeek LLM labels market regimes from compact numeric summaries. We compare it to a KMeans baseline, apply monthly walk-forward optimization, and report out-of-sample results from 2023 onward.</p><p><strong>Prerequisites</strong></p><p>To fully grasp the regime-labeling approach in this blog, it helps to have a basic familiarity with clustering methods and market regimes. For foundational reading, explore Markov processes and Hidden Markov Chains, and how to identify Market Regimes using Hidden Markov Models.</p><p>For a conceptual introductions, you can check <a href="https://blog.quantinsti.com/markov-model/">Markov processes</a> and <a href="https://blog.quantinsti.com/intro-hidden-markov-chains/">Hidden Markov Chains</a> that will serve you on understanding how to identify <a href="https://blog.quantinsti.com/regime-adaptive-trading-python/">Market Regimes using Hidden Markov</a> models to trade.</p><p><strong>What you will get:</strong></p><ul><li>A complete Python script that runs a 2023+ out-of-sample FX backtest with monthly walk-forward optimization.</li><li>A baseline regime classifier (KMeans) and an LLM-based classifier (DeepSeek) that use the same feature set.</li><li>A clear comparison of equity curves and key metrics (CAGR, Sharpe, Sortino, Calmar, MaxDD, win rate).</li><li>A practical checklist of tweaks to improve LLM-based regime labeling performance and robustness.</li></ul><h1 id="what-this-project-builds"><strong>What this project builds</strong></h1><p>This project demonstrates a practical way to combine an LLM with a quantitative trading workflow without letting the LLM touch raw price history. The LLM’s job is narrow: label each period as a market regime (trend up/down, range, high/low volatility) using a compact numeric summary. The trading rules remain fully deterministic.</p><p>To reduce overfitting, we evaluate performance out-of-sample (OOS) starting in 2023 and use monthly walk-forward optimization (WFO). Every month, we tune a small set of parameters using only prior data, then trade the next month with the chosen parameters.</p><h1 id="what-the-script-does-in-plain-english-"><strong>What the script does (in plain English)</strong></h1><ul><li>Step 1: Download daily EURUSD data and compute simple features (returns, volatility, trend score, ATR proxy, z-score).</li><li>Step 2: Create regime labels in two ways:</li><li>a non-LLM baseline using KMeans clustering, and</li><li>an LLM version using DeepSeek.</li><li>Step 3: For each month in 2023+, optimize a few parameters on a trailing training window (default: 3 years).</li><li>Step 4: Trade the next month, stitch months together, and produce an equity curve.</li></ul><h1 id="full-python-script-explained-in-parts"><strong>Full Python script explained in parts</strong></h1><p>First, we’ll explain the script in the same order it’s written. After each explanation, we’ll show the exact code block so you can match the narrative to the implementation. This section is meant to be readable even if you’re a beginner in Python.</p><p>Let's import the corresponding libraries:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/39d7f9adab36634a9be0f8d468727cee.js"></script><!--kg-card-end: html--><h2 id="settings-edit-these-">SETTINGS (edit these)</h2><p>Next, the script begins with a short settings block. This is where you choose the FX symbol, the date range (from 2023 up to today, transaction costs, and the walk-forward optimization grid. It also includes the DeepSeek configuration (API key, base URL, and model).</p><p>In addition, the optimization grid is intentionally small so the experiment stays readable and the walk-forward loop does not become a “hyper-parameter monster.”</p><p>Then, once these settings are fixed, the rest of the script can run end-to-end without changing any trading logic.</p><p>Please find below the code for this part:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/57372d5dc1a00487d4cd424dd4b35c03.js"></script><!--kg-card-end: html--><h2 id="data-features">DATA + FEATURES</h2><p>Then the script downloads daily price data and converts raw OHLC data into a compact, easy-to-interpret feature set.</p><p>After that, it computes the signals used everywhere else: daily log returns, rolling annualized volatility, a 20-day trend score (mean/std of returns), an ATR-style range proxy, and a 20-day z-score (distance from the moving average).</p><p>Finally, both the baseline and the LLM see these same features, which makes the comparison fair: the labeling method is the main difference.</p><p>Here is the code for this part:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/60ef332144269140701795bf04961443.js"></script><!--kg-card-end: html--><h2 id="regime-labels-non-llm-kmeans-">REGIME LABELS (Non‑LLM: KMeans)</h2><p>Next, we create a non-LLM baseline using KMeans clustering on rolling window summaries. To avoid leakage, the KMeans model is fit only on the pre-2023 period.</p><p>In addition, the clusters are converted into named regimes using simple heuristics: the most positive trend cluster becomes TREND_UP, the most negative becomes TREND_DOWN, the highest volatility cluster becomes HIGH_VOL, the lowest becomes LOW_VOL, and the remaining one becomes RANGE.</p><p>Then, labels are forward-filled until the next labeling date so the strategy has a regime label each day.</p><p>Find below the code for this part:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/22c05149890e7ad0c411234817c48e05.js"></script><!--kg-card-end: html--><h2 id="regime-labels-llm-deepseek-cache">REGIME LABELS (LLM: DeepSeek) + cache</h2><p>Then, we build the LLM regime labeler using DeepSeek. Instead of sending a long price history, the model receives only a compact numeric summary of the last N days (mean return, volatility, trend score, ATR proxy, z-score, and a drawdown proxy).</p><p>In addition, the prompt requests a single label from a fixed set and expects strict JSON output, which makes the labeling step easier to parse and audit.</p><p>After that, the script caches each labeled date in a JSON file so reruns do not spend tokens on the same periods again.</p><p>Check the code:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/97f1dfe735d8702670af47a36e57be79.js"></script><!--kg-card-end: html--><h2 id="strategy-logic-unchanged-but-parameterized-for-wfo-">STRATEGY LOGIC (UNCHANGED, but parameterized for WFO)</h2><p>Next, the strategy converts regime labels into daily positions using simple regime-conditioned rules.</p><p>For trend regimes it takes directional exposure (long in TREND_UP, short in TREND_DOWN). For RANGE it mean-reverts using the z-score: it fades short when price is far above the mean and fades long when price is far below the mean. For HIGH_VOL and UNCERTAIN it stays flat by default, while LOW_VOL uses a smaller trend-following position.</p><p>Then, to reduce lookahead bias, positions are shifted by one day so trades are assumed to execute on the next bar.</p><p>See below the code section:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/98df903e120c8ef88477a91f730b022a.js"></script><!--kg-card-end: html--><h2 id="metrics">METRICS</h2><p>Then, we define the evaluation metrics used later in the Results section: CAGR, annual volatility, Sharpe, Sortino, Calmar, max drawdown, and win rate.</p><p>These metrics help compare not only returns, but also the risk taken to earn them.</p><p>See below the code script:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/9be47d9cff5afcebfdccbe87e8c902d4.js"></script><!--kg-card-end: html--><h2 id="walk-forward-optimization-monthly-">WALK-FORWARD OPTIMIZATION (MONTHLY)</h2><p>After that, the script runs monthly walk-forward optimization. Each month in 2023+, it trains on the trailing TRAIN_YEARS of data, tries a small parameter grid, and selects the set with the best training Sharpe.</p><p>Then it trades the next month with those chosen parameters and stitches the monthly results into one out-of-sample equity curve.</p><p>At this stage, the optimizer is tuning only these knobs: z_thr (z-score entry threshold in RANGE), range_size (RANGE position size), lowvol_size (LOW_VOL sizing), and highvol_size (HIGH_VOL sizing, often 0.0).</p><p>Check the code:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/7129f3686423c1a9b1e0e6ae75ec93b3.js"></script><!--kg-card-end: html--><h2 id="main">MAIN</h2><p>Finally, main() wires everything together: data → features → regimes → monthly walk-forward → equity curves. It prints metrics, plots both curves, and saves CSV files for equity and monthly parameter choices.</p><p>Visualize the code below:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/29b991f1c002c1cd3c3828325441f00e.js"></script><!--kg-card-end: html--><h1 id="results-oos-from-2023-llm-vs-non-llm"><strong>Results (OOS from 2023): LLM vs non-LLM</strong></h1><p>Check the plot:</p><figure class="kg-card kg-image-card kg-width-full"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnQAAAHWCAYAAAD+VRS3AAAQAElEQVR4AexdBZwV1Rf+ZpvaXbq7S5AQQVBUQlAULGxQ8S92tyIqig02oii2mNgitaCCICmIdHcuSy7ssv/73Xn3vXm1+952nP3tuXFufzNv5sw5NyIy5E8QEAQEAUFAEBAEBAFBoEgjEAH5EwQEAUFAEBAEskRAMggCgkBhRkAEusJ8daRvgoAgIAgIAoKAICAIhICACHQhgCRZ8gcBaUUQEAQEAUFAEBAEsoeACHTZw01KCQKCgCAgCAgCgkDBICCtBkBABLoAoAhLEBAEBAFBQBAQBASBooSACHRF6WpJXwUBQSB/EJBWBAFBQBAoYgiIQFfELph0VxAQBAQBQUAQEAQEAV8ERKDzRSR/4tKKICAICAKCgCAgCAgCuYaACHS5BqVUJAgIAoKAICAI5DYCUp8gEBoCItCFhpPkEgQEgSKCwPr162FZFsaPH19Eelx0u3nw4EFUqVIFn3zyidcgfv31V7Rt2xZxcXH6WiQnJ3ulS0QQMAgsW7YMUVFRWLp0qWGJn00ERKDLJnDFrdj48eP1g9eyrID+X3/9pYdsXpYvvviijvs65FuWBeYzad27d/eqs1SpUjjppJMwevRonDhxwmTTflJSks771Vdf6bivc+utt+p0J//YsWN45ZVXcPLJJyM+Ph6JiYlo2bIl/ve//2H58uXurL5j5MumRo0a6N27N1599VUcOHDAnTcngaNHj6JRo0Zo1qwZ2Dffuvr06YOEhARs3brVNynk+MaNGzF06FDUq1cPsbGx+qXav39//Pnnn0HrCFYmWJn169fj2muvRcOG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Nu3D8ceeyyo4Pnmv//9L5YtWxbxHAWKgAiIQHEJSKErLimlEwERKBYBWxMtWbIE6enpWLlypZkg0aZNG8yYMQNfffUVHn74YSP2nj17jBvJ4hi7+Ph4k37RokVYlGt43YkTJ0Y6RWEiIAIiUGwCUuiKjUoJRUAEKisBjpFjC1vfvn2NQsYlTMaPH4/OnTubFre1a9eGoWG3K1vjQgOPP/5400K3ceNGNGvWLMywWzY0rfwiIAIiUFICMajQlVREpRcBERCB4hPgTNT169fjl19+wYIFC3D33XejT58+plVuwIABRhHbu3cvHnzwQSxfvhxPP/00Hn300bAbcGwdW+Rmz56NTZs2ma5YdrVecskl4DU4uWLFihX44osvMHbsWLz11lth5+tABERABEpKQApdSYkpvQiIgNUEZs6ciYYNG4JKGWegfvjhh2ZGK5cuYZcpZ7ty2ZJx48ahVatWePbZZ41SFgqFM10HDx6M/v37o169erj33ntNNCdFUKG7+eab0bx5c5x77rn48ssvccQRR5h4WWVMQJcTgUpEQApdJSpsiSoCIlA0galTp4KTH2jYCsfu0VmzZpl15bhUiX/20KFDwW5WToKgAshJETwndHeIRx55xLTOMdxfh467T9x5551g6xzH2/EabK3jmnb+teWKgAiIQGkIxJXmJJ0jAiJgCMgSAREQAREQgUAQkEIXiGJQJkRABERABERABOwlUP6SSaErf8a6gwiIgAiIgAiIgAiUKwEpdOWKVxcXAREQgYohoLuIgAhUbgJS6Cp3+Ut6ERABERABERABCwhIobOgECtGBN1FBERABERABEQgqASk0AW1ZJQvERABERABEYhFAspzVAhIoYsKdt1UBERABERABERABMqOgBS6smOpK4mACFQMAd1FBERABESgAAEpdAWA6FAEREAEREAEREAEYo2AFLpIJaYwERABERABERABEYghAlLoYqiwlFUREAEREIFgEVBuRCAoBP4fAAD//+ARltEAAAAGSURBVAMArDvBH8YILFgAAAAASUVORK5CYII=" class="kg-image" alt="equities_performances"></figure><p>Quick performance summary (Quantstats-style metrics for OOS 2023+):</p><!--kg-card-begin: html--><p class="demoTitle">&nbsp;</p>
<table>
<tbody>
<tr>
<td>
<p><strong>Strategy</strong></p>
</td>
<td>
<p><strong>Final Equity</strong></p>
</td>
<td>
<p><strong>Peak Equity</strong></p>
</td>
<td>
<p><strong>CAGR</strong></p>
</td>
<td>
<p><strong>Annual Volatility</strong></p>
</td>
<td>
<p><strong>Sharpe</strong></p>
</td>
<td>
<p><strong>Sortino</strong></p>
</td>
<td>
<p><strong>Calmar</strong></p>
</td>
<td>
<p><strong>Max Drawdown</strong></p>
</td>
<td>
<p><strong>Win Rate</strong></p>
</td>
</tr>
<tr>
<td>
<p><span style="font-weight: 400;">Non-LLM (KMeans) + monthly WFO</span></p>
</td>
<td>
<p><span style="font-weight: 400;">1.091</span></p>
</td>
<td>
<p><span style="font-weight: 400;">1.160</span></p>
</td>
<td>
<p><span style="font-weight: 400;">2.63%</span></p>
</td>
<td>
<p><span style="font-weight: 400;">5.05%</span></p>
</td>
<td>
<p><span style="font-weight: 400;">0.541</span></p>
</td>
<td>
<p><span style="font-weight: 400;">0.884</span></p>
</td>
<td>
<p><span style="font-weight: 400;">0.268</span></p>
</td>
<td>
<p><span style="font-weight: 400;">-9.82%</span></p>
</td>
<td>
<p><span style="font-weight: 400;">38.72%</span></p>
</td>
</tr>
<tr>
<td>
<p><span style="font-weight: 400;">LLM (DeepSeek) + monthly WFO</span></p>
</td>
<td>
<p><span style="font-weight: 400;">1.203</span></p>
</td>
<td>
<p><span style="font-weight: 400;">1.277</span></p>
</td>
<td>
<p><span style="font-weight: 400;">5.69%</span></p>
</td>
<td>
<p><span style="font-weight: 400;">6.40%</span></p>
</td>
<td>
<p><span style="font-weight: 400;">0.898</span></p>
</td>
<td>
<p><span style="font-weight: 400;">1.578</span></p>
</td>
<td>
<p><span style="font-weight: 400;">0.663</span></p>
</td>
<td>
<p><span style="font-weight: 400;">-8.59%</span></p>
</td>
<td>
<p><span style="font-weight: 400;">41.92%</span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p><!--kg-card-end: html--><p>How to read this table: CAGR is the annualized growth rate, AnnVol is annualized volatility, Sharpe and Sortino measure risk-adjusted returns (Sortino focuses on downside risk), Calmar relates return to drawdown, MaxDD is the worst peak-to-trough loss, and WinRate is the share of positive days.</p><p>Why did the LLM do better here? The DeepSeek labels can combine multiple signals (trend strength, volatility, drawdown proxy, and z-score) and react more flexibly to regime transitions than KMeans clustering. That can reduce misclassification around turning points, so the strategy spends more time using the right behavior (trend-following vs mean reversion). In this OOS window, that shows up as higher CAGR and materially better Sharpe/Sortino, with a slightly smaller max drawdown and a modestly higher win rate.</p><p>The equity curves you generated cover 2023-01-02 to 2026-03-31 (OOS). To make the comparison fair, both curves are rebased to start at 1.0 on the first OOS date.</p><p>At a high level, the LLM-labeled strategy produced a higher terminal equity and a higher peak equity over this OOS window. That suggests the LLM regime labels (combined with monthly WFO) were more useful than the KMeans regimes for deciding when to apply trend-following vs range mean-reversion behaviors.</p><h1 id="interpreting-the-differences"><strong>Interpreting the differences</strong></h1><p>Why might the LLM version outperform? In this setup, the LLM acts as a flexible classifier that makes “soft” judgments from multiple signals at once (trend score, volatility, drawdown proxy, z-score). KMeans can be sensitive to scaling, cluster shapes, and may not separate regimes cleanly when the market transitions between states.</p><p>However, treat this as a hypothesis generator, not a final conclusion. This OOS window is relatively short and includes a specific FX regime mix. The monthly WFO also introduces the riskof mild overfitting if the parameter grid is too large or the training objective is not aligned with your real-world constraints (e.g., drawdown limits).</p><h1 id="10-practical-tweaks-to-improve-the-llm-based-strategy"><strong>10 practical tweaks to improve the LLM-based strategy</strong></h1><p>Below are concrete, implementation-level tweaks that may improve performance or robustness when you use an LLM for regime labeling. These focus on reducing label noise, improving consistency, and aligning optimization with real trading constraints.</p><ol><li><strong><strong><strong>Add a “confidence” output and abstain rule: </strong>Ask the LLM for {regime, confidence}. If confidence is low, label as UNCERTAIN and stay flat. This reduces noisy trades.</strong></strong></li><li><strong><strong><strong>Use majority vote (self-consistency) on hard months: </strong>For month-start labeling windows, call the LLM 3 times (temperature=0) and take the majority label. Cache the majority result.</strong></strong></li><li><strong><strong><strong>Increase information in the summary (still numeric): </strong>Add features like rolling skew, kurtosis, breakout frequency, range compression, or autocorrelation. Keep it compact and auditable.</strong></strong></li><li><strong><strong><strong>Label more frequently during volatile periods: </strong>Make LABEL_STEP_DAYS dynamic: label every day when vol is high, and every 5–10 days when vol is low. This can improve regime transitions.</strong></strong></li><li><strong><strong><strong>Add a regime “smoother”: </strong>Prevent whipsaws by requiring a regime to persist for N days (or use an HMM-like smoothing rule) before switching trading behavior.</strong></strong></li><li><strong><strong><strong>Stricter prompt + schema validation: </strong>Force strict JSON and reject responses that include extra text. If invalid, re-try once or default to UNCERTAIN.</strong></strong></li><li><strong><strong><strong>Ensemble LLM with a quantitative prior: </strong>Combine LLM label with the KMeans (or a rules-based label). For example, only accept TREND_UP if both agree, otherwise UNCERTAIN.</strong></strong></li><li><strong><strong><strong>Optimize for drawdown-aware objective: </strong>Instead of maximizing Sharpe, maximize Calmar or use a penalty: score = Sharpe − λ·|MaxDD|. This often improves stability.</strong></strong></li><li><strong><strong><strong>Add regime-specific risk sizing: </strong>Use volatility targeting (scale position by 1/vol) within each regime so you don’t take the same risk in calm vs volatile markets.</strong></strong></li><li><strong><strong><strong>Expand regime taxonomy (carefully): </strong>Split RANGE into ‘tight range’ vs ‘wide range’, or split TREND into ‘strong trend’ vs ‘weak trend’. More regimes can help if you validate properly.</strong></strong></li></ol><h1 id="suggested-next-experiments"><strong>Suggested next experiments</strong></h1><p>To strengthen the blog, consider adding:</p><ol><li>multiple FX pairs (EURUSD, GBPUSD, USDJPY),</li><li>sensitivity to transaction costs,</li><li>a longer OOS window once you’re confident in label hygiene, and</li><li>a “label audit” where you sample dates and inspect summaries vs labels.</li></ol><p><em><strong>Note:</strong></em></p><ul><li><em><em><em>The strategy idea originated from the author</em></em></em></li><li><em><em><em>The blog content was created with the assistance of an AI large language model and</em></em></em></li><li><em><em><em>The blog content was curated/edited by the author.</em></em></em></li></ul><h1 id="further-reading"><strong>Further Reading</strong></h1><p>To explore the basics of Quant Trading, check our <a href="https://quantra.quantinsti.com/learning-track/guide-quantitative-trading-beginners">Learning Track: Quantitative Trading for Beginners</a>.</p><p>For LLM usage for trading, explore the <a href="https://quantra.quantinsti.com/course/llm-trading-strategies">Trading Using LLM: Concepts and Strategies</a> track, which provides practical hands-on insights into implementing LLM models for trading.</p><p>If you're a serious learner, you can take the <a href="https://www.quantinsti.com/epat?_gl=1*1cnnpcz*_gcl_au*MTc0ODY1NjMwNy4xNzczOTU1MjIz*_ga*MTIyODI0NTM4Ny4xNzczOTU0ODY5*_ga_SXP1W7WL9G*czE3NzY4MDU0NzkkbzQzJGcwJHQxNzc2ODA1NDc5JGo2MCRsMCRoMA..">Executive Programme in Algorithmic Trading (EPAT)</a>, which covers statistical modelling, machine learning, and advanced trading strategies with Python.</p><!--kg-card-begin: html--><p><em><small>This project is for educational and illustrative purposes only. Trading in financial markets involves substantial risk of loss. The code and concepts discussed here are not financial advice. Always exercise caution and thoroughly understand any automated trading system before deploying it in a live environment.</small></em></p><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Machine Learning Basics: Components, Application, Resources and More]]></title><description><![CDATA[Machine Learning basics, algorithms, concepts and techniques are the talk of the day! Machine Learning has dramatically altered every field. Dive into the basics of machine learning, and learn all about it.]]></description><link>https://www.quantinsti.com/articles/machine-learning-basics/</link><guid isPermaLink="false">69eb619074e6f000074e6cf8</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[Hariprasad Poojari]]></dc:creator><pubDate>Fri, 24 Apr 2026 12:53:39 GMT</pubDate><content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/chainika-bahl-thakar-b32971155/">Chainika Thakar</a></p><p>Machine learning has become a hot topic today, with entrepreneurs all across the world switching to machine learning for business operations. Machine learning has reached the advancement where it can even predict outcomes without being explicitly programmed to do so.</p><p>This is not only it, but there is a lot more when it comes to the applications of machine learning in trading. With this blog, you will learn all about the basics of machine learning and how to begin learning the same along with the resources for learning, the applications of the same and much more!</p><h2 id="what-is-machine-learning">What is machine learning?</h2><p>Machine Learning, as the name suggests, provides machines with the ability to learn autonomously based on experiences, observations and analysing patterns within a given data set without explicitly programming.</p><p>When we write a program or a code for some specific purpose, we are actually writing a definite set of instructions which the machine will follow.</p><p>Whereas in machine learning, we input a data set through which the machine learns by identifying and analysing the patterns in the data set. Then, the machine will make decisions autonomously based on its observations and learnings from the dataset.</p><p>Before delving deep into the world of machine learning for trading, let's begin by gaining a solid understanding of the fundamental terms in machine learning for trading.</p><!--kg-card-begin: html--><iframe width="900" height="415" class="lazyload" data-src="https://www.youtube.com/embed/kQc3TVaO2J4?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!--kg-card-end: html--><h2 id="example-of-machine-learning">Example of machine learning</h2><p>Although there are numerous examples of machine learning, we are covering just a few here.</p><ul><li>Facebook: For instance, think of Facebook’s facial recognition <a href="https://www.facebook.com/help/122175507864081">⁽¹⁾</a> algorithm which prompts you to tag photos whenever you upload a photo.</li><li>Alexa, Cortana, and other voice assistants: Another example is of the voice assistants who use machine learning to identify and service the user’s request.</li><li>Tesla automobiles: One more example is of Tesla’s autopilot <a href="https://www.tesla.com/autopilot">⁽²⁾</a> feature.</li></ul><p>Now let us see an example of a “bird species recognition learning” problem. This example is explained with the task of the model, the performance measure of the model and the training experience required for the accurate results:</p><ul><li><strong>The task of the machine learning model:</strong> Recognizing and classifying species of birds within images</li><li><strong>Performance measure:</strong> Percent of bird species correctly classified</li><li><strong>Training experience of the machine learning model:</strong> Training on a data-set of bird species with given classifications</li></ul><p>Hence, the machine learning model will learn the task according to the performance measure and the required training experience of the machine learning model.</p><h2 id="history-of-machine-learning">History of machine learning</h2><p>Machine learning is not a recent phenomenon. In fact, neural networks were first introduced in the year 1943 <a href="https://en.wikipedia.org/wiki/Timeline_of_machine_learning">⁽³⁾</a>!</p><p>Although in the early days, progress in machine learning was somewhat slow due to the high cost of computing. The high computing cost made this domain only accessible to large academic institutions or multinational corporations. Also, the data in itself was difficult to acquire for a company’s needs.</p><p>But with the advent of the internet, we are now generating quintillions of data everyday <a href="https://www.forbes.com/sites/bernardmarr/2018/05/21/how-much-data-do-we-create-every-day-the-mind-blowing-stats-everyone-should-read/#4742a8c860ba">⁽⁴⁾</a>!</p><p>Couple that with the reduction in the price of computations and we find that machine learning is more than a viable proposition <a href="https://www.einnews.com/pr_news/585166263/artificial-intelligence-market-size-to-grow-by-usd-94-500-million-driven-by-growing-preference-for-machine-learning">⁽⁵⁾</a>.</p><p>Some of the notable events in the history of machine learning are:</p><ul><li><strong>1950</strong> - This was the first time when “Alan Turing” <a href="https://www.newscientist.com/people/alan-turing/">⁽⁶⁾</a> created a test in order to check if a machine could fool a human being into believing that it was talking to a machine.</li><li><strong>1952</strong> - The first computer learning program, a game of checkers, was written by Arthur Samuel.</li><li><strong>1957</strong> - The first neural network for computers was invented by Frank Rosenblatt, which simulated the thought process of a human brain.</li><li><strong>1967</strong> - The Nearest Neighbor algorithm was written.</li><li><strong>1979</strong> - Students of Stanford University, California invented the Stanford cart which could navigate and avoid obstacles on its own.</li><li><strong>1997</strong> - IBM’s Deep Blue beats the world champion at Chess.</li><li><strong>2002</strong> - A software library for machine learning named Torch was first released.</li><li><strong>2016</strong> - AlphaGo algorithm developed by Google DeepMind managed to win five games out of five in the Chinese Board Game Go competition.</li></ul><p>These events can be represented as:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2022/09/Timeline-of-Machine-Learning.png" class="kg-image" alt="Timeline of machine learning"></figure><h2 id="importance-of-machine-learning">Importance of machine learning</h2><p>Machine learning plays an important <a href="https://www.datarobot.com/blog/the-importance-of-machine-learning-data/">⁽⁷⁾</a> role in the field of enterprises as it enables entrepreneurs to minimise manual efforts. The machine learning model learns with the help of humans but eventually, the machine learns and takes over the learnt task.</p><p>Although a minimum level of intervention is needed for making sure that no “machine-related” glitch arises or for updating the data inputted.</p><p>Nowadays leading companies like Google, Amazon, Facebook, Tesla, and many more are efficiently utilising these technologies. Hence, machine learning is proving to become a core part of operation and functioning.</p><p>Moreover, there are a multitude of use cases that machine learning can be applied to in order to cut costs, mitigate risks, and improve overall quality of life including risk management. Furthermore, <em>the global machine learning (ML) market is expected to grow <a href="https://www.fortunebusinessinsights.com/machine-learning-market-102226">⁽⁸⁾</a> from $21.17 billion in 2022 to $209.91 billion by 2029, at a CAGR of 38.8% in forecast period</em>.</p><h2 id="components-of-machine-learning">Components of machine learning</h2><p>There are tens of thousands of machine learning algorithms and hundreds of new algorithms are developed every year.</p><p>Every machine learning algorithm has three components:</p><ul><li><strong>Representation</strong>: This implies how to represent knowledge. Examples include decision trees, sets of rules, instances, graphical models, neural networks, support vector machines, model ensembles and others.</li><li><strong>Evaluation</strong>: This is the way to evaluate candidate programs (hypotheses). Examples include accuracy, prediction and recall, squared error, likelihood, posterior probability, cost, margin, entropy k-L divergence and others.</li><li><strong>Optimization</strong>: Last but not the least, optimization is the way candidate programs are generated and is known as the search process. For example, combinatorial optimization, convex optimization, and constrained optimization.</li></ul><p>All machine learning algorithms are a combination of these three components and a framework for understanding all algorithms.</p><h2 id="machine-learning-classification">Machine learning classification</h2><p><a href="https://www.youtube.com/watch?v=m4BFOSaos7M">Machine Learning</a> algorithms can be classified into:</p><ol><li>Supervised Algorithms:<br>◦ <a href="https://blog.quantinsti.com/machine-learning-trading-predict-stock-prices-regression">Linear Regression</a>,<br>◦ <a href="https://blog.quantinsti.com/machine-learning-logistic-regression-python">Logistic Regression</a>,<br>◦ <a href="https://blog.quantinsti.com/machine-learning-k-nearest-neighbors-knn-algorithm-python">KNN classification</a>,<br>◦ <a href="https://blog.quantinsti.com/trading-using-machine-learning-python-svm-support-vector-machine/">Support Vector Machine (SVM)</a>,<br>◦ <a href="https://quantra.quantinsti.com/course/decision-trees-analysis-trading-ernest-chan">Decision Trees</a>,<br>◦ <a href="https://blog.quantinsti.com/random-forest-algorithm-in-python">Random Forest</a>,<br>◦ <a href="https://blog.quantinsti.com/bayesian-inference">Naive Bayes’ theorem</a></li><li>Unsupervised Algorithms: <a href="https://blog.quantinsti.com/k-means-clustering-pair-selection-python">K Means Clustering</a></li><li><a href="https://blog.quantinsti.com/reinforcement-learning-trading/">Reinforcement Algorithm</a></li></ol><p>Let us dig a bit deeper into these machine learning basics algorithms.</p><h3 id="supervised-machine-learning-algorithms">Supervised Machine Learning Algorithms</h3><p>In this type of algorithm, the data set on which the machine is trained consists of labelled data or simply said, consists of both the input parameters as well as the required output.</p><p>Let’s take the previous example of facial recognition and once we have identified the people in the photos, we will try to classify them as babies, teenagers or adults. </p><p>Here, babies, teenagers and adults will be our labels and our training dataset will already be classified into the given labels based on certain parameters through which the machine will learn these features and patterns and classify some new input data based on the learning from this training data.</p><p>Supervised Machine Learning Algorithms can be broadly divided into two types of algorithms; Classification and Regression.</p><p><strong>Classification Algorithms</strong></p><p>Just as the name suggests, these algorithms are used to classify data into predefined classes or labels. We will discuss one of the most used <a href="https://www.youtube.com/watch?v=0IWLfTomLLg">classification</a> algorithms known as the K-Nearest Neighbour (KNN) Classification Algorithm.</p><p><strong>Regression Machine Learning Algorithms</strong></p><p>These algorithms are used to determine the mathematical relationship between two or more variables and the level of dependency between variables. These can be used for predicting an output based on the interdependency of two or more variables.</p><p>For example, an increase in the price of a product will decrease its consumption, which means, in this case, the amount of consumption will depend on the price of the product.</p><p>Here, the amount of consumption will be called the dependent variable and the price of the product will be called the independent variable. The level of dependency on the amount of consumption on the price of a product will help us predict the future value of the amount of consumption based on the change in prices of the product.</p><h3 id="unsupervised-machine-learning-algorithms">Unsupervised Machine Learning Algorithms</h3><p>Unlike supervised learning algorithms, where we deal with labelled data for training, the training data will be unlabelled for Unsupervised Machine Learning Algorithms. The clustering of data into a specific group will be done on the basis of the similarities between the variables.</p><p>Some of the unsupervised machine learning algorithms are K-means clustering and neural networks.</p><p>A simple example would be that given the data of football players, we will use K-means clustering and label them according to their similarity. Thus, these clusters could be based on the striker's preference to score on free kicks or successful tackles, even when the algorithm is not given pre-defined labels to start with.</p><p>K-means clustering would be beneficial to traders who feel that there might be similarities between different assets which cannot be seen on the surface.</p><p>While we did mention neural networks in unsupervised machine learning algorithms, it can be debated that they can be used for both supervised as well as unsupervised learning algorithms. You can learn all about in this course on <a href="https://quantra.quantinsti.com/course/unsupervised-learning-trading">unsupervised learning course</a>. Artificial neural network and <a href="https://blog.quantinsti.com/rnn-lstm-gru-trading/">Recurrent Neural networks</a> also fall under unsupervised machine learning algorithms.</p><h3 id="reinforcement-machine-learning-algorithms">Reinforcement Machine Learning Algorithms</h3><p>Reinforcement learning is a type of machine learning in which the machine is required to determine the ideal behaviour within a specific context, in order to maximise its rewards.</p><p>It works on the rewards and punishment principle which means that for any decision which a machine takes, it will be either rewarded or punished. Thus, it will understand whether or not the decision was correct.</p><p>This is how the machine will learn to take the correct decisions to maximise the reward in the long run.</p><p>For a reinforcement algorithm, a machine can be adjusted and programmed to focus more on either the long-term rewards or the short-term rewards. When the machine is in a particular state and has to be the action for the next state in order to achieve the reward, this process is called the Markov Decision Process.</p><h2 id="difference-between-machine-learning-and-deep-learning">Difference between machine learning and deep learning</h2><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/Difference-between-Machine-Learning-Artificial-Intelligence-and-Deep-Learning-1024x768.png" class="kg-image" alt="difference between artificial intelligence machine learning and deep learning"></figure><p>Machine Learning models lack the mechanism to identify errors, in such cases the programmer needs to step in to tune the model for more accurate decisions, whereas deep learning models can identify the inaccurate decision and correct the model on its own without human intervention.</p><p>But for doing so, deep learning models require a huge amount of data and information, unlike Machine Learning models.</p><h2 id="prerequisites-to-learn-machine-learning">Prerequisites to learn machine learning</h2><p>There are some prerequisites to learning machine learning without which one will be deprived of the important concepts needed to proceed with learning the same. These are:</p><p><strong>Statistical concepts</strong></p><p>Statistical concepts are essential in machine learning to create models from data. Statistics such as analysis of variance and hypothesis testing are crucial for building algorithms.</p><p><strong>Probability</strong></p><p>Probability helps in predicting future consequences, and the majority of the algorithms in machine learning are based on uncertain conditions where reliable decisions are needed.</p><p><strong>Data Modelling</strong></p><p>Data modelling enables identifying the underlying data structures, finding out the patterns and filling the gaps between the places where data is nonexistent.</p><p><strong>Programming Skills</strong></p><p>We are all aware that machine learning mostly depends on algorithms, which means one should possess sound knowledge of at least one of the programming languages. Python is considered an easy language to master, and also, is used by most of the quants.</p><h2 id="python-libraries-for-machine-learning">Python libraries for machine learning</h2><p><a href="https://blog.quantinsti.com/python-trading-library/">Python libraries</a> help with eliminating the need to write code from scratch. They play a vital role in developing machine learning models as they need algorithms. Let us take a look at some of the most popular libraries below.</p><p><strong>Scikit-learn</strong></p><p>It is a Python Machine Learning library built upon the SciPy library and consists of various algorithms including classification, clustering and regression, and can be used along with other Python libraries like NumPy and SciPy for scientific and numerical computations.</p><p>Some of its classes and functions are sklearn.cluster, sklearn.datasets, sklearn.ensemble, sklearn.mixture etc.</p><p><strong>TensorFlow</strong></p><p>TensorFlow is an open-source software library for high-performance numerical computations and machine learning applications such as neural networks. It allows easy deployment of computation across various platforms like CPUs, GPUs, TPUs etc. due to its flexible architecture. Learn how to <a href="https://blog.quantinsti.com/install-tensorflow-gpu/">install TensorFlow GPU</a> here.</p><p><strong>Keras</strong></p><p>Keras is a deep learning library used to develop neural networks and other deep learning models. It can be built on top of TensorFlow, Microsoft Cognitive Toolkit or Theano and focuses on being modular and extensible.</p><h2 id="common-terms-used-in-machine-learning">Common terms used in machine learning</h2><p>Here are a few machine learning basics terms which would be of help as you start your journey in machine learning algorithms.</p><h3 id="bias">Bias</h3><p>A machine learning model is said to have a low bias if its predictability level is high. In other words, it makes fewer mistakes when it is working on a dataset.</p><p>Bias plays an important role when we have to compare two machine learning algorithms for the same problem statement.</p><h3 id="cross-validation-bias">Cross-validation bias</h3><p><a href="https://blog.quantinsti.com/cross-validation-machine-learning-trading-models/">Cross-validation</a> in machine learning is a technique that provides an accurate measure of the performance of a machine learning model. This performance implies your expectation when the model is used in the future without the help of any human.</p><p>In short, the cross-validation bias finds out if the machine learning model has learnt the task properly or not.</p><p>The application of the machine learning models is to learn from the existing data and use that knowledge to predict future unseen events. The cross-validation in the machine learning model needs to be thoroughly done before live <a href="https://www.youtube.com/watch?v=hxtugnzgdM4">trading</a> so that no unexpected mistakes are made.</p><h3 id="underfitting">Underfitting</h3><p>If a machine learning model is not able to predict with a decent level of accuracy, then we say that the model underfits. This could be due to a variety of reasons, including, not selecting the correct features for the prediction, or simply the problem statement is too complex for the selected machine learning algorithm.</p><h3 id="overfitting">Overfitting</h3><p>In both machine learning and statistics, overfitting occurs when the model fits the data too well or simply put when the model is too complex. Overfitting model learns the detail and noise in the training data to such an extent that it negatively impacts the performance of the model on new data/test data.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2022/09/OverFitting.png" class="kg-image" alt="Overfitting"></figure><p>Overfitting problem can be solved by decreasing the number of features/inputs or by increasing the number of training examples to make the machine learning algorithms more generalised. The more common way of solving the overfitting problem is by regularisation.</p><p>These were a few terms we discussed in Machine learning basics. Most of the popular machine learning algorithms are mentioned above.</p><h2 id="application-of-machine-learning-in-trading">Application of machine learning in trading</h2><p>Machine learning is applied to a variety of services. Machine learning plays an important role in the field of enterprises as it enables entrepreneurs to understand customers’ behaviour and business functioning behaviour.</p><p>At present, almost every common domain is powered by machine learning applications. To name a few such industries – healthcare, search engine, digital marketing, and education are the major beneficiaries.</p><p>Let us see specifically, which all services the machine learning system covers.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2022/09/Applications-of-Machine-Learning-1.png" class="kg-image" alt="Applications of machine learning"></figure><p>Through this video, you can discover how machine learning transforms the way we analyze, predict, and execute trades. A comprehensive guide you through the process of designing and creating a machine learning strategy that can be implemented in live markets. Leverage data-driven decision-making with machine learning and its applications in the world of trading!</p><!--kg-card-begin: html--><iframe width="900" height="415" class="lazyload" data-src="https://www.youtube.com/embed/tUN9XGAGRYg?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!--kg-card-end: html--><h2 id="resources-to-learn-machine-learning">Resources to learn machine learning</h2><p>Various resources are available to learn machine learning concepts. To learn from basics to advanced, concepts, terminologies, projects and more, you can check out these <a href="https://blog.quantinsti.com/tag/machine-learning/">blogs on machine learning</a>.</p><p>Let us see some other resources below.</p><h3 id="courses">Courses</h3><p>First of all, let us see which <a href="https://quantra.quantinsti.com/learning-track/machine-learning-deep-learning-in-financial-markets">courses</a> can be explored for learning machine learning. Here is a list:</p><p><a href="https://quantra.quantinsti.com/learning-track/machine-learning-deep-learning-in-financial-markets">Learning Track: Machine Learning &amp; Deep Learning in Financial Markets</a></p><p>The courses in the learning tracks cover everything from simple to complex models.</p><p>Hence, be it a beginner or an expert wanting to move to the next advanced step, this learning track is suitable for all.</p><p>With the courses, you will learn:</p><ul><li>Tuning hyperparameters</li><li>Gradient boosting</li><li>Ensemble methods</li><li>Advanced techniques to make robust predictive models</li><li>To use unsupervised learning in trading to enhance the algorithms</li></ul><p><a href="https://quantra.quantinsti.com/course/python-machine-learning">Python for Machine Learning in Finance</a></p><p>The course is perfect for those looking to get started on using Python for machine learning. With this course, you will get a step-by-step guide on creating machine learning algorithms for trading.</p><p>Also, you can evaluate the performance of the machine learning algorithm and perform <a href="https://blog.quantinsti.com/backtesting/">backtest</a>, paper trading and live trading with Quantra’s integrated learning.</p><h3 id="videos">Videos</h3><p><a href="https://www.youtube.com/watch?v=m4BFOSaos7M">Machine Learning for Trading by Dr. Ernest Chan</a></p><p>Before giving the introduction to the video, let us first know a bit about  Dr. Chan.</p><p>Dr. Chan is a well-renowned global personality in the domain of Algorithmic and Quantitative Trading. He is the Managing Member of QTS Capital Management, LLC. Also, he has worked for various investment banks (Morgan Stanley, Credit Suisse, Maple) and hedge funds (Mapleridge, Millennium Partners, MANE) since 1997.</p><p>In this video, Dr. Ernest Chan answers some of the most asked questions on machine learning for trading, brought to you by QuantInsti.</p><p><a href="https://www.youtube.com/watch?v=c6sKPJd0fDE&amp;t=2s">Machine Learning For Traders: An Introduction</a></p><p>This video is apt for those who want to know what machine learning is and the difference between a regular algorithm in a programming language (Python, C++, etc.) and a machine learning algorithm.</p><p>Also, this video includes examples of machine learning (ML) algorithms in the real world, industries using machine learning and implementation and usage of machine learning in trading.</p><p><a href="https://www.youtube.com/watch?v=kQc3TVaO2J4">Machine Learning For Traders: Terminologies</a></p><p>In this video, we discuss certain terms in machine learning. They are training and testing data sets. This video will also help you learn the types of machine learning tasks namely-</p><ul><li>Supervised Learning</li><li>Unsupervised Learning</li><li>Reinforcement Learning</li></ul><p><a href="https://www.youtube.com/watch?v=0IWLfTomLLg&amp;t=1s">Machine Learning For Traders - An Introduction To Classification</a></p><p>In this video, you will learn the following points:</p><ul><li>Introduction to Classification</li><li>Application in various fields such as:</li><li>Medical Diagnosis</li><li>Fraud detection</li><li>Handwriting recognition</li><li>Customer segmentation</li><li>Risk assessment</li><li>An example of a Classification used by E-Commerce websites</li><li>It is not restricted to text and numbers, even images can be classified</li><li>Supervised classifier algorithms</li><li>The classifier algorithms can be chosen, depending on</li><li>Size of training data</li><li>Independence of features set</li><li>System speed</li></ul><p>Also, the classifier algorithms covered in this video are:</p><ul><li>K-Nearest Neighbours Algorithm (KNN)</li><li>Random Forests Using Decision Trees</li><li>Artificial Neural Networks (ANN)</li><li>Naive Bayes Classification</li></ul><h3 id="books">Books</h3><p>Further, and lastly, there are <a href="https://blog.quantinsti.com/books-algorithmic-trading/">some useful books</a> which can help you learn all about machine learning. Books are a great source of learning for those who enjoy reading for learning purposes. Also, those who want to learn the concepts with much more detailed explanations can opt for books when it comes to learning.</p><h2 id="the-future-of-machine-learning">The future of machine learning</h2><p>Machine learning is a versatile and powerful technology. The future of machine learning is exceptionally exciting.</p><p>Machine learning could be a contested merit to an enterprise or an organisation as tasks that are presently being done manually shall be wholly accomplished by the machines in the future.</p><p>As per the report <a href="https://www.globenewswire.com/news-release/2022/04/04/2415724/0/en/Machine-Learning-Market-Size-2022-2029-Worth-USD-209-91-Billion-Exhibiting-a-CAGR-of-38-8.html">⁽⁹⁾</a>, the machine learning (ML) market size was USD 15.44 billion in 2021. The market size is expected to rise from USD 21.17 billion in 2022 to USD 209.91 billion by 2029 at a CAGR of 38.8% during the forecast period.</p><p><strong>Bibliography</strong></p><ul><li>Solomonoff, R.J. (June 1964). "A formal theory of inductive inference. Part II" <a href="https://doi.org/10.1016%2FS0019-9958%2864%2990131-7">⁽¹⁰⁾</a>. Information and Control.</li><li>Mitchell, Tom (1997) <a href="https://en.wikipedia.org/wiki/Tom_M._Mitchell">⁽¹¹⁾</a>. Machine Learning <a href="http://www.cs.cmu.edu/~tom/mlbook.html">⁽¹²⁾</a>. New York: McGraw Hill.</li><li>Cortes, Corinna <a href="https://en.wikipedia.org/wiki/Corinna_Cortes">⁽¹³⁾</a>; Vapnik, Vladimir N. (1995). <a href="https://doi.org/10.1007%2FBF00994018">"Support-vector networks"</a>. Machine Learning <a href="https://en.wikipedia.org/wiki/Machine_Learning_(journal)">⁽¹⁴⁾</a>.</li><li>Stuart J. Russell, Peter Norvig (2010) Artificial Intelligence: A Modern Approach <a href="https://en.wikipedia.org/wiki/Artificial_Intelligence:_A_Modern_Approach">⁽¹⁵⁾</a>, Third Edition, Prentice Hall.</li></ul><h3 id="conclusion">Conclusion</h3><p>Machine learning, being so important for various fields, has gained popularity for all the right reasons. By learning about the prerequisites and adopting the same, one can use machine learning. Also, the future of machine learning seems to be bright. Hence, learning all about the famous machine learning has several advantages.</p><p>Begin your journey in the world of machine learning with our course on <a href="https://quantra.quantinsti.com/course/introduction-to-machine-learning-for-trading">Introduction to machine learning </a>and become an expert in using machine learning algorithms.</p><p><a href="https://quantra.quantinsti.com/course/introduction-to-machine-learning-for-trading">Artificial intelligence in trading</a> enhances these algorithms by analyzing vast amounts of market data in real time, improving decision-making and optimizing trading strategies. Integrating AI with machine learning allows traders to gain a competitive edge through more accurate predictions.</p><p>With the help of several important research studies in the domain, this course helps you find out how different machine learning algorithms are implemented on financial markets data.</p><p>If you want to learn various aspects of Algorithmic trading then check out our <a href="https://www.quantinsti.com/">Executive Programme in Algorithmic Trading</a> (EPAT®). The course covers training modules like Statistics &amp; Econometrics, Financial Computing &amp; Technology, and Algorithmic &amp; Quantitative Trading. EPAT® is designed to equip you with the right skill sets to be a successful trader. Enroll now!</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><p><em><small>Note: The original post has been revamped on 26th September 2022 for accuracy, and recentness.</small></em></p><!--kg-card-end: html--><!--kg-card-begin: html--><p><em><small>Disclaimer: All investments and trading in the stock market involve risk. Any decision to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.</small></em></p><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[From Neuroscience to Systematic Trading: Renan's EPAT Journey]]></title><description><![CDATA[Discover how Renan, a fixed-income trader with a neuroscience background, used EPAT to build systematic algorithms, apply mean reversion strategies, and work toward launching his own trading shop.]]></description><link>https://www.quantinsti.com/articles/renan-epat-journey-neuroscience-systematic-trading/</link><guid isPermaLink="false">69eb2a1a74e6f000074e6c26</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[MOHIT KARWAL]]></dc:creator><pubDate>Fri, 24 Apr 2026 11:59:17 GMT</pubDate><content:encoded><![CDATA[<p>What does the study of the brain have to do with the behavior of financial markets? For <a href="https://www.linkedin.com/in/renan-costa-vieira-de-paula-cqf-15b23a108/">Renan Costa Vieira de Paula</a>, the answer is: quite a lot.</p><p>Renan's path into finance was anything but conventional. With an academic foundation in neuroscience from the Federal University of ABC, he spent years understanding complex systems, identifying patterns, and tracing cause and effect. That scientific mindset, developed long before he ever stepped onto a trading floor, quietly became the backbone of how he would later approach markets.</p><p>His professional journey began in credit, working with large enterprises for four years, before transitioning into fixed income. Today, he works at a firm that trades across the majority of assets in the Brazilian market. His role revolves around price distribution, order book dynamics, and bid-ask movements, ensuring rates on his firm's proprietary platform reflect best market practices. On any given day, he trades roughly 400 assets across Brazil.</p><blockquote>Beyond his desk, he continues to explore crypto and prediction markets, not as a side interest, but as an extension of a deeper conviction. For Renan, markets are both a profession and a passion. As he puts it, <br>"I hope it continues for the rest of my life. I think it's not possible to stop."</blockquote><hr><h2 id="why-algo-trading"><strong>Why Algo Trading?</strong></h2><p>The shift toward algorithmic trading did not come from curiosity alone. It came from necessity. Working in fixed income, Renan encountered practical problems that demanded more than intuition could offer. </p><blockquote>"I needed to understand better how the order book influences prices. I wanted to understand how to measure it, how to quantitatively understand the prices I was seeing, how to create indicators and metrics to measure the effects I was facing," he recalls.</blockquote><p>He was searching for rigor. For structure. For tools that would allow him to approach trading decisions the same way he once approached scientific questions. As he puts it, the goal was to figure out <em>"how to make some P&amp;L with it." </em><br>He wanted a framework that could translate market behavior into measurable, repeatable systems.</p><hr><h2 id="why-epat"><strong>Why EPAT?</strong></h2><p>During his search for structured learning in algorithmic trading, EPAT stood out on two fronts: the credibility of its faculty and the practicality of its format.</p><p>Renan was already familiar with leading quantitative thinkers and had read their work. Knowing that these practitioners were part of the EPAT curriculum gave him confidence that the program offered genuine depth, not surface-level exposure. "I was already a big fan. I had read the books of those professors. So it was a very good choice," he says.</p><p>The format mattered equally. Working full-time, he needed a learning structure that would not disrupt his career. He recalls:</p><blockquote>"The courses being taken on Saturdays and Sundays helped a lot. The pace was very good too. It made me feel very comfortable and very stimulated to continue the journey."</blockquote><p>Above all, what convinced him was the chance to learn directly from practitioners who had built real trading strategies. He points to <em>"the structure of the course and the possibility to take courses of the great minds in algorithmic trading"</em> as the most important factors in his decision.</p><hr><h2 id="how-epat-shaped-his-thinking"><strong>How EPAT Shaped His Thinking</strong></h2><p>Renan is candid about what EPAT was designed to be, and what it was not.</p><blockquote>"I think it wasn't enough, but I think it's not supposed to be enough."</blockquote><p>For him, the program was never the final destination. It was the launchpad. EPAT built the theoretical foundations and the systematic mindset required to keep growing independently beyond the six months. </p><blockquote>"The program opened my mind for other universes I was not aware of the existence of," he says.</blockquote><p>One of the most pivotal experiences came when professors bridged the gap between abstract theory and practical implementation. He describes those moments vividly: </p><blockquote>"My favorite moments were when the professors, after laying the foundations and giving their thoughts on the mindset of a trader and the theoretical framework, concluded in a strategy that wrapped all the things they had said before."</blockquote><p>Topics like mean reversion, co-integration, statistical arbitrage, and futures trading resonated most, aligning closely with his fixed-income background and statistical intuitions. He describes the full arc of the learning experience: </p><blockquote>"You translate the market into a theoretical framework, and then you translate that theoretical framework into an algorithm that will try to capture the phenomena in the market."</blockquote><p>The learning environment extended beyond lectures as well. Whenever Renan sought scientific papers, articles, or reading recommendations, the support was readily available. Intellectual curiosity was not just tolerated, it was actively encouraged.</p><hr><h2 id="the-real-challenge"><strong>The Real Challenge</strong></h2><p>With prior programming experience and a strong mathematical background, Renan did not find the technical content particularly intimidating. For him, the real challenge was time.</p><blockquote>"The most difficult part was having enough time to explore all the possibilities, because it is a huge universe of areas," </blockquote><p>he explains. Six months is enough to build solid foundations, but far from enough to explore every corner of the field. Balancing a demanding full-time role in fixed income with intensive technical learning required genuine discipline. He viewed this not as a flaw but as intentional program design: broad exposure first, deep specialisation later.</p><p>When roadblocks did arise, EPAT's support team responded quickly.</p><blockquote>"If I had some difficulties, the team was very ready to help," </blockquote><p>he says, noting that this reduced friction and kept momentum going.</p><hr><h2 id="life-after-epat"><strong>Life After EPAT</strong></h2><p>The impact of the program became most visible in Renan's day-to-day trading.</p><p>Before EPAT, he had ideas about structuring systematic approaches. After EPAT, those ideas became rigorous. </p><blockquote>"The program gave me the foundations to be more rigorous, more scientific about the methods and about the implementation," </blockquote><p>he says. He now applies mean reversion algorithmics directly on his fixed-income trading desk, building indicators, measuring deviations from expected behavior, and systematically identifying opportunities where prices diverge from historical patterns.</p><p>The shift was not merely technical. Instead of relying on intuition, he now deploys structured algorithms tailored to Brazil's unique market dynamics. As he puts it: </p><blockquote>"I took some of the algorithms, tried to modify them for my daily basis, and implemented them. And when I said I was studying it in the program and making it in my daily basis, people knew: okay, he knows what he is doing."</blockquote><p>The credentials also strengthened his professional standing. When proposing systematic strategies internally, his structured, evidence-based approach now inspires greater confidence among colleagues and stakeholders.</p><hr><h2 id="epat-and-the-role-of-ai"><strong>EPAT and the Role of AI</strong></h2><p>As AI tools have become more accessible, Renan has integrated them into his workflow, but thoughtfully.</p><p>He is direct about what AI can and cannot do: </p><blockquote>"For AI to work, you need to know what to search. You need to know how to make the algorithm work and how it improves your day." </blockquote><p>Without foundational understanding, no AI tool can replace strategic thinking.</p><p>His practical approach today: </p><blockquote>"Let's say I'm reading a paper. I understood a mathematical equation and I say, okay, this is what I wanted. I use AI to help me translate those equations into modules." </blockquote><p>What once required two or three hours of manual implementation can now be accelerated, without surrendering control over the underlying strategy.</p><p>He is clear about the limits: </p><blockquote>"I don't think it is for making the whole picture. But helping with specific points, it is very, very good." </blockquote><p>For Renan, AI is a tool for scale and efficiency, one that only delivers value when the person using it already knows what they are looking for.</p><hr><h2 id="looking-ahead"><strong>Looking Ahead</strong></h2><p>Over the next two to three years, Renan plans to deepen his work in crypto and prediction markets. </p><blockquote>"I think there is a lot to understand, and as these markets are new for anyone, they have a lot of inefficiencies. Those algorithms are very, very good to exploit these kinds of opportunities," he says.</blockquote><p>In parallel, he aims to expand algorithmic applications within Brazil's evolving derivatives and fixed income landscape, noting that <em>"the landscape here in Brazil is evolving, especially in derivatives and fixed income."</em></p><p>The longer-term vision is larger still. </p><blockquote>"In five to ten years, I hope to have my own trading shop to exploit these strategies," he shares. He credits EPAT for pointing toward that path: "It is very focused on creating your own shop and making the self-sufficient way. You can talk with friends and say, okay, I know about these strategies, you know about these strategies, what about we start something and work for our own."</blockquote><p>He describes algorithmic trading as a lifelong pursuit, a journey that continues to evolve with every new strategy tested and every new market explored. EPAT, in that journey, was not simply a course. It was the framework that helped transform analytical curiosity into systematic capability, and ambition into structured execution.</p><hr><h2 id="frequently-asked-questions"><strong>Frequently Asked Questions</strong></h2><p><strong>Q. Can someone from a non-finance background learn algorithmic trading?</strong> </p><p>Yes. Renan's own background was in neuroscience before he moved into finance. What matters most is an analytical mindset and a willingness to learn systematically. Structured programs can guide learners from foundational concepts to practical implementation, regardless of their starting point.</p><p><strong>Q. Is prior programming knowledge required for EPAT?</strong> </p><p>No. Many learners begin with little to no coding experience. EPAT is structured to build programming skills progressively, starting from basics and moving toward strategy development, backtesting, and automation. Prior experience can accelerate the pace, but it is not a prerequisite.</p><p><strong>Q. How does algorithmic trading apply to fixed-income markets?</strong></p><p> Algorithmic approaches in fixed income can include mean reversion strategies, spread analysis, order book dynamics, and statistical modelling of price distributions. Practitioners like Renan apply these techniques to identify systematic opportunities across large numbers of instruments simultaneously.</p><p><strong>Q. How long does it take to apply EPAT learnings in a real trading environment?</strong> </p><p>This varies by role and market access. For Renan, the transition was relatively direct, as his professional context allowed him to begin applying mean reversion algorithmics shortly after completing the program. Others may spend additional time refining strategies in simulated environments before deploying them live.</p><p><strong>Q. What is the role of AI in algorithmic trading today?</strong> </p><p>AI tools can accelerate research, code translation, and data analysis. However, as Renan emphasises, AI is only as effective as the foundation it sits on. Traders who understand quantitative concepts can use AI to scale their work; those without that foundation may find it difficult to direct AI toward meaningful outcomes.</p><p><strong>Q. Is EPAT worth it for professionals already working in finance?</strong> </p><p>For practitioners seeking to move from intuitive to systematic approaches, EPAT offers structured frameworks, practitioner-led instruction, and a peer network that complements existing experience. Renan credits the program with transforming how he structures strategies and presents them internally.</p><p><strong>Q. What markets are most suited to systematic trading strategies?</strong> </p><p>Systematic strategies can be applied across equities, fixed income, derivatives, crypto, and prediction markets. The key is identifying markets with sufficient data, liquidity, and structural patterns that algorithms can exploit. Renan sees particular opportunity in crypto and prediction markets due to their relative inefficiency.</p><hr><h2 id="next-steps"><strong>Next Steps</strong></h2><p>If you are just getting started with algorithmic trading, begin with the<a href="https://quantra.quantinsti.com/"> Quantitative Trading Free Learning Track</a>. It includes beginner-friendly courses covering data basics, trading strategies, and coding for finance.</p><p>Once you are ready to go deeper, explore<a href="https://quantra.quantinsti.com/"> Quantra's Algorithmic Trading for Beginners Learning Track</a>, which offers hands-on, application-focused modules to build your skills step by step.</p><p>For those looking for a comprehensive, guided journey with mentorship, live lectures, and career support, the<a href="https://www.quantinsti.com/epat"> Executive Programme in Algorithmic Trading (EPAT)</a> provides a complete foundation for launching or accelerating a career in this field.</p><h3 id="schedule-an-epat-counselling-call">Schedule an EPAT counselling call </h3><p>To understand if EPAT is the right choice for you, talk to one of our specialists who have counselled thousands of learners over the past decade and helped them make the right career decision.</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>
<!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[From Guesswork to Market Structure: Edwin Lima’s Journey into Professional Trading with EPAT]]></title><description><![CDATA[Discover how Edwin Lima moved from informal, guesswork-based trading to a more structured, professional trading approach through EPAT.]]></description><link>https://www.quantinsti.com/articles/edwin-lima-epat-journey-guesswork-professional-trading/</link><guid isPermaLink="false">69eb22fb74e6f000074e6bd6</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[MOHIT KARWAL]]></dc:creator><pubDate>Fri, 24 Apr 2026 11:59:14 GMT</pubDate><content:encoded><![CDATA[<p>By QuantInsti</p><p>For more than 25 years, <a href="https://www.linkedin.com/in/limaedwin/">Edwin Lima</a> has worked in the world of data.</p><p>As an independent data engineering consultant, he has built systems and solved technical problems for major airlines, banks such as Amro and Rabobank, government institutions, and currently, Rotterdam City Hall. With a Master’s degree in Artificial Intelligence and a computer science foundation that goes back to 1997, Edwin’s technical depth was never in doubt.</p><p>But when it came to trading, he felt something was missing.</p><blockquote>“I was not doing it right… the way I was doing it was more like a guesswork. It was not a structured way of doing it, and a thoughtful way of doing it.”</blockquote><p>Like many professionals, he initially approached trading as a side pursuit. The goal was simple: learn the markets, make better decisions, and create another source of income. But over time, the absence of structure began to bother him.</p><p>What started as curiosity became discomfort. And that discomfort eventually became a decision.</p><p>He needed formal education.</p><h2 id="why-trading-needed-structure"><strong>Why Trading Needed Structure</strong></h2><p>Edwin’s interest in markets was not new. In fact, it went back to his academic work.</p><p>His master’s thesis focused on predicting cryptocurrency trading positions using reinforcement learning. He built the project before ever placing a trade himself.</p><blockquote>“I did this project without having made a trade ever in my life. Never. I did it blindly.”</blockquote><p>At the time, he approached the problem like a data engineer and AI practitioner. He worked with OHLC data and applied reinforcement learning methods that are often used in robotics and decision systems. The backtest results looked promising.</p><p>But backtests and real markets are not the same thing.</p><p>That gap became impossible to ignore. Edwin realized that while he had the technical tools to model trading ideas, he did not yet have the professional understanding of how markets truly function. He needed more than code and academic experimentation. He needed context, structure, and a proper framework.</p><h2 id="why-he-chose-epat"><strong>Why He Chose EPAT</strong></h2><p>When Edwin began researching programmes, he was clear about what he was not looking for.</p><blockquote>“I also didn't want to join a program that offers to make you rich because I don't think that can be true.”</blockquote><p>He was not interested in shortcuts or exaggerated promises. He wanted to understand how trading works professionally, not as retail speculation dressed up in marketing language.</p><p>That is what made EPAT stand out.</p><p>He found the programme online and was drawn to the way it positioned trading as a professional discipline. For him, the appeal was not just in learning strategies, but in learning how markets operate through an institutional lens.</p><blockquote>“EPAT was a professional path… and I understood that you are not giving a training for trading, but this is for corporate, right? Which is very, very interesting.”</blockquote><p>This distinction mattered deeply to him. It suggested that the programme would go beyond charts and indicators, and into the mechanics of risk, execution, liquidity, infrastructure, and market behavior at scale.</p><blockquote>“This was a completely different world for me… a world that I didn’t know existed.”</blockquote><p>The pricing was competitive compared to alternatives, but that was not the main reason he enrolled. What really convinced him was that the programme did not sell dreams. It offered structure, depth, and seriousness.</p><h2 id="the-epat-experience"><strong>The EPAT Experience</strong></h2><p>For Edwin, the challenge of EPAT was not intellectual difficulty. He could follow the ideas and keep up with the lectures. The real challenge was the sheer breadth of the curriculum.</p><p>In just six months, the programme covered statistics, economics, microeconomics, probabilities, market microstructure, time series analysis, Python, backtesting, risk management, machine learning, reinforcement learning, and NLP.</p><p>It was not any one topic that tested him. It was the volume, the intensity, and the persistence required to keep going while working full-time.</p><p>To prepare for the final exam, Edwin studied from 9 PM until 2 or 3 in the morning for nearly a month.</p><blockquote>“I think you guys are not testing whether someone knows the matter… but whether someone is resilient enough to hold up.”</blockquote><p>That line captures an important truth about the experience. EPAT did not just deepen his knowledge. It demanded consistency, discipline, and commitment.</p><p>And it paid off.</p><p>Somewhere along the way, Edwin began to see markets differently. He started to understand what corporate trading really means, how large participants execute, how liquidity matters, how risk is controlled, and how institutions operate behind the scenes.</p><blockquote>“That was actually very nice… to learn how corporate trading works.”</blockquote><p>One of the biggest shifts came from understanding that market prices are not simply drifting on abstract theory.</p><p>That realization pushed him beyond surface-level indicator thinking. It made him ask deeper questions about structure, liquidity, flows, and regime changes. It brought him closer to the way professional traders and quants think.</p><p>Just as importantly, he felt supported by the faculty guiding him through the process.</p><blockquote>“The teachers are amazing. All five stars teachers.”</blockquote><h2 id="how-epat-changed-his-thinking"><strong>How EPAT Changed His Thinking</strong></h2><p>One of the clearest signs of Edwin’s transformation is how he now reflects on his earlier academic work.</p><p>When asked what he would change about his master’s thesis today, his answer was revealing. He would engineer features differently. He would avoid curve smoothing. He would benchmark more carefully. He would focus on predicting positions rather than prices. He would respect non-stationarity. He would evaluate performance more thoughtfully.</p><p>That is not a small adjustment. It is a complete shift in mindset.</p><p>Before, he was thinking like a skilled data scientist applying AI techniques to market data. After EPAT, he began thinking more like a quant, someone who understands that models must live inside the realities of market structure, execution, and regime change.</p><p>This is where the programme made its deepest impact. It did not just give him more tools. It changed how he framed the problem.</p><h2 id="life-after-epat"><strong>Life After EPAT</strong></h2><p>After completing the programme, Edwin took a short break from the intensity of studying. But he did not stop building.</p><p>Even while continuing in his full-time consulting role, he is steadily working toward a larger goal. His evenings are no longer filled with coursework. They are now focused on designing and refining trading strategies.</p><p>Today, he is building a system based on market structure rather than relying purely on indicators. His process involves identifying regime changes, assessing context, waiting for confirmation, entering trades based on structured hypotheses, and exiting when those hypotheses no longer hold.</p><blockquote>“I’m not predicting prices. I’m looking at the market structure.”</blockquote><p>This is a very different approach from informal retail trading. It is slower, more deliberate, and rooted in validation.</p><p>He is testing across different granularities. He is thinking in terms of context and confirmation. Risk management is part of the system, not something added later. What he is building is not a collection of guesses. It is an engineered process.</p><p>And that might be the best way to describe what changed.</p><p>This is no longer guessing. This is engineering.</p><h2 id="his-long-term-vision"><strong>His Long-Term Vision</strong></h2><p>Edwin is clear about what he wants in the long run.</p><blockquote>“I really would like to trade as a living.”</blockquote><p>While he continues to do well in his professional consulting career, his long-term goal is to transition into trading full-time if his strategies continue to mature and perform consistently.</p><p>For him, trading is not just financially attractive. It is intellectually satisfying.</p><blockquote>“You do work, it’s challenging, and at the end of the day you say okay I have made some bucks… I find it really very nice.”</blockquote><p>He even imagines one day working alongside institutional traders at a professional trading desk. The difference now is that he understands what that world actually looks like. It is no longer a vague ambition. It is a concrete path shaped by structure, knowledge, and experience.</p><p>For Edwin, EPAT replaced guesswork with professional context. It replaced informal experimentation with a disciplined framework. And while his journey is still unfolding, he is now moving forward with far more clarity and confidence.</p><h2 id="frequently-asked-questions"><strong>Frequently Asked Questions</strong></h2><p><strong>Q. Can someone with a technical background still benefit from formal trading education?</strong><br>Yes. Edwin already had deep technical expertise in data engineering and AI, but EPAT helped him develop a professional understanding of markets, execution, risk, and institutional trading dynamics.</p><p><strong>Q. What kind of learner is EPAT suitable for?</strong><br>EPAT is well suited for learners who want more than surface-level trading education. It is especially valuable for those looking for a structured, professional, and rigorous approach to algorithmic and quantitative trading.</p><p><strong>Q. Was the biggest challenge for Edwin the difficulty of the concepts?</strong><br>Not exactly. For Edwin, the challenge was more about the breadth and intensity of the curriculum rather than not being able to understand the concepts themselves.</p><p><strong>Q. How did EPAT change Edwin’s view of trading?</strong><br>It shifted his mindset from casual, indicator-based speculation to structured thinking around market mechanics, liquidity, regime shifts, risk, and validation.</p><p><strong>Q. Is EPAT only useful for people who want to join a trading desk?</strong><br>No. It can also help professionals who want to build their own systematic trading processes independently, as Edwin is doing while continuing his consulting career.</p><p><strong>Q. What is one major takeaway from Edwin’s journey?</strong><br>That trading knowledge is not just about models or code. It is about context, structure, resilience, and learning how markets actually function.</p><h3 id="next-steps">Next Steps</h3><p>If you come from a technical, finance, or non-trading background and want to approach the markets more seriously, Edwin’s story is a strong reminder that skill in one domain does not automatically translate into trading clarity. What often makes the difference is structured learning.A programme like <a href="https://www.quantinsti.com/epat">EPAT</a> can help bridge that gap by combining quantitative methods, market understanding, risk frameworks, and practical implementation in one guided journey.</p><h3 id="schedule-an-epat-counselling-call">Schedule an EPAT counselling call</h3><p>To understand if EPAT is the right choice for you, talk to one of our specialists who have counselled thousands of learners over the past decade and helped them make the right career decision.</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>
<!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[From Emotion to Execution: How Brian Built a More Disciplined Trading Approach with EPAT]]></title><description><![CDATA[Discover how Brian moved from emotional manual trading to disciplined, systematic strategy building through EPAT, Python, and data-driven thinking.]]></description><link>https://www.quantinsti.com/articles/brian-epat-journey-manual-algorithmic-trading/</link><guid isPermaLink="false">69eb18d074e6f000074e6bb8</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[MOHIT KARWAL]]></dc:creator><pubDate>Fri, 24 Apr 2026 11:59:10 GMT</pubDate><content:encoded><![CDATA[<p>By QuantInsti</p><p>Brian’s journey into trading did not begin with algorithms, Python notebooks, or machine learning models. It began in a place that feels familiar to many aspiring traders: curiosity, experimentation, and the hope that markets could offer both flexibility and independence.</p><p>Coming from a background in Economics and Finance, he initially approached the markets through manual trading. He explored long-term investing, buy-and-hold strategies, trend following, and technical indicators like moving averages. On paper, the ideas made sense. In practice, something kept getting in the way.</p><blockquote>“Emotions involved… sometimes you can get too greedy or too fearful and then it really messes with your decisions.”</blockquote><p>That realization became the turning point. What Brian was really searching for was not just a better strategy, but a better way to think, test, and execute.</p><hr><h2 id="why-trading"><strong>Why Trading?</strong></h2><p>Trading appealed to Brian because it felt like one of the few fields where effort, analysis, and independent decision-making could directly shape outcomes. It offered room to think for oneself, adapt quickly, and build something personal over time.</p><p>At first, he explored the markets in a conventional way. Like many new traders, he tested different styles and tried to find what suited him best. But over time, he discovered that knowing a strategy and following a strategy were not the same thing.</p><p>The challenge was not only market direction. It was discipline.</p><p>Manual trading left too much room for second-guessing, hesitation, and impulsive decisions. Even when the setup was clear, emotions often changed the outcome. That gap between theory and execution pushed him to rethink his approach more seriously.</p><hr><h2 id="discovering-algorithmic-trading"><strong>Discovering Algorithmic Trading</strong></h2><p>The real shift came when market conditions changed, especially during crypto bear cycles, where straightforward buy-and-hold approaches stopped delivering the same results. Brian began looking for a framework that could help him stay systematic even when markets became difficult.</p><p>That is when algorithmic trading started to make sense.</p><p>What drew him in was not just automation for the sake of convenience. It was the promise of structure. Rules could be defined in advance. Strategies could be backtested on historical data. Decisions could be evaluated with evidence rather than memory.</p><p>In other words, it gave him a way to move away from reaction and toward repeatability.</p><blockquote>“The idea was compelling because it could remove the emotion part of it and also stick to the trading rule.”</blockquote><p>Compared to manual trading, this felt like an entirely different world. Suddenly, he could test ideas properly, experiment with more complexity, and learn without putting capital at risk immediately.</p><hr><h2 id="why-epat-stood-out"><strong>Why EPAT Stood Out</strong></h2><p>Once Brian knew he wanted to pursue algorithmic trading seriously, he started looking for structured learning options. Much of what he found online felt fragmented. Some resources were useful, but many were limited to pre-recorded videos or occasional webinars without enough depth, support, or continuity.</p><p>EPAT stood out because it felt more complete.</p><p>It was not just the curriculum that made the difference. It was the overall learning environment: multiple experts, live sessions, a cohort-based format, and the ability to ask questions instead of learning passively in isolation.</p><p>For Brian, that support mattered.</p><blockquote>“It felt a lot more holistic… you have a whole company with different experts behind it.”</blockquote><p>He also appreciated that help did not stop when the lecture ended. The accessibility of faculty and support teams made the process feel more guided and less intimidating, especially for someone building a new skill set from the ground up.</p><blockquote>“Very, very good support… compared to other courses where there’s almost no support at all.”</blockquote><p>That combination of structure and responsiveness helped turn what could have been an overwhelming transition into a manageable one.</p><hr><h2 id="from-non-coder-to-builder"><strong>From Non-Coder to Builder</strong></h2><p>Although Brian was confident in his decision, the journey itself was not effortless. Coming from a non-programming background, learning Python was one of the first major hurdles.</p><p>Even with preparatory materials, it took time to become comfortable with writing and understanding code. But the hands-on nature of the programme made a big difference. Instead of only learning concepts in the abstract, he could see them in action.</p><p>Jupyter notebooks, in particular, helped him bridge the gap between theory and practice. They allowed him to run code, make changes, observe outputs, and learn interactively. That immediate feedback loop made the learning process far more tangible.</p><p>As his understanding deepened, so did his mindset.</p><p>Brian began to see strategy development less as guesswork and more as a research process. He started treating strategy testing with the rigor of a repeatable experiment.</p><blockquote>“It should be like a science experiment where you have different trials and you record down… the result.”</blockquote><p>That shift is one of the most meaningful parts of his journey. He was no longer simply trying to find a winning setup. He was learning how to think like a systematic trader and builder.</p><hr><h2 id="life-after-epat"><strong>Life After EPAT</strong></h2><p>For Brian, EPAT was never the finish line. It became the foundation.</p><p>After completing the programme, he continued building on what he had learned rather than stopping at the curriculum. He specialised in machine learning for trading and developed a project using an LSTM neural network. Later, he expanded beyond that, experimenting with other models such as tree-based boosting algorithms and refining how he approached prediction and strategy development.</p><p>This post-EPAT phase is where the deeper transformation became visible.</p><p>Instead of depending on fixed templates or looking for ready-made answers, Brian kept exploring independently. He continued trading primarily on his own, adapting methods, improving systems, and testing ideas with greater confidence and structure.</p><p>That independent momentum is often what separates a course completion story from a real career and mindset shift. In Brian’s case, the learning kept compounding.</p><hr><h2 id="ai-and-the-future-of-trading"><strong>AI and the Future of Trading</strong></h2><p>Brian believes today’s trading environment is more accessible than ever, especially because of advances in AI tools. Tasks that once consumed hours, whether debugging code, searching for technical explanations, or iterating on ideas, can now move much faster.</p><p>But he is equally clear about something important: AI is only as useful as the thinking behind it.</p><p>In his view, structured learning still matters because it teaches traders how to ask better questions, frame problems properly, and evaluate outputs critically. Without that foundation, AI can accelerate confusion just as easily as it can accelerate progress.</p><blockquote>“The quality of the questions or the instruction or the prompts that you give” makes a huge difference.</blockquote><p>That perspective reflects a mature understanding of the modern trading workflow. AI can help with speed, iteration, and support. But domain knowledge, judgment, and systematic thinking still remain essential.</p><p>Looking ahead, Brian expects markets, especially crypto, to keep evolving rapidly. New cycles will create new themes, new inefficiencies, and new opportunities. His goal is not to cling to one fixed approach, but to remain adaptive and continue integrating AI more meaningfully into his workflow.</p><hr><p>Brian’s story is not just about moving from manual trading to algorithmic trading. It is about moving from emotion to process, from uncertainty to experimentation, and from consuming strategies to building them with intent.</p><p>It shows that the most important transformation is often internal. Tools matter. Technology matters. But the real shift happens when a trader begins to think in systems, test with discipline, and learn with patience.</p><p>Even now, Brian’s advice remains simple and timely:</p><blockquote>“It’s a great time to start now… it will make things so much faster and easier.”</blockquote><hr><h2 id="frequently-asked-questions"><strong>Frequently Asked Questions</strong></h2><p><strong>Q. Can someone from a finance or non-coding background learn algorithmic trading?</strong><br>Yes. Brian’s story shows that a non-programming background does not prevent someone from learning algorithmic trading. What matters more is a willingness to build skills step by step and stay consistent through the learning curve.</p><hr><p><strong>Q. Why do many manual traders move toward algorithmic trading?</strong><br>A major reason is discipline. Manual trading often leaves room for emotional decisions, while algorithmic trading helps traders define rules clearly, test them properly, and execute more systematically.</p><hr><p><strong>Q. Is Python difficult for complete beginners?</strong><br>It can feel unfamiliar at first, especially for those without prior coding exposure. But with hands-on practice, guided learning, and tools like notebooks that make experimentation easier, beginners can gradually become comfortable.</p><hr><p><strong>Q. How important is backtesting in the learning process?</strong><br>Backtesting is critical because it helps traders evaluate ideas using historical data before risking capital. It creates a more evidence-based process and encourages structured experimentation instead of relying on assumptions.</p><hr><p><strong>Q. How should beginners think about strategy development?</strong><br>A useful way is to treat it like a research process. Test ideas methodically, record results carefully, compare variations, and focus on learning what actually works rather than chasing shortcuts.</p><hr><p><strong>Q. Does AI reduce the need for structured learning in trading?</strong><br>No. AI can speed up certain tasks, but structured learning remains important because it helps traders understand markets, ask better questions, and use AI tools more effectively.</p><hr><h2 id="next-steps"><strong>Next Steps</strong></h2><p>If you are just getting started with algorithmic trading, begin with the <a href="https://quantra.quantinsti.com/learning-track/guide-quantitative-trading-beginners">Quantitative Trading</a> Free Learning Track. It includes eight beginner-friendly courses covering data basics, trading strategies, and coding for finance. Once you're ready to dive deeper, you can explore Quantra’s <a href="https://quantra.quantinsti.com/learning-track/algorithmic-trading-beginners">Algorithmic Trading for Beginners</a> Learning Track, which offers hands-on, application-focused modules to build your skills step by step.</p><p>For those looking for a comprehensive and guided journey with mentorship, live lectures, and career support, the <a href="https://www.quantinsti.com/epat">Executive Programme in Algorithmic Trading (EPAT)</a> provides a complete foundation for launching or accelerating a career in this field.</p><hr><h3 id="schedule-an-epat-counselling-call">Schedule an EPAT counselling call</h3><p>To understand if EPAT is the right choice for you, talk to one of our specialists who have counselled thousands of learners over the past decade and helped them make the right career decision.</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>
<!--kg-card-end: html--><p><br></p>]]></content:encoded></item><item><title><![CDATA[Introduction to Support Vector Machines]]></title><description><![CDATA[In this article, we will understand how support vector machines work and its application in trading. We will also go through the maths behind the SVM and the process of using it in a non-linear model.]]></description><link>https://www.quantinsti.com/articles/support-vector-machines-introduction/</link><guid isPermaLink="false">69df427274e6f000074e6b54</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[MuniRaja Puthuru]]></dc:creator><pubDate>Fri, 24 Apr 2026 11:20:18 GMT</pubDate><content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/varun-divakar-b862a667/">Varun Divakar</a></p><p>Support Vector Machines were widely used a decade back, but now they have fallen out of favour. The below data from google trends can establish this more clearly.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/SVM.png" class="kg-image" alt="Support Vector Machines - Google Trends"></figure><p>(Source: <a href="https://trends.google.com/trends/explore?date=all&amp;q=Support%20vector%20machine">Google Trends</a>)</p><h2 id="why-did-this-happen"><strong>Why did this happen?</strong></h2><p>As more and more advanced models were developed, support vector machines fell out of favour. It takes a lot of time to train a non-linear kernel, say RBF (Radial Basis Function), of a support vector machine. But they have been found to be very effective in text classification problems. Support Vector Machines (SVMs) are also good at solving non-linear problems with a small dataset. This is precisely the reason why I prefer SVMs in trading.</p><h2 id="support-vector-machines-in-trading"><strong>Support Vector Machines in trading</strong></h2><p>When it comes to trading, if you are using daily frequency data, then it is very likely that your data set is extremely limited, probably a few thousand data points. Let us say that you have created a trading strategy using a decision tree to extract a high probability rule from the past data. Now you want to understand how this rule would behave on unseen or test data. Creating an SVC to predict when the rule would be a success or failure would help you eliminate the bad trades. Before you try out the SVMs, first let us understand how they work.</p><h2 id="support-vector-machines"><strong>Support Vector Machines</strong></h2><p>A Support Vector Machine is an approach, usually used for performing classification tasks, that uses a separating hyperplane in multidimensional space to perform a given task. Technically speaking, in a p dimensional space, a hyperplane is a flat subspace with p-1 dimensions. For example, In two-dimensions, a hyperplane is a flat one-dimensional subspace or a line. In three dimensions, a hyperplane is a flat two-dimensional subspace that is, a plane.</p><p>If the dimensionality is greater than 3, it can be hard to visualize a hyperplane, but the notion of a p-1 dimensional space still applies.</p><h2 id="understanding-support-vector-machines-with-an-example"><strong>Understanding Support Vector Machines with an example</strong></h2><p>Now that you have a basic understanding of hyperplane, let us understand the intuition behind the Support Vector Machine. Consider a data set of two different classes, shown in blue and red.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/Understanding-Support-Vector-Machines-with-an-example.png" class="kg-image" alt="Understanding Support Vector Machines with an example - Part 1"></figure><p>The data is linearly separable, and there exist multiple separating lines, which are shown in black. All these lines offer a solution, but only one line is optimal and can separate the classes accurately.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/Understanding-Support-Vector-Machines-with-an-example-2.png" class="kg-image" alt="Understanding Support Vector Machines with an example - Part 2"></figure><p>For example, If the line is very close to the data points, even a small noise would lead to misclassification. Here is another line that separates the classes, but doesn’t look like a very natural one. So, the question is which is the best line?</p><p>Support Vector Machine chooses an optimal line which maximizes the distance to the nearest points in either class. This distance is called the margin. As you can see in the figure, the margin is the distance from the solid line to either of the dashed lines.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/Understanding-Support-Vector-Machines-with-an-example-3.png" class="kg-image" alt="Understanding Support Vector Machines with an example - Part 3"></figure><p></p><p>Our aim is to maximize the margin as large as possible in order to get an optimal line. So, the Support Vector Machine is sometimes called Maximum Margin Classifier. In the figure, there are some blue and red data points on the dashed lines. These points are known as support vectors. It is important to note that the maximum margin line or decision boundary depends only on the support vectors, but not on other data points.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/Understanding-Support-Vector-Machines-with-an-example-4.png" class="kg-image" alt="Understanding Support Vector Machines with an example - Part 4"></figure><p>As you can see in the figure, moving the support vectors, also moves the maximum margin line, while moving the other points has no effect. Maximum margin line is only useful when the data is linearly separable, Or in other words, data can be separated by a straight line. In the figure, the data points belong to two classes and are not necessarily separable by a maximum margin line. In fact, if a separating line does exist, it is not optimal, as it misclassifies and has a small margin. So, what approach should we implement when the data is non-linear?</p><p>In that case, we consider enlarging the feature space, such as quadratic, cubic, or even higher-order polynomial, to address this non-linearity. We can enlarge the feature space in a specific way, by using a function which is known as ‘Kernel’. Let us understand kernel is and some of the mathematics behind support vector machines.</p><h2 id="mathematics-of-support-vector-machines"><strong>Mathematics of support vector machines</strong></h2><p>The key points for you to understand about support vector machines are:</p><ol><li>Support vector machines find a hyperplane (that classifies data) by maximizing the distance between the plane and nearest input data points (called support vectors).</li><li>This is done by minimizing the weight vector ‘w’ which is used to define the hyperplane.</li><li>Step 2 relies on optimization theory and certain assumptions (which are detailed out below).</li></ol><h3 id="maximising-the-distance-between-hyperplane-and-support-vectors"><strong>Maximising the distance between hyperplane and support vectors</strong></h3><p>For simplicity, consider the linearly separable data points that belong to either class C<sub>1</sub> or class C<sub>2</sub> with no misclassification for any data points.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/Maximising-the-distance-between-hyperplane-and-support-vectors.png" class="kg-image" alt="Maximising the distance between hyperplane and support vectors - Part 1"></figure><p></p><p>For an unknown input data x, we define a linear discriminate function.</p><p>y = f(x) = w. x + b</p><p>where w is the weight vector which is perpendicular to the hyperplane.</p><p>b is the bias term</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/equation.png" class="kg-image" alt="equation - 1"></figure><p>...(1)</p><p>Let all input points be represented by x<sub>1</sub>, …, x<sub>p</sub> and their corresponding class be represented by y<sub>1</sub>, …, y<sub>p</sub>. So, if x<sub>i</sub> belongs to class c<sub>1</sub>, then corresponding y<sub>i</sub> is equal to +1 and if x<sub>i</sub>i belongs to class c<sub>2</sub>, then corresponding y<sub>i</sub> is equal to -1.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/equation-2.png" class="kg-image" alt="equation - 2"></figure><p>... (2)</p><p>Earlier, we assume that data points belonging to two classes are linearly separable. Then it is possible to select two hyperplanes in a way that there are no points between them and then try to maximize the distance between the two hyperplanes. Such type of Support Vector Machine is known as Hard Margin SVM.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/Maximising-the-distance-between-hyperplane-and-support-vectors-2.png" class="kg-image" alt="Maximising the distance between hyperplane and support vectors - Part 2"></figure><p>The two hyperplanes can be best represented by the equation</p><p>H1 : w.x<sub>i</sub> + b = -1 ... (3)</p><p>H2 : w.x<sub>i</sub> + b = 1 ... (4)</p><p>Suppose x<sub>1</sub> and x<sub>2</sub> be the two closest points on each side of the hyperplane. Then, the equations for the hyperplanes H1 and H2 become:</p><p>w.x<sub>1</sub> + b = -1 ... (5)</p><p>w.x<sub>2</sub> + b = +1 ... (6)</p><p>By differencing the equation (5) and equation (6) we get,</p><p>w (x<sub>1</sub> - x<sub>2</sub> ) = 2 ... (7)</p><p>Dividing both sides of the equation (7) by the magnitude of the ‘w’ we get,</p><p>w (x<sub>1</sub> - x<sub>2</sub> ) / ||w|| = 2 / ||w|| ... (8)</p><p>As we know, when we divide a vector with its magnitude, we get a unit vector. And the magnitude of the unit vector is 1. So, our equation becomes:</p><p>(x<sub>1</sub> - x<sub>2</sub> ) = 2 / ||w|| ... (9)</p><p>(x<sub>1</sub> - x<sub>2</sub> ) is the distance between the two hyperplanes. So, the distance which we are going to maximize is 2 / ||w||. To maximize 2 / ||w|| is to minimize ||w|| and in order to prevent the data points falling into the margin, we add the following constraints.</p><p>Minimize 2 / ||w|| ... (10)</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/eq10.PNG" class="kg-image" alt="Equation - 2"></figure><p>Multiplying both equations by their corresponding y<sub>i</sub> they are transformed into just one equation</p><p>y<sub>i</sub> (w. x<sub>i</sub> + b)≥1 &amp;nbsp ∀i ∈ {1,…,N}</p><p>The above optimization problem is difficult to solve but it is possible to alter the equation substituting 2/ ||w|| by ½ ||w||2 without changing the solution. The problem now belongs to the quadratic programming (QP) optimization that is easier to be computed.</p><p>Minimize ½ ||w||<sup>2</sup> ... (11)</p><p>Such that y<sub>i</sub> (w. x<sub>i</sub> + b)≥1, &amp;nbsp ∀i ∈ {1,…,N}</p><p>This is the quadratic optimization problem or primal form. This primal problem can be converted into another optimization problem i.e. dual problem with the help of Lagrangian multiplier.</p><p>Dual optimization equation with lagrangian multiplier is given below:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/eq12.PNG" class="kg-image" alt="Dual optimization equation"></figure><p>Subject to α<sub>i</sub>&gt;=0 ∀i ∈ {1,…,N}</p><p>where αi is a Lagrangian multiplier</p><p>By multiplying the components in the bracket of the equation (12):</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/12a-1.PNG" class="kg-image"><figcaption>Equation - 12</figcaption></figure><p>Setting the derivative of L w.r.t w and b individually to 0:</p><p>∂L/∂b = - Σ αi y<sub>i</sub> = 0</p><p>⇒ Σαi y<sub>i</sub> = 0 ... (13)</p><p>∂L/∂w = w - Σ αi y<sub>i</sub> x<sub>i</sub> = 0</p><p>⇒ w = Σ αi y<sub>i</sub> x<sub>i</sub>i ... (14)</p><p>Substituting the values of equation (13) and (14) in L we get,</p><p>L = ½ Σ Σαi αj y<sub>i</sub> y<sub>j</sub>( x<sub>i</sub>.x<sub>j</sub>) - ΣΣαi αj y<sub>i</sub> y<sub>j</sub>(x<sub>i</sub>.x<sub>j</sub>) + Σ αi</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/14a.PNG" class="kg-image" alt="Equation - 13"></figure><p>Here, Our aim is to maximize the dual optimization problem for different values of lagrangian multiplier i.e. α.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/14b.PNG" class="kg-image" alt="dual optimization problem equation"></figure><p>One Important thing to note is that if the Lagrangian multiplier i.e αi = 0 then the data points are not support vectors. So, only for αi &gt; 0, x<sub>i</sub> are support vectors (SV).</p><h2 id="soft-margin-classifier"><strong>Soft Margin Classifier</strong></h2><p>The above optimization problem is only useful when the data points are classified correctly meaning there are no points between the margin. Sometimes high noise in the data causes overlap of the classes as shown in the figure.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/10/Soft-Margin-Classifier.png" class="kg-image" alt="Soft Margin Classifier"></figure><p>In such cases, we can do the classification task by using Soft Margin SVM.</p><p>A soft-margin SVM provides freedom to the model to misclassify some data points by minimizing the number of such samples. Soft-margin SVM allows for the possibility of violating the constraints</p><p>y<sub>i</sub> (w.x<sub>i</sub> + b)≥1 ∀i ∈ {1,…,N}</p><p>by introducing slack variable ξi</p><p>y<sub>i</sub> (w.x<sub>i</sub> + b)≥1 - ξi ξi ≥0 ∀i ∈ {1,…,N}</p><p>Now, our goal is to maximize the margin by keeping the ξi as small as possible.</p><p>Our Primal or quadratic optimization problem after introducing slack variable:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/primal.PNG" class="kg-image" alt="Primal or quadratic optimization problem"></figure><p>Here, C is a regularization parameter (trade-off between classification and error). Transforming to the lagrangian dual problem we obtain:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/lagrangian.PNG" class="kg-image" alt="lagrangian dual problem"></figure><p>Here, μ<sub>i</sub> are the new lagrangian multipliers.</p><p>After taking partial derivative of L w.r.t w and b separately to 0. Our dual optimization problem becomes:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/Dual_optimisation.PNG" class="kg-image" alt="dual optimization problem equation"></figure><p></p><p>This is very similar to the hard margin case, except the value of α<sub>i</sub> lies between 0 and C.</p><h2 id="non-linear-model"><strong>Non-linear Model</strong></h2><p>What we learnt till now is only applicable when the data is linearly separable. When the data is non-separable these optimization problems are not feasible. Such a problem can be solved by enlarging the feature space through a function known as the kernel.</p><p>Mathematically, a kernel is some function that corresponds to an inner product in some expanded feature space. If every data point is mapped into high-dimensional space via some transformation Φ: x → φ(x), then the kernel function is defined as:</p><p>K(x<sub>i</sub> ,xj )= φ(x<sub>i</sub> ). φ(xj)</p><p>We can modify our optimization problem by introducing kernel function as:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2019/11/optimising_function.PNG" class="kg-image"></figure><p>(Source: <a href="https://en.wikipedia.org/wiki/Support-vector_machine">Wikipedia</a>)</p><p>Thus, we have seen the intricacies of the Support Vector Machines along with its applications as a non-linear model. We have also understood what it means by a Soft Margin Classifier and how it overcomes the optimisation problem in the support vector machines model.</p><p>In the next section, I will show you how to implement a <a href="https://quantra.quantinsti.com/course/introduction-to-machine-learning-for-trading" rel="noopener">machine learning based trading strategy</a> using the regime predictions made in an earlier <a href="https://blog.quantinsti.com/trading-using-machine-learning-python-part-2/" rel="noopener noreferrer">blog</a>.</p><p>There is one thing that you should keep in mind before you read this section though: The algorithm is just for demonstration and should not be used for real trading without proper optimization.</p><h2 id="trading-using-support-vector-machines-in-python"><strong>Trading using Support Vector Machines in Python</strong></h2><p>Let me begin by explaining the agenda here:</p><ol><li>Create an unsupervised ML ( machine learning) algorithm to predict the regimes.</li><li>Plot these regimes to visualize them.</li><li>Train a Support Vector Classifier algorithm with the regime as one of the features.</li><li>Use this Support Vector Classifier algorithm to predict the current day’s trend at the Opening of the market.</li><li>Visualize the performance of this strategy on the test data.</li><li>Downloadable code for your benefit</li></ol><p>Import the Libraries and the Data:</p><p>First, I imported the necessary libraries. Please note that I have imported fix<em><em>yahoo</em></em>finance package, so I am able to pull data from yahoo. If you do not have this package, I suggest you <a href="https://pypi.python.org/pypi/fix-yahoo-finance" rel="noopener noreferrer">install </a>it first or change your data source to google.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/Import-the-Libraries-and-the-Data.jpg" class="kg-image" alt="Import the Libraries and the Data"></figure><p>Next, I pulled the data of the same quote, ‘SPY’, which we used in the previous blog and saved it as a dataframe df. I chose the time period for this data to be from the year 2000.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/Yahoo-trading-data.jpg" class="kg-image" alt="Yahoo trading data"></figure><p>After this, I created indicators that can be used as features for training the algorithm.</p><p>But, before doing that I decided on the look back time period for these indicators. I chose a look back period of 10 days. You may try any other number that suits you. I chose 10 to check for the past 2 weeks of trading data and to avoid noise inherent in smaller look back periods.</p><p>Apart from the look back period let us also decide the test train split of the data. I prefer to give 80% data for training and remaining 20% data for testing. You can change this as per your need.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/data-indicators.jpg" class="kg-image" alt="data indicators"></figure><p>Next, I shifted the High, Low and Close columns by 1, to access only the past data. After this, I created various technical indicators such as, RSI, SMA, ADX, Correlation, Parabolic SAR, and the Return of the past 1- day on an Open to Open basis.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/technical-indicators.jpg" class="kg-image" alt="technical indicators"></figure><p>Next, I printed the data frame.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/printed-data-frame.jpg" class="kg-image" alt="printed data frame"></figure><p>And it looked like this:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/printed-data-frame-command-output.jpg" class="kg-image" alt="printed data frame command output"></figure><p>As you can see, there are many NaN values. We need to either impute them or drop them. If you are new to the machine learning and want to learn about the imputer function, read <a href="https://scikit-learn.org/0.19/modules/generated/sklearn.preprocessing.Imputer.html" rel="noopener noreferrer">this</a>. I dropped the NaN values in this algorithm.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/NaN-values-in-the-algorithm.jpg" class="kg-image" alt="NaN values in the algorithm"></figure><p>In the next part of the code, I instantiated a StandardScaler function and created an unsupervised learning algorithm to make the regime prediction. I have discussed this in my previous blog, so I will not be going into these details again. Explore the '<a href="https://quantra.quantinsti.com/course/unsupervised-learning-trading">Unsupervised Learning Course</a>' from Quantra.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2020/03/svm-code.png" class="kg-image" alt="unsupervised learning algorithm"></figure><p>Towards the end of the last blog, I printed the Mean and Covariance values for all the regimes and plotted the regimes. The new output with indicators as feature set would look like this:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/Mean-and-Covariance-values-for-the-regimes.jpg" class="kg-image" alt="Mean and Covariance values for the regimes"></figure><p>Next, I scaled the Regimes data frame, excluding the Date and Regimes columns, created in the earlier piece of code and saved it back in the same columns. By doing so, I will not be losing any features but the data will be scaled and ready for training the support vector classifier algorithm. Next, I created a signal column which would act as the prediction values. The algorithm would train on the features’ set to predict this signal.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/signal-column-to-act-as-the-prediction-values.jpg" class="kg-image" alt="signal column to act as the prediction values"></figure><p>Next, I instantiated a support vector classifier. For this, I used the same <a href="http://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html" rel="noopener noreferrer">SVC </a> model used in the example by <a href="https://blog.quantinsti.com/scikit-learn-tutorial/" rel="noopener">sklearn</a>. I have not optimized this support vector classifier for best hyper parameters. In the <a href="https://quantra.quantinsti.com/course/trading-with-machine-learning-regression" rel="noopener noreferrer">machine learning course </a>on Quantra®, we have extensively discussed how to use hyper parameters and optimize the algorithm to predict the daily Highs and Lows, in turn the volatility of the day.</p><p>Coming back to the blog, the code for support vector classifier is as below:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/support-vector-classifier.jpg" class="kg-image" alt="support vector classifier"></figure><p>Next, I split the test data of the unsupervised regime algorithm into train and test data. We use this new train data to train our <a href="https://quantra.quantinsti.com/course/trading-machine-learning-classification-svm">support vector</a> classifier algorithm. To create the train data I dropped the columns that are not a part of the feature set:</p><p>'Signal','Return','market<em><em>cu</em></em>return','Date'</p><p>Then I fit the X and y data sets to the algorithm to train it on.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/X-and-y-data-sets.jpg" class="kg-image" alt="X and y data sets"></figure><p>Next, I calculated the test set size and indexed the predictions accordingly to the data frame df.</p><p>The reason for doing this is that the original return values of ‘SPY’ are stored in df, while those in Regimes is scaled hence, won’t be useful for taking a cumulative sum to check for the performance.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/test-set-size.jpg" class="kg-image" alt="test set size"></figure><p>Next, I saved the predictions made by the SVC in a column named Pred_Signal.</p><p>Then, based on these signals I calculated the returns of the strategy by multiplying signal at the beginning of the day with the return at the opening ( because our returns are from open to open) of the next day.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/saving-the-predictions-made-by-the-SVC.jpg" class="kg-image" alt="saving the predictions made by the SVC"></figure><p>Finally, I calculated the cumulative strategy returns and the cumulative market returns and saved them in df. Then, I calculated the sharpe ratio to measure the performance. To get a clear understanding of this metric I plotted the performance to measure it.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/calculating-the-cumulative-strategy-returns-and-the-cumulative-market-returns.jpg" class="kg-image" alt="calculating the cumulative strategy returns and the cumulative market returns"></figure><p>The final result looks like this.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/calculated-the-cumulative-strategy-returns.jpg" class="kg-image" alt="calculated the cumulative strategy returns"></figure><p>After so much of code and effort, if the end result looks like this, then someone with no machine learning back ground would say that it is not worth it. I would agree for now. But, look at this line of code:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/Python-code.jpg" class="kg-image" alt="Python code"></figure><p>I just changed the data from SPY to IBM. Then the result looks like this:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/data-from-IBM.jpg" class="kg-image" alt="data from IBM"></figure><p>I know what you are thinking: I am just fitting the data to get the results. Which is not entirely wrong. I will show you another stock then you decide.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/stock-timeline-command.jpg" class="kg-image" alt="stock timeline command"></figure><p>I changed the stock to Freeport-McMoRan Inc and the result looks like this:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/Freeport-McMoRan-Inc-stock.jpg" class="kg-image" alt="Freeport-McMoRan Inc stock"></figure><p>You can further change it to GE or something else and check for yourself. This strategy works on some stocks but doesn’t work on others, which is the case with most quant strategies. There are a few reasons why the algorithm did work consistently and I will list some of them here.</p><ol><li>No autocorrelation of returns</li><li>No Support Vector hyper parameter optimization</li><li>No error propagation</li><li>No feature selection</li></ol><p>We have not checked for autocorrelation of the returns, which would have increased the predictability of the algorithm. Try that on your own by shifting the returns column by 1 and passing it as feature set. The result would look like this:</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2017/08/stock-graph.jpg" class="kg-image" alt="stock graph"></figure><p>Although the improvement from 3.4 to 3.49 is not much, it is still a good feature to have.</p><p>Please note that the code will best run with Python 2.7</p><p><strong>Update</strong></p><p><em><em>We have noticed that some users are facing challenges while downloading the market data from Yahoo and Google Finance platforms. In case you are looking for an alternative source for market data, you can use Quandl for the same.</em></em></p><h3 id="download-data-files"><strong><strong>Download Data Files</strong></strong></h3><ul><li>Python_3</li></ul><!--kg-card-begin: html--><p><a href="https://www.quantinsti.com/articles/support-vector-machines-introduction" class="download-button button"> Visit blog to download </a></p><!--kg-card-end: html--><h3 id="conclusion">Conclusion</h3><p>Thus, not only have we seen the mathematics behind the Support Vector Machine, but we have also understood how to build a trading strategy using SVM in Python.</p><p>If you want to learn how to use Support vector machines on financial markets data and create your own prediction algorithm, you can enroll for the <a href="https://quantra.quantinsti.com/course/trading-machine-learning-classification-svm">Trading with Machine Learning: Classification and SVM course</a> which covers classification algorithms, performance measures in machine learning, hyper-parameters and building of supervised classifiers.</p><p>If you want to learn various aspects of Algorithmic trading then check out our <a href="https://www.quantinsti.com/">Executive Programme in Algorithmic Trading</a> (EPAT®). The course covers training modules like Statistics &amp; Econometrics, Financial Computing &amp; Technology, and Algorithmic &amp; Quantitative Trading. EPAT® is designed to equip you with the right skill sets to be a successful trader. Enroll now!</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><p><em>Disclaimer: All data and information provided in this article are for informational purposes only. QuantInsti&reg; makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information in this article and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis.</em></p><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[An Introduction to Unsupervised Learning for Trading]]></title><description><![CDATA[Learn about the basics of unsupervised learning algorithms and their use cases in Finance/Investment/Trading with examples in Python.]]></description><link>https://www.quantinsti.com/articles/unsupervised-learning/</link><guid isPermaLink="false">69df440e74e6f000074e6b76</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[MuniRaja Puthuru]]></dc:creator><pubDate>Fri, 24 Apr 2026 09:34:55 GMT</pubDate><content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/ashutosh-dave-frm-2112551a/">Ashutosh Dave</a></p><p>In the previous blogs, we examined supervised learning algorithms like linear regression in detail. In this blog, we look at what unsupervised learning is and how it differs from supervised learning.</p><p>Then, we move on to discuss some use cases of unsupervised learning in investment and trading. We explore two unsupervised techniques in particular- k-means clustering and PCA with examples in Python.</p><h2 id="what-is-unsupervised-learning">What is unsupervised learning?</h2><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/apple-pic.png" class="kg-image" alt="Apple"></figure><p>As the name suggests, 'unsupervised' learning takes place when there is no supervisor or teacher and the learner learns on her own.</p><p>For instance, consider a child who sees and tastes an apple for the very first time. She registers the colour, the texture, the taste and the smell of the fruit. The next time she sees an apple, she knows that both this and the previous apple are similar objects as they have very similar characteristics.</p><p>She knows that this is very different from an orange. But still, she does not know what it is called in human-speak, i.e. an 'apple' as there is no knowledge of the label.</p><p>Such learning where the labels do not exist (in the absence of a teacher) but the learner can still learn about patterns on her own is referred to as unsupervised learning.</p><p>In the context of machine learning algorithms, unsupervised learning occurs when an algorithm learns from plain examples without any associated response and determines the data patterns on its own.</p><p>In the next section, we will discuss how this type of learning differs from the other type of popular learning algorithms in machine learning, i.e. supervised learning algorithms.</p><p><a href="https://quantra.quantinsti.com/course/introduction-to-machine-learning-for-trading">Artificial intelligence in trading</a> leverages unsupervised learning to identify hidden patterns and trends within market data, enabling traders to uncover insights that may not be apparent through traditional analysis. This approach enhances the ability to develop adaptive trading strategies based on real-time market behavior.</p><h2 id="supervised-vs-unsupervised-learning">Supervised vs unsupervised learning</h2><p>Learning in supervised learning, as the name suggests, occurs under supervision, i.e., when the algorithm predicts a value for a sample from the training data, it is told whether the prediction was correct or not.</p><p>This is possible as we have the correct values stored as 'labels'/'target variable', which are passed to the algorithm along with the input data. Common supervised learning tasks are those of classification and <a href="https://quantra.quantinsti.com/course/trading-with-machine-learning-regression">regression</a>.</p><p>In classification tasks, the labels are the correct class to which the sample belongs, whereas, in regression, the actual value of the dependent variable(Y) serves as a benchmark for comparing the prediction. The algorithm can then tweak its parameters to achieve higher accuracy in prediction.</p><p>Thus, the main goal of supervised learning is to build a robust predictive model.</p><p>On the other hand, in unsupervised learning, we only pass the input data, and there are no labels. Unsupervised models seek to find the underlying or hidden structure or distribution in the data in order to learn more about the data.</p><p>In other words, unsupervised learning is where we only have input data and no corresponding output variables, and the main goal is to learn more or discover new insights from the input data itself.</p><p>A common example of unsupervised algorithms are the clustering algorithms, that group the data based on the patterns that the machine detects.</p><p>For example, let us consider a situation in which we have a few data points based on two input features X1 and X2.</p><ul><li>If we want our algorithm to classify/categorize the data into two known classes, we will use a supervised <a href="https://quantra.quantinsti.com/course/trading-machine-learning-classification-svm">classification algorithm</a>.</li><li>On the other hand, if we want the algorithm to tell us how the data is structured, we would use an unsupervised clustering algorithm.</li></ul><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/supervised-versus-unsupervised-learning.png" class="kg-image" alt="supervised versus unsupervised learning"></figure><h2 id="when-do-we-use-unsupervised-algorithms">When do we use unsupervised algorithms?</h2><p>Unsupervised learning is utilized under the following conditions:</p><ul><li>We do not have the output/target data.</li><li>We don’t exactly know what we are looking for and want the machine to discover patterns/insights in the data. The insights discovered by the machine can then be used to solve various challenges.</li><li>We want to filter out only essential information(which has a lower dimension compared to original data) from the data and just use it to train a supervised learning model.</li></ul><p>In the next two sections, we will look at two popular unsupervised algorithms, namely clustering and dimensionality reduction, which help us in these situations.</p><h2 id="clustering-algorithms">Clustering Algorithms</h2><h3 id="concept-of-clustering">Concept of Clustering</h3><p>Clustering is one of the most popular tasks in the domain of unsupervised learning. Here, the fundamental assumption is that the data points that are similar tend to belong to similar groups (called clusters), as determined by their distance from local centroids.</p><p>So rather than defining groups before looking at the data, clustering allows us to find and analyze the groups that have formed organically, i.e., based on the data itself.</p><p>There are different clustering algorithms such as K-means clustering, <a href="https://blog.quantinsti.com/hierarchical-clustering-python/">Hierarchical clustering</a>, DBSCAN, OPTICS etc., which group the data according to their own definitions of similarity between the data points.</p><p>In the next subsection, we will look at an example of K-means clustering which is a widely used clustering algorithm. It creates 'K' similar clusters of data points.</p><h3 id="k-means-clustering-algorithm">K-means Clustering algorithm</h3><p>K-means clustering is used when we have unlabeled data, i.e., data without defined categories or groups). This algorithm finds groups/clusters in the data, with the number of groups represented by the variable 'k'(hence the name).</p><p>The algorithm works iteratively to assign each observation to one of the k groups based on the similarity in provided features.<br><br>The inputs to the K-means algorithm are the data/features(Xis) and the value of 'K'(number of clusters to be formed).<br><br>The steps can be summarized as:</p><ul><li>The algorithm starts with randomly choosing 'K' data points as 'centroids', where each centroid defines a cluster.</li><li>In this step, each data point is assigned to a cluster defined by a centroid such that the distance between that data point and the cluster's centroid is minimum.</li><li>In this step, the centroids are recalculated by taking the mean of all data points that were assigned to that cluster in the previous step.</li></ul><p>The algorithm iterates between steps (ii) and (iii) until a stopping criterion is met, such as a pre-defined maximum number of iterations are reached or datapoints stop changing clusters.</p><h3 id="example-of-k-means-clustering-for-trading-or-investing-with-code-in-python">Example of K-means clustering for trading or investing with code in Python</h3><p>Often, traders and investors want to group stocks based on similarities in certain features.</p><p>For example, a trader who wishes to trade a pair-trading strategy where she simultaneously takes a long and shorts position in two similar stocks would ideally want to scan through all the stocks and find those which are similar to each other in terms of industry, sector, market- capitalization, volatility or any other features.<br><br>Now consider a scenario where a trader whats to group/cluster stocks of 12 American companies based on two features:</p><ul><li>Return on equity (ROE) = Net Income/Total shareholder's equity, and</li><li>The beta of the stock</li></ul><p>Investors and traders use ROE to measure the profitability of a company in relation to the stockholders' equity. A high ROE is, of course, preferred to invest in a company. Beta, on the other hand, represents stock's volatility in relation to the overall market(represented by the index such as S&amp;P 500 or DJIA).</p><p>Going through each and every stock manually and then forming groups is a tedious and time-consuming process. Instead, one could use a clustering algorithm such as the k-means clustering algorithm to group/cluster stocks based on a given set of features.<br><br>Below, we implement a K-means algorithm for clustering these stocks in Python. We start with importing the necessary libraries and fetching the required data using the following commands:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/08cab0e643e283b28228aa84125b9e9d.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>Downloaded: ADBE
Downloaded: AEP
Downloaded: CSCO
Downloaded: EXC
Downloaded: FB
Downloaded: GOOGL
Downloaded: INTC
Downloaded: LNT
Downloaded: MSFT
Downloaded: STLD
Downloaded: TMUS
Downloaded: XEL</pre><!--kg-card-end: html--><p>As seen below, data for all the 14 tickers was fetched and as a result the bad_tickers list is empty:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/b887c03bd82a6403365b11be61b9ad84.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>[]</pre><!--kg-card-end: html--><p>Let us now take a peek at our data:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/d646fc75638994fe468dc008d259bb79.js"></script><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/roe-beta.PNG" class="kg-image" alt="roe beta"></figure><p>As seen above we have downloaded the data for the 12 stocks successfully.<br><br>We will now create a copy(df) of the original data and work with it. The first step is to preprocess the data so that it can be fed to a k-means clustering algorithm. This involves converting the data in a NumPy array format and scaling it.</p><p>Scaling amounts to subtracting the column mean and dividing by the column standard deviation from each data point in that column.</p><p>For scaling, we use the StandardScaler class of scikit-learn library as follows:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/fb09ee3f8746c473aa909421ba1904cf.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>[[ 1.48101786  0.53827712]
 [-1.02433415 -1.29230095]
 [ 0.25330094  0.40752155]
 [-1.25368786 -0.82158087]
 [ 0.58249097  1.45356616]
 [-0.36055752  0.72133493]
 [ 0.79700415 -0.37701191]
 [-0.93933836 -1.08309203]
 [ 1.80211305  0.11985928]
 [ 0.46916325  1.92428624]
 [-0.7733942  -0.42931414]
 [-1.03377812 -1.16154537]]</pre><!--kg-card-end: html--><p>The next step is to import the 'KMeans' class from scikit learn and fit a model with the value of hyperparameter 'K' (which is called n_clusters in scikit learn) set to 2(randomly chosen) to which we fit our preprocessed data 'df_values':</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/cc6d97373a882c182ff2e84a65f56876.js"></script><!--kg-card-end: html--><p>That's it! 'km_model' is now trained and we can extract the cluster it has assigned to each stock as follows:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/3c963bb97e9cc267ce15cf5abf4678bb.js"></script><!--kg-card-end: html--><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/roe-cluster.PNG" class="kg-image" alt="roe cluster"></figure><p>Now that we have the assigned clusters, we will visualize them using the matplotlib and seaborn libraries as follows:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/74c783bb3c534b572143fe370f35c908.js"></script><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/visualisation-of-clusters-graph-1.PNG" class="kg-image" alt="visualization of clusters graph"></figure><p>We can clearly see the difference between the two clusters which the K-means algorithm has assigned to the data points. Cluster 1 largely consists of all the public utility companies which have a low ROE and low beta compared to high growth tech companies in Cluster 0.<br><br>Although we did not tell the K-means algorithm about the industry sectors to which the stocks belonged, it was able to discover that structure in the data itself. Therein lies the power and appeal of unsupervised learning.<br><br><em>The next question that arises is how to decide the value of hyperparameter K before fitting the model?</em></p><p>We passed the value of hyperparameter K = 2 on a random basis while fitting the model. One of the ways of doing this is to check the model's 'inertia', which represents the distance of points in a cluster from its centroid.</p><p>As more and more clusters are added, the inertia keeps on decreasing, creating what is called an 'elbow curve'. We select the value of k beyond which we do not see much benefit (i.e., decrement) in the value of inertia.<br><br>Below we plot the inertia values for K-mean models with different values of 'K':</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/592bbbbe14f7c43b592cc32a12ce2f44.js"></script><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/inertia-value-graph.PNG" class="kg-image" alt="inertia value graph"></figure><p>As we can see that the inertia value shows marginal decrement after k= 3, a k-means model with k=3(three clusters) is the most suitable for this task.</p><h2 id="dimensionality-reduction"><strong><strong>Dimensionality reduction</strong></strong></h2><h3 id="concept-of-dimensionality-reduction"><strong><strong>Concept of dimensionality reduction</strong></strong></h3><p>The curse of dimensionality is a common issue faced by data scientists and quants, which means that using too many features can unnecessarily increase storage space and processing time for ML models. Thus, we always seek to get a useful representation of data in a lower dimension without losing too much information.</p><p>This is achieved by using dimensionality reduction techniques, which is another popular use case of unsupervised learning.</p><p>Dimensionality reduction will result in high performance in terms of speed and memory usage at the cost of losing some information. We need to make sure that the benefits outweigh the costs of losing that information.</p><p>In the next section, we look at PCA, which is the most popular unsupervised dimensionality reduction technique.</p><h3 id="principal-component-analysis"><strong><strong>Principal </strong>C<strong>omponent </strong>A<strong>nalysis</strong></strong></h3><p>One intuitive way of reducing the dimensions of data is to project the data points on to a lower subspace as shown in the diagram below, where we project points from a 3-D space (three features x1, x2 and x3) down to a 2-D subspace(just x1 and x2):</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/reducing-dimension-from-3d-to-2d.png" class="kg-image" alt="reducing dimension from 3d to 2d"></figure><p>Principal Component Analysis (PCA) makes use of the same approach; however, in PCA, we find new coordinates which explain the maximum variation in the data. This is achieved by:</p><ul><li>first mean centring the data, i.e., making the mean of each column 0 and then</li><li>finding the eigendecomposition of the <a href="https://blog.quantinsti.com/calculating-covariance-matrix-portfolio-variance/">covariance matrix</a>(C) of the mean-centred variables. The eigendecomposition of a square matrix(covariance matrices are always square matrices) is given by:</li></ul><!--kg-card-begin: html--><p style="text-align:center"><strong>C = V.Λ.V<sup>T</sup></strong></p><!--kg-card-end: html--><p>Here 'V' represents the matrix containing the eigenvectors (of covariance matrix C), which represent our new coordinates or principal components, and Λ is a diagonal matrix containing the eigenvalues of C.</p><p>Each diagonal value in Λ is an eigenvalue that represents the variance explained by the corresponding principal component. This procedure ensures that resulting new coordinates/features/principal components are designed to capture maximum variation in the data and are orthogonal (perpendicular) to each other (i.e., our new features are uncorrelated with each other).</p><p>The next step is where we choose the top few principal components (which explain the maximum variation successively) based on a pre-decided cut-off.</p><p>For example, if we have five features, to begin with, we will end up with five principal components as well, but we decide to keep only the first three as they explain 90% of the variation in the data. This effectively means that we have reduced the dimension of our feature space from 5 to 3 without losing much information.</p><p>In the next subsection, we look at an example of implementing PCA in trading.</p><h3 id="example-of-pca-in-trading-or-investing-with-code-in-python">Example of PCA in trading or investing with code in Python</h3><p>Suppose Jim, a quant researcher working in a prop trading firm, is looking to develop a supervised ML model that predicts the direction of the overall market. He decides to use the past day returns of a basket of 7 tech stocks (assume they are the same stocks that were part of cluster 0 in the previous example) as features for the model.</p><p>To be more efficient with resources, Jim wants to reduce the dimensions of his feature space before he feeds the features to his supervised model.</p><p><em>What can help him here to quickly explore the possibility of reducing dimensions of data at hand?<br></em><strong>Yes, you are right, it's PCA!</strong></p><p>Below we showcase how Jim can go about conducting PCA using the scikit learn package in Python.</p><p>But first, we import the necessary libraries and fetch the data as follows:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/57b140f90ed09e9fd455c519e07adc67.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>['ADBE', 'CSCO', 'FB', 'GOOGL', 'INTC', 'MSFT', 'STLD']</pre><!--kg-card-end: html--><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/01eab586de3461dac003e84a5865eb0c.js"></script><!--kg-card-end: html--><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/read-and-fetch-data.PNG" class="kg-image" alt="read and fetch data"></figure><p>Below, we plot the cumulative returns of the stocks to gauge the the performance as well as variation in the data:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/b401a74cabb53a1a833eedc2c4a16fe4.js"></script><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/performance-of-tech-stocks.PNG" class="kg-image" alt="performance of tech stocks"></figure><p>The first step in PCA is to mean-centre the data. However, we will be using the PCA class from the scikit-learn library, which automatically scales the data (mean centres it), and so there is no need to do it manually (if you are using some other package, then you might have to do it yourself through matrix operation or using sklearn. preprocessing as done in the clustering example).</p><p>We will simply convert the data into a NumPy array format as required by the scikit learn library, import the PCA class and create an instance called 'model' to which we fit the raw data X:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/9d535409b7f4b54c9a6528380c2a8418.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>PCA(n_components=7)</pre><!--kg-card-end: html--><p>The hyperparameter of the model 'n_components' represents the dimension of the new co-ordinate/principal component space.</p><p>To begin with, we have initialized the model with the value of hyperparameter 'n_components' set to 7, which is the same as the number of original features in X(as we have 7 stocks).<br><br>We can access the principal component matrix/eigenvector matrix using the following command:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/a36558f13a7104579274642ad91beac6.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>array([[ 0.43250364,  0.26595616,  0.43994419,  0.39167868,  0.39734818,
         0.37164424,  0.31502354],
       [ 0.31078208, -0.1784099 ,  0.31343949,  0.10492004, -0.16196493,
         0.17032255, -0.84088612],
       [ 0.07033748, -0.13062127,  0.35532243,  0.14605034, -0.83342892,
         0.01607169,  0.3681629 ],
       [-0.32754799, -0.62923875,  0.52613624,  0.06641712,  0.34086264,
        -0.30207809,  0.09001009],
       [ 0.23384309, -0.65419348, -0.5269365 ,  0.33600016,  0.0217246 ,
         0.32947421,  0.13328505],
       [-0.58953337,  0.22761183, -0.08110947,  0.7444334 , -0.0673928 ,
         0.05821513, -0.178753  ],
       [-0.44931934, -0.06824695,  0.14453582, -0.37783656, -0.00877099,
         0.79335935,  0.01753355]])</pre><!--kg-card-end: html--><p>The principal components above have automatically been arranged in the order of the variance they explain(from high to low). So now, we can actually extract and plot the percentage of variance captured by each principal component as follows:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/82e8209c347744d5df099c9cd805347c.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>array([0.51, 0.21, 0.12, 0.06, 0.05, 0.03, 0.02])</pre><!--kg-card-end: html--><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/4d20e474f0c692ac31884240c72bf2d2.js"></script><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/explained-variance-versus-principal-components.PNG" class="kg-image" alt="explained variance versus principal components"></figure><p>Next, we visualize the cumulative variance explained:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/05134514e2158cf9fdc52f92aef93437.js"></script><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2021/06/cumulative-explained-variance-versus-principal-componenets.PNG" class="kg-image" alt="cumulative explained variance versus principal componenets"></figure><p><strong>We can see above that the first 4 principal components explain almost 90% of the variance!</strong></p><p>Which means that Jim can only use a PCA model with 4 principal components that is reduce the dimension from 7 to 4 at the cost of not explaining 10% variance in the data. Sounds like a good deal!<br><br>Below, we fit a new PCA model with 'n_components' = 4 and call it 'model_2':</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/e372615dc54ad8a16813a304a68b1aec.js"></script><!--kg-card-end: html--><p>We can now access the principal components and the percentage of variation explained by successive principal components:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/adbfb56f17940ca116dbc5eeca968382.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>array([[ 0.43250364,  0.26595616,  0.43994419,  0.39167868,  0.39734818,
         0.37164424,  0.31502354],
       [ 0.31078208, -0.1784099 ,  0.31343949,  0.10492004, -0.16196493,
         0.17032255, -0.84088612],
       [ 0.07033748, -0.13062127,  0.35532243,  0.14605034, -0.83342892,
         0.01607169,  0.3681629 ],
       [-0.32754799, -0.62923875,  0.52613624,  0.06641712,  0.34086264,
        -0.30207809,  0.09001009]])</pre><!--kg-card-end: html--><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/5dcc8487946cf7f3eed3888b394cbe71.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>array([0.5074455 , 0.21408255, 0.12162805, 0.05979477])</pre><!--kg-card-end: html--><p>Finally, we can access our new features(Z), which correspond to the original data X projected in the principal component space:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/6d9a4caa4cf8b8610e3d1be3b2f9df3a.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>array([[-1.12727573e-01, -6.67038416e-03, -1.48430796e-03,
         1.14035934e-03],
       [ 2.97074556e-02,  1.50265487e-02, -5.93081631e-02,
        -2.99243627e-02],
       [-5.47331714e-02, -4.75781399e-03, -1.65305232e-02,
         7.99569198e-03],
       ...,
       [-1.09056976e-02, -8.34552109e-05,  1.17423510e-02,
        -2.00353992e-03],
       [-4.17360862e-03,  2.44548028e-03,  1.19544647e-02,
         1.89425233e-02],
       [ 3.66918890e-02,  1.94108416e-02,  1.62907120e-02,
         4.10635097e-02]])</pre><!--kg-card-end: html--><p>Let us look at the shape of original data and the dimension-reduced data:</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/c22db441332128289bf5fc4f7424548f.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>(272, 7)</pre><!--kg-card-end: html--><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/a2ace63dc338c43a17fe91db75b4171b.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><pre>(272, 4)</pre><!--kg-card-end: html--><p>Looking at the shapes of original data and the new reduced dimension data we can see how unsupervised learning algorithms like PCA can help us be more efficient with resources and to create new features to build parsimonious supervised models.<br><br>That is what Jim was looking for! He can now happily proceed to building his supervised model using these new features.</p><h2 id="other-types-of-unsupervised-algorithms"><strong><strong>Other types of unsupervised algorithms</strong></strong></h2><p>In the previous two sections, we have discussed two of the most popular types of of unsupervised algorithms namely clustering and dimensionality reduction algorithms. In addition to these, there are other types of unsupervised learning algorithms, which are used for specific purposes.</p><p>A useful implementation is <strong><strong>latent variable modelling</strong></strong>. Latent variables are variables that can't be directly observed but have an impact on some other observed variables.</p><p>Unsupervised learning can be used to understand the structure and patterns in the observed variables to model the latent variables. A good example of this is Hidden Markov Models, which can be used to detect the <a href="https://quantra.quantinsti.com/course/getting-market-data">market</a> regime in the context of <a href="https://quantra.quantinsti.com/course/financial-time-series-analysis-trading">financial markets</a>.</p><p>Another common use case of unsupervised learning is in <strong><strong>association rule learning</strong></strong>. The aim here is to dig into large amounts of data and discover useful relations between features.</p><p>For example, supermarket firms can deploy this type of analysis to analyse customer baskets to see which items are likely to be bought together. The firm can place those items next to each other (for e.g., butter and cheese placed next to the bread section) to drive up the sales.</p><h2 id="challenges-in-unsupervised-learning"><strong><strong>Challenges in unsupervised learning</strong></strong></h2><p>Although we have seen how unsupervised learning can help us learn the patterns in our input data, it does come with its own challenges:</p><ul><li>As there is no label/target variable in unsupervised learning, there is no set way to calculate the performance of the model like we do in supervised learning algorithms.</li><li>The user often has to spend considerable time interpreting the output. For example, the new features obtained from PCA need to be interpreted in the business context, and that itself takes time.</li></ul><p>These are the reasons why unsupervised learning is often used in conjunction with supervised learning.</p><h3 id="next-steps">Next Steps</h3><p>During the course of this blog, we saw how unsupervised learning algorithms provide us not only with insights into the input data but also new useful inputs for supervised machine learning algorithms as well.</p><p>We also discussed practical use cases for unsupervised learning in trading and investing with the help of two examples. You can learn all about in this course on <a href="https://quantra.quantinsti.com/course/unsupervised-learning-trading">unsupervised learning course</a>.</p><p>As this was an introductory blog, we have only scratched the surface here. The scope of unsupervised learning is vast, and it encompasses applications implemented with the help of neural networks. Learn more about how <a href="https://quantra.quantinsti.com/course/neural-networks-deep-learning-trading-ernest-chan">neural network in trading</a> can help enhance your skills.</p><p>Nonetheless, I hope that you have enjoyed reading this blog, and it has given you inspiration to look deeper into the realm of unsupervised learning and its applications in finance.</p><p>In case you're interested in Machine Learning and its applications in trading, you can't afford to miss this specialization on <a href="https://quantra.quantinsti.com/learning-track/machine-learning-deep-learning-in-financial-markets">Machine Learning &amp; Deep Learning in Financial Markets</a>, where your will learn everything from simple logistic regression models to complex LSTM models. I hope this helps in your learning.</p><p>Till next time, happy learning!</p><h3 id="serious-about-learning">Serious about learning?</h3><p>For those looking to move beyond individual models and build a structured approach to quantitative trading, the <a href="https://www.quantinsti.com/epat">Executive Programme in Algorithmic Trading (EPAT)</a> provides a comprehensive pathway. It covers data analysis, machine learning applications, and systematic strategy development with a strong focus on practical implementation.</p><p>Connect with an EPAT career counsellor to explore how this aligns with your background and goals:</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><p><small><em>Disclaimer: All investments and trading in the stock market involve risk. Any decisions to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.</em></small></p><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Trading Backtester Agent in Dify: A Low-Code Multi-Agent Workflow for Backtesting Scripts]]></title><description><![CDATA[Build a Dify-based multi-agent workflow that turns a plain-English trading idea into a risk-managed Python backtesting script. Understand the agent roles, how the handoffs work, and how to adapt the example from the AI-in-Trading-Workflow GitHub repository.]]></description><link>https://www.quantinsti.com/articles/trading-backtester-agent-dify/</link><guid isPermaLink="false">69d6c71774e6f000074e6a11</guid><category><![CDATA[AI for Trading]]></category><dc:creator><![CDATA[Jose Carlos Gonzales Tanaka]]></dc:creator><pubDate>Fri, 17 Apr 2026 06:14:45 GMT</pubDate><content:encoded><![CDATA[<p><em><a href="https://www.linkedin.com/in/jose-carlos-gonzales-tanaka/">José Carlos Gonzáles Tanaka</a></em></p><h2 id="tl-dr">TL;DR</h2><p>This article introduces a Dify Chatflow that turns a plain-English trading idea into a complete Python backtesting script. Instead of using a single “do-everything” prompt, the system chains specialized agents, Strategist → Coder → RiskCoder, and then packages the result for a clean final output.</p><p>If you want to build it end-to-end, the repository includes the full tutorial and prompts. Here, we focus on the workflow concept, the agent responsibilities, and how to evaluate and extend the output so you can explore the full GitHub repository confidently.</p><h3 id="what-you-will-get-">What you will get:</h3><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/dify-workflow.png" class="kg-image"><figcaption>dify-workflow</figcaption></figure><p>A practical mental model for designing multi-agent code-generation workflows in a visual, low-code tool (Dify).</p><p>A breakdown of each agent role, what it should produce, and why the separation matters for reliability.</p><p>A checklist to review the generated backtesting script (risk, costs, entry/exit, and reproducibility).</p><p>A set of extension ideas to evolve the example beyond a demo (review, validation, testing harness, richer outputs).</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/github-repository-folder-content.png" class="kg-image" alt="github-repository-folder-content"></figure><h2 id="the-problem-with-backtest-prototyping-when-you-re-doing-it-manually-">The Problem with Backtest Prototyping (When You’re Doing It Manually)</h2><p>Most trading ideas fail in implementation, not in imagination. Translating a rough idea into a testable strategy requires structure: clear rules, data assumptions, risk constraints, and repeatable code.</p><p>When you do this manually, iteration is slow and error-prone. You end up spending time on scaffolding, data loading, signal wiring, position state, performance metrics, before you can even judge whether the idea is worth refining.</p><p>A workflow that separates planning, coding, and risk hardening reduces ambiguity and makes each step easier to inspect and improve.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/multi-agent-workflow-1.png" class="kg-image" alt="multi-agent-workflow"></figure><h2 id="introducing-the-trading-backtester-agent-in-dify">Introducing the Trading Backtester Agent in Dify</h2><p>This example shows how to build an “agent chain” inside Dify. Dify provides a visual editor for orchestrating LLM calls as connected nodes. The key design choice is role separation: each node has a narrow objective and passes a cleaner output downstream.</p><p>The final chain is intentionally minimal:</p><p>Start → Strategist → Coder → RiskCoder → Code → Answer</p><p>That small structure is enough to demonstrate a repeatable pattern you can apply to many trading tasks: convert messy input into a spec, write an implementation, and then harden it with constraints that reflect real trading.<br></p><h2 id="how-it-works-a-high-level-view">How It Works: A High-Level View</h2><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/workflow-table-2.png" class="kg-image" alt="agent-workflow-explanation"></figure><p>At a high level, the workflow mirrors a disciplined research process:</p><p>1) Capture the user’s strategy idea as-is.</p><p>2) Convert it into a structured plan (what to trade, when to enter/exit, what indicators or conditions).</p><p>3) Generate a runnable Python backtesting script from the plan.</p><p>4) Improve the script by adding realism: risk thresholds, transaction costs, and slippage assumptions.</p><p>5) Package the final output into a predictable field so downstream usage is consistent.</p><p>6) Return the final script to the user.</p><h2 id="the-core-workflow-files">The Core Workflow Files</h2><p>The Dify example in the repository is intentionally self-contained and easy to study. Conceptually, you’ll use:</p><p>A README tutorial that shows how the Chatflow is assembled in the Dify UI (nodes, context mapping, and output wiring).</p><p>A supporting how-to file that explains how the prompts were produced and how to think about prompt design for each role.</p><p>A set of media assets (screenshots/GIFs) that document the UI steps and final wiring.</p><p>Together, these let you reproduce the workflow quickly, and then adapt it to your own trading research questions.</p><h2 id="getting-started-the-how-to-guide">Getting Started: The “How-To” Guide</h2><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/Dify-tutorial.png" class="kg-image" alt="readme-content"></figure><p>The repository already contains a complete, click-by-click Dify tutorial for building this Chatflow. If you want to reproduce it, start there.</p><p>For a fast, practical approach:</p><p>1) Clone the AI-in-Trading-Workflow repository.</p><p>2) Locate the Dify “Trading Backtester Agent” example folder.</p><p>3) Follow the README to wire the nodes and prompts in Dify.</p><p>4) Run a simple strategy prompt to validate the end-to-end flow.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/dify-platform-2.png" class="kg-image" alt="dify-platform"></figure><h2 id="using-the-example-the-readme-file">Using the Example: The “README” File</h2><p>After you run the workflow once, treat the generated code like any research artifact: test it, review it, and iterate.</p><p>A practical review checklist:</p><p>• Does the code define entry/exit rules exactly as described?</p><p>• Is there any look-ahead bias in indicator computation or trade execution timing?</p><p>• Are transaction costs/slippage included (and in the correct place in the P&amp;L logic)?</p><p>• Is risk management implemented as actual trade logic (not just comments)?</p><p>• Can you rerun it with a different asset/timeframe with minimal edits?</p><p>The example is most useful when you change one variable at a time (asset, timeframe, rule threshold) and see how the code adapts.</p><p><em>You can prompt something like:</em><br><em>I want to create a backtesting loop script in Python where I have a moving average crossover strategy for the BTCUSD downloaded with Yahoo Finance from 2010 to March 2026 with ATR-based stop-loss and take-profit risk-management targets.</em></p><h2 id="why-this-is-better">Why This is Better</h2><p>This pattern works because it is modular and inspectable:</p><p>It’s transparent: you can see what each agent produced and where assumptions entered.</p><p>It’s debuggable: if output quality drops, you know whether to fix the plan, the code generation, or the risk layer.</p><p>It’s extensible: you can add a reviewer, validator, or reporting node without rewriting the entire workflow.</p><p>And it’s practical for learning: you can study each role in isolation and improve it incrementally.</p><h2 id="next-steps">Next Steps</h2><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/single-prompt-vs-agent-chain-comparison.png" class="kg-image" alt="single-prompt-vs-agent-chain-comparison"></figure><p>Once the base workflow is working, there are straightforward ways to make it more robust:</p><ul><li>Add a CodeReviewer node after RiskCoder to catch bugs, style issues, and missing edge cases.</li><li>Add a Validator step that checks the script contains costs, risk logic, and a clear entry/exit definition before returning.</li><li>Enforce a stricter “strategy spec” format in the Strategist output (inputs, rules, assumptions, outputs).</li><li>Add a lightweight test harness: run the output script on a small dataset and verify it produces expected artifacts (plots/metrics).</li><li>Experiment with different models in Dify and compare output consistency and code quality.</li></ul><h3 id="conclusion">Conclusion</h3><p>This Dify trading backtester agent is a compact example of a broader idea: building reliable trading research workflows by chaining specialized roles.</p><p>Even if you never use the exact prompts, the structure “plan → code → risk hardening → structured output” is transferable across many quant tasks.</p><p>This project is hosted in our GitHub repository: AI in Trading Workflow. Explore the repository to find additional examples that extend the same idea in different deployment styles.</p><p>Disclaimer: This project is for educational and illustrative purposes only. Trading in financial markets involves substantial risk of loss. The code and concepts discussed here are not financial advice. Always exercise caution and thoroughly understand any automated trading system before deploying it in a live environment.</p><h3 id="ready-to-get-started">Ready to get started?</h3><p><a href="https://github.com/QuantInsti/AI-in-Trading-Workflow"><strong>Clone the repository on GitHub</strong></a> and start building your AI trading assistant today.</p><p>Do not forget that, in case you want to create an ML strategy, you can learn how to do it with our course on <a href="https://quantra.quantinsti.com/course/introduction-to-machine-learning-for-trading">AI for trading basics</a> and you can also learn about deep learning models in our course on <a href="https://quantra.quantinsti.com/learning-track/machine-learning-deep-learning-trading-2">AI for trading advanced</a>.</p><h3 id="serious-about-learning">Serious about learning?</h3><p>For those looking to move beyond individual models and build a structured approach to quantitative trading, the <a href="https://www.quantinsti.com/epat">Executive Programme in Algorithmic Trading (EPAT)</a> provides a comprehensive pathway. It covers data analysis, machine learning applications, and systematic strategy development with a strong focus on practical implementation.</p><p>Connect with an EPAT career counsellor to explore how this aligns with your background and goals:</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><p><strong>Disclaimer:</strong> This project is for educational and illustrative purposes only. Trading in financial markets involves substantial risk of loss. The code and concepts discussed here are not financial advice. Always exercise caution and thoroughly understand any automated trading system before deploying it in a live environment.</p>]]></content:encoded></item><item><title><![CDATA[Decision Tree For Trading Using Python]]></title><description><![CDATA[We will focus on trading and how to use decision trees to find trading rules that allow us to gain an edge in the market.]]></description><link>https://www.quantinsti.com/articles/decision-tree/</link><guid isPermaLink="false">69d6100674e6f000074e6966</guid><category><![CDATA[AI for Trading]]></category><dc:creator><![CDATA[MuniRaja Puthuru]]></dc:creator><pubDate>Wed, 15 Apr 2026 04:24:58 GMT</pubDate><content:encoded><![CDATA[<p>By <a href="https://www.quantinsti.com/">QuantInsti</a></p><p>Decision Trees, are a Machine Supervised Learning method used in Classification and Regression problems, also known as CART.</p><p>Remember that a Classification problem tries to classify unknown elements into a class or category; the output always are categorical variables (i.e. yes/no, up/down, red/blue/yellow, etc.)</p><p>A Regression problem tries to forecast a number such as the return for the next day. It must not be confused with linear regression which is used to study the relationship between variables. Although the classification and regression problems have different objectives, the trees have the same structure:</p><ul><li>The Root node, is at the top and has no incoming pathways.</li><li>Internal nodes or test nodes are at the middle and can be at different levels or sub-spaces, and have incoming and outgoing pathways.</li><li>Leaf nodes or decision nodes are at the bottom, have incoming pathways but no outgoing pathways and here we can find the expected outputs.</li></ul><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/image14-1024x708.png" class="kg-image" alt="Decision Tree Structure"></figure><p>Thanks to Python’s Sklearn library, the tree is automatically created for us taking as a starting point the predictor variables that we hypothetically think are responsible for the output we are looking for.</p><p>In this introduction post to decision trees, we will create a classification decision tree in Python to make forecasts about whether the financial instrument we are going to analyze will go up or down the next day.</p><p>We will also <a href="https://quantra.quantinsti.com/course/decision-trees-analysis-trading-ernest-chan">make a decision tree</a> to forecasts about the concrete return of the index the next day.</p><h3 id="preparing-the-environment"><strong><strong>Preparing The Environment</strong></strong></h3><p>Be sure you have available the following software pieces in order to follow the examples:</p><ul><li>Python 3.6</li><li>Pandas library for data structure.</li><li>Numpy library with scientific mathematical functions.</li><li>Quandl library to retrieve market data.</li><li>Ta-lib library to calculate technical indicators.</li><li>Sklearn ML library to build the trees and perform analysis. (among many others things)</li><li>Graphviz library to plot the tree.</li></ul><h3 id="building-a-decision-tree"><strong><strong>Building a Decision Tree</strong></strong></h3><p>Building a classification <a href="https://quantra.quantinsti.com/course/decision-trees-analysis-trading-ernest-chan">decision tree</a> or a regression decision tree is very similar in the way we organize the input data and predictor variables, then, by calling the corresponding functions, the classification decision tree or <a href="https://quantra.quantinsti.com/course/trading-with-machine-learning-regression">regression decision tree</a> will be automatically created for us according to some criteria we must specify.</p><p>The main steps to build a decision tree are:</p><ol><li>Retrieve market <strong>data</strong> for a financial instrument.</li><li>Introduce the <strong>Predictor</strong> variables (i.e. <a href="https://quantra.quantinsti.com/course/trading-using-options-sentiment-indicators">Technical indicators</a>, Sentiment indicators, Breadth indicators, etc.)</li><li>Setup the <strong>Target</strong> variable or the desired output.</li><li><strong>Split</strong> data between training and test data.</li><li>Generate the decision tree <strong>training</strong> the model.</li><li><strong>Testing</strong> and <strong>analyzing</strong> the model.</li></ol><p>If we look at the first four steps, they are common operations for data processing. If you are a newcomer to <a href="https://quantra.quantinsti.com/course/decision-trees-analysis-trading-ernest-chan">decision trees</a> the predictor and target variables may sound exotic to you. However, they are nothing more than additional columns in the data frame that contain some type of indicator. These indicators or predictors are used to predict the target variable that is the financial instrument will go up or down for the classification model, or the future price level for the regression model. Likewise, splitting data is a mandatory task in any backtesting process (ML or not), the idea is to have one set of data to train the model and another set of data, which have not been used in training, to test the model.</p><p>Steps 5 and 6 are related to the ML algorithms for the <a href="https://quantra.quantinsti.com/course/decision-trees-analysis-trading-ernest-chan">decision trees</a> specifically. As we will see, the implementation in Python is quite simple. However it is fundamental to understand well the parameterization and the analysis of the results. This post is eminently practical and to go deeper into the underlying mathematics we recommend reading the references at the bottom of the post.</p><h3 id="getting-the-data"><strong><strong>Getting the data</strong></strong></h3><p>The raw material for any algorithm are data. In our case they would be the time series of financial instruments, such as indices, stocks etc. and it usually contains details like the opening price, maximum, minimum, closing price and volume. This information is recorded at a certain frequency, such as minutes, hours, days or weeks, and forms a time series.</p><p>There are multiple data sources to download the data, free and premium. The most common sources for free daily data are <a href="https://blog.quantinsti.com/nasdaq-data-link/" rel="noopener">Quandl Python API</a>, Yahoo or Google or any other data source we trust.</p><p>Here, we are going to work with twenty years of daily data from the Emini S&amp;P 500 that we will retrieve through Quandl.</p><!--kg-card-begin: html--><pre>import quandl
df = quandl.get("CHRIS/CME_ES2")
df.head()
df.tail()
df.shape</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt2-1024x270.png" class="kg-image" alt="Quandl Data Output"></figure><!--kg-card-begin: html--><pre>(5391, 8)</pre><!--kg-card-end: html--><p>We now have just over 21 years of Emini S&amp;P500 data available. We will use the settle price as the closing price reference.</p><h3 id="creating-the-predictors"><strong><strong>Creating the predictors</strong></strong></h3><p>Predictor variables are data that we think are related to market behavior. These data can be very diverse such as the technical indicators, market data, sentiment data, breadth data, fundamental data, government data, etc. that will help us to make forecasts about the future behavior of the market.</p><p>Here we will test the classical indicators for trend following and for range trading, these are:</p><ul><li>EMA</li><li>ATR</li><li>ADX</li><li>RSI</li><li>MACD</li></ul><p>Therefore, the decision tree algorithm should help us select the best combination of indicators along with their parameters that maximize the expected output which is the target.</p><p>We are going to prepare the data by calculating the indicators that we will use as predictors, to do it, we will use the <a href="https://blog.quantinsti.com/install-ta-lib-python/">Ta-lib</a> library:</p><!--kg-card-begin: html--><pre>import talib as ta
df['EMA10'] = ta.EMA(df['Settle'].values, timeperiod=10)
df['EMA30'] = ta.EMA(df['Settle'].values, timeperiod=30)
df['ATR'] = ta.ATR(df['High'].values, df['Low'].values, df['Settle'].values, timeperiod=14)
df['ADX'] = ta.ADX(df['High'].values, df['Low'].values, df['Settle'].values, timeperiod=14)
df['RSI'] = ta.RSI(df['Settle'].values, timeperiod=14)
macd, macdsignal, macdhist = ta.MACD(df['Settle'].values, fastperiod=12, slowperiod=26, signalperiod=9)
df['MACD'] = macd
df['MACDsignal'] = macdsignal
df.tail()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt4-1024x394.png" class="kg-image" alt="Calculated Indicators Output"></figure><p>We have already calculated the indicators, but it is necessary to emphasize that we have calculated them with the standard parameters and these can, and must be optimized since the decision tree works with the pre calculated indicators.</p><p>On the other hand, EMAs and MACDs do not serve as they are, since the signal comes from the price in relation to averages, or from one average in relation to the other. Let’s calculate the columns that will serve as predictors for the averages and the MACD.</p><!--kg-card-begin: html--><pre>import numpy as np
df['ClgtEMA10'] = np.where(df['Settle'] &gt; df['EMA10'], 1, -1)
df['EMA10gtEMA30'] = np.where(df['EMA10'] &gt; df['EMA30'], 1, -1)
df['MACDSIGgtMACD'] = np.where(df['MACDsignal'] &gt; df['MACD'], 1, -1)
df.tail()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt5-1024x450.png" class="kg-image" alt="Predictor Calculation"></figure><p>What we have now are possible trading rules that we will introduce in the decision tree to help us identify the best combination of these indicators to maximize the result.</p><ul><li>EMA, we are interested in when the price is above average and when the fastest average is above the slowest average.</li><li>ATR(14), we’re interested in the threshold that will trigger the signal.</li><li>ADX(14), we’re interested in the threshold that will trigger the signal.</li><li>RSI(14), we’re interested in the threshold that will trigger the signal.</li><li>MACD, we are interested in when the MACD signal is above MACD.</li></ul><p>In this example, the predictor variables for the classification decision tree and the regression decision tree will be the same, although the target variables are different because for the classification algorithm the output will be categorical and for the regression algorithm the output will be continuous.<br><br>Learn <a href="https://quantra.quantinsti.com/course/decision-trees-analysis-trading-ernest-chan">how to make a decision tree</a> to predict the markets and find trading opportunities using AI techniques with our Quantra course.</p><h3 id="creating-the-target-variables"><strong><strong>Creating the target variables</strong></strong></h3><p>As we have already said, the classification and regression decision trees have different objectives. While the classification decision tree tries to characterize the future by offering a categorical variable, i.e. the market goes up or down, the regression decision tree tries to forecast the future value, i.e. the future market price.</p><p>We are going to create here the target variables for the two types of problems, although each one will use its own target.</p><!--kg-card-begin: html--><pre>df['Return'] = df['Settle'].pct_change(1).shift(-1)
df['target_cls'] = np.where(df.Return &gt; 0, 1, 0)
df['target_rgs'] = df['Return']
df.tail()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt6-252x300.png" class="kg-image" alt="Create Target Variables"></figure><p>The target variable for the regression algorithm (<strong>target_rgs</strong>) uses the lagged return, this is so, because we want the algorithm to learn what happened the next day, based on the information available at the present time.</p><p>The target variable for the classification algorithm (<strong>target_cls</strong>) also uses the lagged return, but because the output is categorical, we must transform it. If the return was positive, we assign 1 and if it was negative, we assign 0.</p><h3 id="obtaining-the-data-set-for-decision-trees"><strong><strong>Obtaining the data set for decision trees</strong></strong></h3><p>We have all the data ready! We have downloaded the market data, applied some technical indicators as predictor variables and defined the target variable for each type of problem, a categorical variable for the classification decision tree and a continuous variable for the regression decision tree.</p><p>We are going to do a small operation to sanitize the data and prepare the data set that each algorithm will use. We must clean the data dropping the NA data, this step is crucial to compute cleanly the trees.</p><p>Next, we are going to create the data set of the predictor variables, that is to say, the indicators that we have calculated, this data set is common to the two decision trees that we are going to create, a classification decision tree and a regression decision tree.</p><!--kg-card-begin: html--><pre>predictors_list = ['ATR', 'ADX','RSI', 'ClgtEMA10', 'EMA10gtEMA30', 'MACDSIGgtMACD']
X = df[predictors_list]
X.tail()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt7-1024x317.png" class="kg-image" alt="Data Set of Predictor Variables"></figure><p>We then select the target dataset for the classification decision tree:</p><!--kg-card-begin: html--><pre>import quandl
df = quandl.get("CHRIS/CME_ES2")
df.head()
df.tail()
df.shape</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt8-300x179.png" class="kg-image" alt="Target Dataset for Classification Decision Tree"></figure><p>Finally, we select the target dataset for the regression decision tree:</p><!--kg-card-begin: html--><pre>y_rgs = df.target_rgs
y_rgs.tail()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt9-300x163.png" class="kg-image" alt="Target Dataset for Regression Decision Tree"></figure><h3 id="splitting-the-data-into-training-and-testing-data-sets"><strong><strong>Splitting the data into training and testing data sets</strong></strong></h3><p>The last step to finish with the preparation of the data sets is to split them into <strong>train</strong> and <strong>test</strong> data sets. This is necessary to fit the model with a set of data, usually 70% or 80% and the remainder, to test the goodness of the model. If we do not do so, we would run the risk of over-fitting the model. We want to test the model with unknown data, once the model has been fitted in order to evaluate the model accuracy.</p><p>We’re going to create the train data set with the 70% of the data from predictor and target variables data sets and the remainder 30% to test the model.</p><p>For classification decision trees, we’re going to use the <strong>train<em><em>test</em></em>split</strong> function from sklearn model<em><em>selection library to split the dataset. Since the output is categorical, it is important that the training and test datasets are proportional <strong>train</strong></em></em><strong>test_split</strong> function has as input the predictor and target datasets and some input parameters:</p><ul><li><strong>test_size</strong>: the size of the test data set, in this case, 30% of the data for the tests and, therefore, 70% for the training.</li><li><strong>random_state</strong>: Since the sampling is random, this parameter allows us to reproduce the same randomness in each execution.</li><li><strong>stratify</strong>: To ensure that the training and test sample data are proportional, we set the parameter to yes. This means that, for example, if there are more days with positive than negative return, the training and test samples will keep the same proportion.</li></ul><!--kg-card-begin: html--><pre>from sklearn.model_selection import train_test_split
y=y_cls
X_cls_train, X_cls_test, y_cls_train, y_cls_test = train_test_split(X, y, test_size=0.3, random_state=432, stratify=y)

print (X_cls_train.shape, y_cls_train.shape)
print (X_cls_test.shape, y_cls_test.shape)</pre><!--kg-card-end: html--><p>Here we have:</p><ul><li>Train predictor variables dataset: X_cls_train</li><li>Train target variables dataset: y_cls_train</li><li>Test predictor variables dataset: X_cls_test</li><li>Test target variables dataset: y_cls_test</li></ul><p>For regression decision trees we simply split the data at the specified rate, since the output is continuous, we don’t worry about the proportionality of the output in training and test datasets.</p><!--kg-card-begin: html--><pre>train_length = int(len(df)*0.70)
X_rgs_train = X[:train_length]
X_rgs_test = X[train_length:]
y_rgs_train = y_rgs[:train_length]
y_rgs_test = y_rgs[train_length:]

print (X_rgs_train.shape, y_rgs_train.shape)
print (X_rgs_test.shape, y_rgs_test.shape)</pre><!--kg-card-end: html--><p>Again, here we have:</p><ul><li>Train predictor variables dataset: X_rgs_train</li><li>Train target variables dataset: y_rgs_train</li><li>Test predictor variables dataset: X_rgs_test</li><li>Test target variables dataset: y_rgs_test</li></ul><p>So far we’ve done:</p><ul><li>Download the market data.</li><li>Calculate the indicators that we will use as predictor variables.</li><li>Define the target variables.</li><li>Split the data into training set and test set.</li></ul><p>With slight variations in obtaining the target variables and the procedure of splitting the data sets, the steps taken have been the same so far.</p><h3 id="decision-trees-for-classification"><strong><strong>Decision Trees for Classification</strong></strong></h3><p>Now let’s create the classification decision tree using the DecisionTreeClassifier function from the sklearn.tree library.</p><p>Although the DecisionTreeClassifier function has many parameters that I invite you to know and experiment with (help(DecisionTreeClassifier)), here we will see the basics to create the classification decision tree.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt10-1024x226.png" class="kg-image" alt="Decision Tree Classifier"></figure><p>Basically refer to the parameters with which the algorithm must build the tree, because it follows a recursive approach to build the tree, we must set some limits to create it.</p><ul><li><strong>criterion</strong>: For the classification decision trees we can choose <a href="https://blog.quantinsti.com/gini-index/">Gini</a> or Entropy and Information Gain, these criteria refer to the loss function to evaluate the performance of a learning machine algorithm and are the most used for the classification algorithms, although it is beyond the scope of this post, basically serves us to adjust the accuracy of the model, also the algorithm to build the tree, stops evaluating the branches in which no improvement is obtained according to the loss function.</li><li><strong>max_depth</strong>: Maximum number of levels the tree will have.</li><li><strong>min_samples_leaf</strong>: This parameter is optimizable and indicates the minimum number of samples that we want to have in leaves.</li></ul><!--kg-card-begin: html--><pre>from sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier(criterion='gini', max_depth=3, min_samples_leaf=6)
clf</pre><!--kg-card-end: html--><p>Now we are going to train the model with the training datasets, we fit the model and the algorithm would already be fully trained.</p><!--kg-card-begin: html--><pre>clf = clf.fit(X_cls_train, y_cls_train)
clf</pre><!--kg-card-end: html--><p>Now we need to make forecasts with the model on unknown data, for this we will use 30% of the data that we had left reserved for testing and, finally, evaluate the performance of the model. But first, let’s take a graphical look at the classification decision tree that the ML algorithm has automatically created for us.</p><h3 id="visualize-decision-trees-for-classification"><strong><strong>Visualize Decision Trees for Classification</strong></strong></h3><p>We have at our disposal a very powerful tool that will help us to analyze graphically the tree that the ML algorithm has created automatically. The graph showed the most significant nodes that maximize the output and will help us determine, if applicable, some useful trading rules.</p><p>The graphviz library allows us to graph the tree that the DecisionTreeClassifier function has automatically created with the training data.</p><!--kg-card-begin: html--><pre>from sklearn import tree
import graphviz
dot_data = tree.export_graphviz(clf, out_file=None,filled=True,feature_names=predictors_list)
graphviz.Source(dot_data)</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/PastedGraphic-1-1024x507.png" class="kg-image" alt="Classification Decision Tree"></figure><p>Note that the image only shows the most significant nodes. In this graph we can see all the relevant information in each node:</p><ul><li>the predictor variable used to split the data set.</li><li>the value of Gini impurity.</li><li>the number of data points available at that node and</li><li>the number of target variable data points belonging to each class, 1 and 0.</li></ul><p>We can observe a pair of pure nodes that allows us to deduce a possible trading rules. For example:</p><ul><li>On the third leaf starting from the left, when the closing price is lower than the EMA10 and the ATR is higher than 51.814 and the RSI is lower than or equal to 62.547, the marking decreases.</li><li>On the fifth leaf starting from the left, we can deduce the following rule: When the ADX is less than or equal to 19.243 and the RSI is less than or equal to 62.952 and the RSI is greater than 62.547, the market goes up.</li></ul><h3 id="make-forecast"><strong><strong>Make forecast</strong></strong></h3><p>Now let’s make predictions with data sets reserved for testing, this is the part that will let us know if the algorithm is reliable with unknown data in training.</p><!--kg-card-begin: html--><pre>y_cls_pred = clf.predict(X_cls_test)</pre><!--kg-card-end: html--><h3 id="performance-analysis"><strong><strong>Performance analysis</strong></strong></h3><p>Finally, we can only evaluate the performance of the algorithm on unknown data by comparing it with the result obtained in the training process. To do this we will use the classification_report function of the sklearn.metrics library.</p><p>The report shows some parameters that will help us to evaluate the goodness of the algorithm:</p><ul><li><strong>Precision</strong>: Indicate the quality of our predictions.</li><li><strong>Recall</strong>: Indicate the quality of our predictions.</li><li><strong>F1-score</strong>: Shows the harmonic mean of precision and recall.</li><li><strong>Support</strong>: Used as weights to compute the average values of precision, recall and F-1.</li></ul><p>Anything above 0.5 is usually considered a good number.</p><!--kg-card-begin: html--><pre>from sklearn.metrics import classification_report
report = classification_report(y_cls_test, y_cls_pred)
print(report)</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt12.png" class="kg-image" alt="Performance Analysis"></figure><h3 id="decision-trees-for-regression"><strong><strong>Decision Trees for Regression</strong></strong></h3><p>Now let’s create the regression decision tree using the DecisionTreeRegressor function from the sklearn.tree library.</p><p>Although the DecisionTreeRegressor function has many parameters that I invite you to know and experiment with (help(DecisionTreeRegressor)), here we will see the basics to create the regression decision tree.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt13.png" class="kg-image" alt="Decision Tree Regressor"></figure><p>Basically refer to the parameters with which the algorithm must build the tree, because it follows a recursive approach to build the tree, we must set some limits to create it.</p><ul><li><strong>criterion</strong>: For the classification decision trees we can choose Mean Absolute Error (MAE) or Mean Square Error (MSE), these criteria are related with the loss function to evaluate the performance of a learning machine algorithm and are the most used for the regression algorithms, although it is beyond the scope of this post, basically serves us to adjust the accuracy of the model, also the algorithm to build the tree, stops evaluating the branches in which no improvement is obtained according to the loss function. Here we left the default parameter to Mean Square Error (MSE).</li><li><strong>max_depth</strong>: Maximum number of levels the tree will have, here we left the default parameter to none.</li><li><strong>min_samples_leaf</strong>: This parameter is optimizable and indicates the minimum number of leaves that we want the tree to have.</li></ul><!--kg-card-begin: html--><pre># Regression tree model
from sklearn.tree import DecisionTreeRegressor
dtr = DecisionTreeRegressor(min_samples_leaf = 200)</pre><!--kg-card-end: html--><p>Now we are going to train the model with the training datasets, we adjust the model and the algorithm would already be fully trained.</p><!--kg-card-begin: html--><pre>dtr.fit(X_rgs_train, y_rgs_train)</pre><!--kg-card-end: html--><p>Now we need to make forecasts with the model on unknown data, for this we will use 30% of the data that we had left reserved for testing and, finally, evaluate the performance of the model. But first, let’s take a graphical look at the regression <a href="https://quantra.quantinsti.com/course/decision-trees-analysis-trading-ernest-chan">decision tree</a> that the ML algorithm has automatically created for us.</p><h3 id="visualize-the-model"><strong><strong>Visualize the model</strong></strong></h3><p>To visualize the tree, we use again the graphviz library that gives us an overview of the regression decision tree for analysis.</p><!--kg-card-begin: html--><pre>from sklearn import tree
import graphviz
dot_data = tree.export_graphviz(dtr,
                  out_file=None,
                  filled=True,
                  feature_names=predictors_list)
graphviz.Source(dot_data)</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/11/dt14-300x279.png" class="kg-image" alt="Regression Decision Tree"></figure><p>In this graph we can see all the relevant information in each node:</p><ul><li>the predictor variable used to split the data set.</li><li>the value of MSE.</li><li>the number of data points available at that node</li></ul><p>Learn <a href="https://quantra.quantinsti.com/course/decision-trees-analysis-trading-ernest-chan">how to make a decision tree</a> to predict the markets and find trading opportunities using AI techniques with our Quantra course.</p><h3 id="conclusion"><strong><strong>Conclusion</strong></strong></h3><p>It might look like we’ve found a crystal ball, but nothing could be further from the truth. Mastering these techniques requires a lot of study and an integral understanding of the mathematical techniques behind them.</p><p>Apparently, trees are easy to create and extract some rules that promise to be useful, but the truth is that to create decision trees, they need to be parametrized and these parameters can and must be optimized.</p><p>In order to continue to deepen our knowledge of decision trees and really help us to extract reliable trading rules, we will advance in the next post with the ensemble mechanisms to create a robust model combining the models created by one algorithm.</p><ul><li>Parallel ensemble methods or averaging methods: several models are created by one algorithm and the forecast is the average of the overall models:</li><li>Bagging</li><li>Random Subspace</li><li>Random Forest</li><li>Sequential ensemble methods or boosting methods: the algorithm creates sequential models refining on each new model to reduce the bias of the previous one:</li><li>AdaBoosting</li><li>Gradient Boosting</li></ul><p>We have learnt how to create Classification and Regression Decision Trees using Python in this blog and now we can learn advanced concepts and strategies in this course by Dr. Ernest P. Chan.</p><h3 id="serious-about-learning">Serious about learning?</h3><p>For those looking to move beyond individual models and build a structured approach to quantitative trading, the <a href="https://www.quantinsti.com/epat">Executive Programme in Algorithmic Trading (EPAT)</a> provides a comprehensive pathway. It covers data analysis, machine learning applications, and systematic strategy development with a strong focus on practical implementation.</p><p>Connect with an EPAT career counsellor to explore how this aligns with your background and goals:</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><!--kg-card-begin: html--><p><em><span style="font-weight: 400;">Disclaimer: All investments and trading in the stock market involve risk. Any decisions to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.</span></em></p><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Neural Network In Python: Types, Structure And Trading Strategies]]></title><description><![CDATA[What is a neural network and how does it work? How can you create a neural network with the famous Python programming language? In this tutorial, learn the concept of neural networks, their work, and their applications along with Python in trading.]]></description><link>https://www.quantinsti.com/articles/neural-network-python/</link><guid isPermaLink="false">69d60cf574e6f000074e6958</guid><category><![CDATA[AI for Trading]]></category><dc:creator><![CDATA[MuniRaja Puthuru]]></dc:creator><pubDate>Wed, 15 Apr 2026 04:24:50 GMT</pubDate><content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/chainika-bahl-thakar-b32971155/">Chainika Thakar</a></p><p>Neural network studies were started in an effort to map the human brain and understand how humans make decisions but the algorithm tries to remove human emotions altogether from the trading aspect.</p><p>What we sometimes fail to realise is that the human brain is quite possibly the most complex machine in this world and has been known to be quite effective at coming to conclusions in record time.</p><p>Think about it, if we could harness the way our brain works and apply it in the machine learning domain (Neural networks are after all a subset of <a href="https://blog.quantinsti.com/trading-using-machine-learning-python/">machine learning</a>), we could possibly take a giant leap in terms of processing power and computing resources.</p><p>Before we dive deep into the nitty-gritty of neural networks for trading, we should understand the working of the principal component, i.e. the neuron and then move forward to the neural network and the applications of <a href="https://quantra.quantinsti.com/course/neural-networks-deep-learning-trading-ernest-chan">neural network in trading</a>.</p><p>This blog covers:</p><!--kg-card-begin: html--><div>
<ul>
<li><a href="#a-general-introduction-to-neuron">A general introduction to neuron</a></li>
<li><a href="#a-neural-network-an-introduction">A neural network - An introduction</a></li>
<li><a href="#types-neural-networks">Types of neural networks</a>
<ul>
<li><a href="#perceptron">Perceptron</a></li>
<li><a href="#feed-forward-neural-networks">Feed forward neural networks</a></li>
<li><a href="#multilayer-perceptron">Multilayer perceptron</a></li>
<li><a href="#convolutional-nerual-network">Convolutional neural network</a></li>
<li><a href="#recurrent-neural-network">Recurrent neural network</a></li>
<li><a href="#modular-neural-network">Modular neural network</a></li>
</ul>
</li>
<li><a href="#how-to-train-a-neural-network">How to train a neural network?</a>
<ul>
<li><a href="#gradient-descent">Gradient descent</a></li>
<li><a href="#back-propagation">Back propagation</a></li>
</ul>
</li>
<li><a href="#neural-network-in-trading">Neural network in trading</a></li>
<li><a href="#neural-network-strategy-in-python">Neural network strategy in Python</a></li>
</ul>
</div><!--kg-card-end: html--><hr><h2 id="a-general-introduction-to-neuron">A general introduction to neuron</h2><p>There are three components to a neuron, the dendrites, axon and the main body of the neuron. The dendrites are the receivers of the signal and the axon is the transmitter.</p><h3 id="structure-of-a-neuron"><strong>Structure of a Neuron</strong></h3><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Structure-of-a-Neuron.jpg" class="kg-image" alt="Structure of a neuron"></figure><p>Alone, a neuron is not of much use, but when it is connected to other neurons, it does several complicated computations and helps operate the most complicated machine on our planet, the human body.</p><p>You can see in the image below how a group of neurons as inputs lead to an output signal.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Neuron.jpg" class="kg-image" alt="Neurons"></figure><hr><h2 id="a-neural-network-an-introduction">A neural network - An introduction</h2><p>The neural networks are replicated to work almost like our brain does. Hence, the input layer (it is how humans take inputs from the environment) consists of certain basic information to help arrive at the conclusion or the output.</p><p>The output can be to make a prediction, to find out objects of similar characteristics etc. The brain of a human being is filled with senses, such as hearing, touching, smelling, tasting, etc.</p><p>The neurons in our brain create complex parameters such as emotions and feelings, from these basic input parameters. And our emotions and feelings, make us act or make decisions which is basically the output of the neural network of our brains. Therefore, there are two layers of computations in this case before making a decision.</p><!--kg-card-begin: html--><a class="new-cta-wrapper ga-four-click” data-elementtype=" inline cta" href="https://quantra.quantinsti.com/course/neural-networks-deep-learning-trading-ernest-chan" data-elementtype="inline cta" data-elementtext="Neural Networks in Trading">
    <div class="grid-100 custom-grid-wrapper green-cta-wrapper">
        <div class="mobile-grid-100 tablet-grid-70 grid-70">
            <p class="cta-main-head">Neural Networks in Trading</p>
            <p class="cta-sub-head">Additional 27% off</p>
        </div>
        <div class="mobile-grid-100 tablet-grid-30 grid-30 cta-btn-wrapper">
            <div class="cta-btn-div green-cta-div">Enroll now</div>
        </div>
    </div>
</a><!--kg-card-end: html--><p>The first layer absorbs the senses as inputs and leads to emotions and feelings as the conclusion. Now, this first layer makes for the inputs of the next layer of computations, where the output is a decision or an action or the final result.</p><p>Hence, in the working of the human brain, there is one input layer, two hidden layers, and one output layer leading to a conclusion. The brain is much more complex than just the layers of information, but the general explanation of the computation process of the brain can be defined as such.</p><hr><h2 id="types-of-neural-networks">Types of neural networks</h2><p>There are many types of neural networks available. They can be classified depending on a lot of factors. These factors are the data flow, neurons used, their depth and activation filters, the structure, the density of neurons, layers, etc.</p><p>Let us see the most common types of neural networks (<a href="https://quantra.quantinsti.com/course/neural-networks-deep-learning-trading-ernest-chan">neural network trading</a>), and these are:</p><ul><li>Perceptron</li><li>Feed forward neural networks</li><li>Multilayer perceptron</li><li>Convolutional neural network</li><li>Recurrent neural network</li><li>Modular neural network</li></ul><h3 id="perceptron">Perceptron</h3><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Perceptron.jpg" class="kg-image" alt="Perceptron"></figure><p>Perceptron belongs to the supervised learning algorithm. As you can see in the image above, the data is split into two categories. Hence, perceptron is a binary classifier.</p><p>The Perceptron model is known to be the smallest unit of the neural network. Perceptron works to find out the features of the input data. The Perceptron model works with the weights as the inputs and also applies an activation function. This way the final result comes about.</p><h3 id="feed-forward-neural-networks">Feed Forward neural networks</h3><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Feed-Forward-NN.jpg" class="kg-image" alt="Feed forward neural network"></figure><p>The feed-forward neural network is quite simple since its input data passes through the artificial neural nodes or input nodes and exits through the output nodes. This implies that the data travels in one direction and the information in depth is not available.</p><p>The feed forward neural network is a unidirectional forward propagation with no backpropagation. The weights are static in this type and the activation function has inputs that are multiplied by the weights. For the feed forward to work, a classifying activation function is used.</p><p>Let us understand the concept of forward feed with an example. For example,</p><ul><li>Output of neuron is above threshold (0), i.e., is 1 - This implies that the neuron is activated</li><li>Output of neuron at the threshold (0) or is below threshold (-1) - This implies that the neuron is not activated</li></ul><p>The best thing about the feed forward neural network is that it can deal with a lot of noise in the data.</p><h3 id="multilayer-perceptron">Multilayer perceptron</h3><p>A multilayer perceptron does what its name suggests. The input data, in the case of a multilayer perceptron, goes through a lot of layers of artificial neurons. Hence, the input and output layers consist of multiple layers with a lot of information regarding the input. Each node in this type is connected with the neurons in the next layer.</p><p>The multilayer perceptron is known to be the fully connected one. Also, this type has a bi-directional propagation, which implies forward propagation as well as backpropagation.</p><p>The multilayer perceptron works by multiplying the inputs with the weights and the result is given to the activation function. On the other hand, in backpropagation, the result is modified in order to reduce the losses.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Multilayer-perceptron.jpg" class="kg-image" alt="Multilayer perceptron"></figure><h3 id="convolutional-neural-network">Convolutional neural network</h3><p>The convolutional neural network consists of a three-dimensional structure of neurons and not the two-dimensional one. It works in the following way:</p><ul><li>The first layer is known as the convolutional layer.</li><li>Each neuron in the convolutional layer takes into consideration only a small part of the information in the data in order to include more details.</li><li>The input pointers are in a batch.</li><li>The neural network processes all the inputs in images.</li><li>Each image is learnt by a neural network in parts.</li><li>The operations are computed several times to complete the processing of the image.</li><li>The image is converted from a particular scale and then the image is classified into several categories.</li></ul><p>In this type, the propagation is unidirectional and the neural network consists of one or more convolutional layers. The bidirectional version of this type makes the output of the convolutional layer go to a fully connected neural network. Also, the filters are used for extracting the parts of the image.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Convolutional-NN.jpg" class="kg-image" alt="Convolutional NN"></figure><p>In this type, the inputs are multiplied with weights and used by the activation function.</p><h3 id="recurrent-neural-networks">Recurrent neural networks</h3><p>Recurrent neural network or RNN is quite helpful in modelling sequenced data from the start to the end.</p><p>In this type of neural network, the first layer, as represented by the yellow coloured cells, is basically the feed-forward neural network. The second layer is the recurrent neural network layer where the information fed to it in the first layer is memorised. This is the forward propagation.</p><p>Now, the information is fed for use in the future and is corrected until the prediction made is as expected. This time the backpropagation occurs to make it to the correct information.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Recurrent-NN.jpg" class="kg-image" alt="Recurrent NN"></figure><h3 id="modular-neural-network">Modular neural network</h3><p>In the case of the modular neural network, several neural networks work independently to perform small tasks leading to the main task. While the modular neural network works, the different networks do not interact at all. This increases efficiency as each network works towards the same goal.</p><p>Just like humans, when several neural networks work together with each working on a sub-task, the complex or large process is completed faster. The independent components ensure that each piece of information is provided in detail to lead to the final conclusion.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Modular-NN.jpg" class="kg-image" alt="Modular NN"></figure><hr><h3 id="how-to-train-a-neural-network">How to train a neural network?</h3><p>To simplify things in the neural network tutorial, we can say that there are two ways to code a program for performing a specific task.</p><ul><li>All the rules of the program are to be defined. Also, the inputs will be given to the program in order to compute the result.</li><li>Develop the framework upon which the code will learn to perform the specific task by training itself on a dataset by adjusting the result it computes to be as close to the actual results which have been observed.</li></ul><p>The second process is called training the model which is what we will be focussing on. Let’s look at how our neural network will train to predict stock prices.</p><p>The neural network will be given the dataset, which consists of the OHLCV data as the input, as well as the output, we would also give the model the Close price of the next day, this is the value that we want our model to learn to predict. The actual value of the output will be represented by ‘y’ and the predicted value will be represented by y^ (y hat).</p><p>The model's training involves adjusting the variables' weights for all the different neurons present in the neural network. This is done by minimising the ‘Cost Function’. The cost function, as the name suggests, is the cost of making a prediction using the neural network. It is a measure of how far off the predicted value, y^, is from the actual or observed value, y.</p><p>There are many cost functions that are used in practice, the most popular one is computed as half of the sum of squared differences between the actual and predicted values for the training dataset.</p><!--kg-card-begin: html-->$$ C = \sum 1/2  (y^^-y)^2 $$<!--kg-card-end: html--><p>The neural network, first of all, trains itself by computing the cost function for the training dataset. Also, it is important to note that the training dataset holds a given set of weights for the neurons. Afterwards, the neural network tries to improve itself by going back and adjusting the weights.</p><p>Then it computes the cost function for the new training dates with the new weights. This entire process of the correction of the errors and adjusting of the weights after corrections are known as backpropagation.</p><p>The cost function is to be minimised and this backpropagation is repeated till the cost function is minimised. Here, the weights are also adjusted.</p><p>One way to do this is through brute force. Let us assume that there are 1000 values for the weights. Now, we will evaluate the cost function with these 1000 values.</p><p>The graph of the cost function will look like the one below.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Cost-function.jpg" class="kg-image" alt="Cost function"></figure><p>This approach could be successful for a neural network involving a single weight which needs to be optimised. However, as the number of weights to be adjusted and the number of hidden layers increases, the number of computations required will increase drastically.</p><p>The time it will require to train such a model will be extremely large even on the world’s fastest supercomputer. For this reason, it is essential to develop a better, faster methodology for computing the weights of the neural network. This process is called Gradient Descent.</p><h2 id="gradient-descent">Gradient descent</h2><p>Gradient descent analyses the cost function and it shows via the slope of the curve as shown in the image below. Based on the slope we adjust the weights. This helps to minimise the cost function.</p><p>The visualisation of Gradient descent is shown in the diagrams below. The first plot is two dimensional. The image below shows the red circle moving in a zig-zag pattern to reach the minimum cost function eventually.</p><p>In the second image, the adjustment of two weights is needed in order to minimise the cost function.</p><p>Hence, it can be seen as a contour in the image where the direction is toward the steepest slope and the minimum is to be reached in the shortest time period. This approach does not require a lot of computational processes and the process is not extremely lengthy either. You can say that the training of the model is a feasible task.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Gradient-descent.jpg" class="kg-image" alt="Gradient descent"></figure><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Gradient-descent-2.jpg" class="kg-image" alt="Adjustment of two weights"></figure><p>Gradient descent can be done in three possible ways,</p><ul><li>Batch gradient descent</li><li>Stochastic gradient descent</li><li>Mini-batch gradient descent</li></ul><h3 id="batch-gradient-descent">Batch gradient descent</h3><p>The batch gradient descent is the one in which the cost function is calculated by finding out the sum of all individual cost functions in the training dataset. After this step, the slope is computed by adjusting the weights of the training dataset.</p><h3 id="stochastic-gradient-descent">Stochastic gradient descent</h3><p>In this type of gradient descent, each data entry is followed by the creation of slope of the cost function and the adjustment of the weights in the training dataset. This helps to avoid the local minima if the cost function curve is not convex.</p><p>Also, each time the stochastic gradient descent’s process to reach the minimum will appear different.</p><h3 id="mini-batch-gradient-descent">Mini-batch gradient descent</h3><p>The third type is the mini-batch gradient descent, which is a combination of batch and stochastic methods. Here, we create different batches by clubbing together multiple data entries in one batch. This essentially results in implementing the stochastic gradient descent on bigger batches of data entries in the training dataset.</p><p>While we can dive deep into Gradient Descent, we are afraid it will be outside the scope of the neural network tutorial. Hence let’s move forward and understand how backpropagation works to adjust the weights according to the error which had been generated.</p><h2 id="backpropagation">Backpropagation</h2><p>Backpropagation is an advanced algorithm which enables us to update all the weights in the neural network simultaneously. This drastically reduces the complexity of the process to adjust weights. If we were not using this algorithm, we would have to adjust each weight individually by figuring out what impact that particular weight has on the error in the prediction.</p><p>Let us look at the steps involved in training the neural network with Stochastic Gradient Descent:</p><ul><li>Step 1 - Initialise the weights to small numbers. The number should be very close to 0 (but not 0)</li><li>Step 2 - <a href="https://blog.quantinsti.com/forward-propagation-neural-networks/">Forward propagation</a> - The neurons are activated from left to right, by using the first data entry in our training dataset, until we arrive at the predicted result y</li><li>Step 3 - Error Computation - Measure the error which will be generated</li><li>Step 4 - Backpropagation - The error generated will be back propagated from right to left. Also, the weights will be adjusted according to the learning rate</li><li>Step 5 - Repeat the previous three steps. The three steps of forward propagation, error computation and backpropagation will go through the entire training dataset</li><li>Step 6 - This would mark the end of the first epoch. The successive epochs will begin with the weight values of the previous epochs, Now, we can stop this process when the cost function reaches an acceptable limit</li></ul><p>We have covered a lot in this neural network tutorial and this leads us to apply these concepts in practice. Thus, we will now learn how to develop our own Artificial Neural Network (ANN) to predict the movement of a stock price.</p><p>You will understand how to code a strategy using the predictions from a neural network that we will build from scratch. You will also learn how to code the Artificial Neural Network in Python, making use of powerful libraries for building a robust trading model using the power of neural networks.</p><hr><h2 id="neural-network-in-trading">Neural network in trading</h2><p>Neural networks help you develop strategies based on your overall investment strategy ⁽<a href="https://economictimes.indiatimes.com/markets/stocks/news/how-neural-networks-are-used-in-the-investment-world/articleshow/94043039.cms">¹</a>⁾. Whether it is high-risk and growth-focused (short-term trades) or a conservative approach for long-term investment, it all depends on the kind of trading strategy.</p><p>For example, you wish to find a few stocks with particular growth performance or an upward price trend over a period of one year. Now, the neural network can figure out such stocks for your portfolio and hence, make your work easy. </p><p>Also, you can give a number of such parameters or necessary pointers to the neural network so that you have exactly what you are looking for with less effort and time.</p><hr><h2 id="neural-network-strategy-in-python">Neural network strategy in Python</h2><p>Let us now see the strategical representation with neural networks in Python.</p><p>First of all we will import libraries.</p><h3 id="step-1-importing-libraries">Step 1: Importing Libraries</h3><p>We will start by importing a <a href="https://blog.quantinsti.com/python-trading-library">few libraries</a>, the others will be imported as and when they are used in the program at different stages. For now, we will import the libraries which will help us in importing and preparing the dataset for training and testing the model.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/dc1e7dce9e5c9109b07d7b77a28e95b8.js"></script><!--kg-card-end: html--><p>Numpy is a fundamental package for scientific computing, we will be using this library for computations on our dataset. The library is imported using the alias np.</p><p>Pandas will help us in using the powerful dataframe object, which will be used throughout the code for building the artificial neural network in Python.</p><p><a href="https://blog.quantinsti.com/install-ta-lib-python/">Ta-lib</a> is a technical analysis library, which will be used to compute the RSI and Williams %R. These will be used as features in order to train our artificial neural network or ANN. We could add more features using this particular library, and many <a href="https://quantra.quantinsti.com/learning-track/technical-analysis-quantitative-methods">courses for technical analysis</a> teach how to effectively use such libraries for market analysis.</p><h3 id="step-2-fetching-data-from-yahoo-finance">Step 2: Fetching data from yahoo finance</h3><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/9d01b229148dd9513a3eb3e83705e337.js"></script><!--kg-card-end: html--><p>Random is used to initialise the seed to a fixed number. This is such that every time we run the code we start with the same seed.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/d90b91ee5469a089c50d8d9fc5998d34.js"></script><!--kg-card-end: html--><p>We have taken Apple’s data for the time period 6th November 2017 to 3rd January 2023.</p><h3 id="step-3-preparing-the-dataset">Step 3: Preparing the dataset</h3><p>We will be building our input features by using only the OHLC values. This dataset will help us to specify the features for training our neural network in the next step.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/9c725acfe6c242cdcc9e5f6f725c4a7b.js"></script><!--kg-card-end: html--><h3 id="step-4-defining-input-features-from-dataset">Step 4: Defining input features from dataset</h3><p>We then prepare the various input features which will be used by the artificial neural network learning for making the predictions. We define the following input features:</p><ul><li>High minus Low price</li><li>Close minus Open price</li><li>Three day <a href="https://blog.quantinsti.com/moving-average-trading-strategies/">moving average</a></li><li>Ten day moving average</li><li>30 day moving average</li><li>Standard deviation for a period of 5 days</li><li>Relative Strength Index</li><li>Williams %R</li></ul><p>We then define the output value as price rise, which is a binary variable storing 1 when the closing price of tomorrow is greater than the closing price of today.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/b35ac33d596fdf78c0ceb67ce337ea5f.js"></script><!--kg-card-end: html--><p>Next, we drop all the rows storing NaN values by using the dropna() function.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/c068e9ea8f7b803d54953ec11d7935fd.js"></script><!--kg-card-end: html--><p>We then create two data frames to store the input and the output variables. The dataframe ‘x’ stores the input features. The columns start from the fifth column of the dataset and go on to the second last column. The last column will be stored in the dataframe ‘y’ (prediction value) which is the rise in the prices.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/ef034b554050aeed406707b8ba83418a.js"></script><!--kg-card-end: html--><p>In this part of the code, we will split our input and output variables to create the test and train datasets. This is done by creating a variable called split, which is defined to be the integer value of 0.8 times the length of the dataset.</p><p>We then slice the X and y variables into four separate data frames: Xtrain, Xtest, ytrain and ytest. This is an essential part of any <a href="https://blog.quantinsti.com/introduction-machine-learning-quantiacs/">machine learning</a> algorithm, the training data is used by the model to arrive at the weights of the model.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/67a243c957c2aff1df1e2fb3e82bfb05.js"></script><!--kg-card-end: html--><p>The test dataset is used to see how the model will perform on new data which would be fed into the model. The test dataset also has the actual value for the output, which helps us in understanding how efficient the model is.</p><p>We will look at the confusion matrix later in the code, which essentially is a measure of how accurate the predictions made by the model are.</p><h3 id="step-5-standardise-the-dataset-data-preprocessing-">Step 5: Standardise the dataset (Data preprocessing)</h3><p>Another important step in data preprocessing is to standardise the dataset. This process makes the mean of all the input features equal to zero and also converts their variance to 1. This ensures that there is no bias while training the model due to the different scales of all input features.</p><p>If this is not done the neural network might get confused and give a higher weight to those features which have a higher average value than others.</p><p>We implement this step by importing the StandardScaler method from sklearn.preprocessing library. We instantiate the variable sc with the StandardScaler() function.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/b0343358e69848082c4f98742eb51894.js"></script><!--kg-card-end: html--><h3 id="step-6-building-the-artificial-neural-network-model">Step 6: Building the artificial neural network model</h3><p>After this we use the fittransform function to implement these changes on the Xtrain and Xtest datasets. The ytrain and y_test sets contain binary values, hence they need not be standardised. Now that the datasets are ready, we may proceed with building the Artificial Neural Network using the Keras library.</p><p>Now we will import the functions which will be used to build the artificial neural network. We import the Sequential method from the keras.models library. This will be used to sequentially build the layers of the neural networks learning. The next method that we import will be the Dense function from the keras.layers library.</p><p>This method will be used to build the layers of our artificial neural network.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/2807d3fc5c4e2a2eb704636d686fa670.js"></script><!--kg-card-end: html--><p>We instantiate the Sequential() function into the variable classifier. This variable will then be used to build the layers of the artificial neural network learning in Python.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/0a40de2b0f7d2316678d10e36dae8baa.js"></script><!--kg-card-end: html--><p>To add layers to our Classifier, we make use of the add() function. The argument of the add function is the Dense() function, which in turn has the following arguments:</p><ul><li>Units: This defines the number of nodes or neurons in that particular layer. We have set this value to 128, meaning there will be 128 neurons in our hidden layer.</li><li>Kernel_initializer: This defines the starting values for the weights of the different neurons in the hidden layer. We have defined this to be ‘uniform’, which means that the weights will be initialised with values from a uniform distribution.</li><li>Activation: This is the activation function for the neurons in the particular hidden layer. Here we define the function as the rectified Linear Unit function or ‘relu’.</li><li>Input_dim: This defines the number of inputs to the hidden layer, we have defined this value to be equal to the number of columns of our input feature dataframe. This argument will not be required in the subsequent layers, as the model will know how many outputs the previous layer produced.</li></ul><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/3f3c47583ff497f5f9725a9383aef217.js"></script><!--kg-card-end: html--><p>We then add a second layer, with 128 neurons, with a uniform kernel initializer and ‘relu’ as its activation function. We are only building two hidden layers in this neural network.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/e42ec44cb783d0040dfd8a8faaf1e31c.js"></script><!--kg-card-end: html--><p>The next layer that we build will be the output layer, from which we require a single output. Therefore, the units passed are 1, and the activation function is chosen to be the Sigmoid function because we would want the prediction to be a probability of the market moving upwards.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/5ca6b8358fe8b9037f6c594b9461c47d.js"></script><!--kg-card-end: html--><p>Finally, we compile the classifier by passing the following arguments:</p><ul><li>Optimizer: The optimizer is chosen to be ‘adam’, which is an extension of the stochastic gradient descent.</li><li>Loss: This defines the loss to be optimised during the training period. We define this loss to be the mean squared error.</li><li>Metrics: This defines the list of metrics to be evaluated by the model during the testing and training phase. We have chosen accuracy as our evaluation metric.</li></ul><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/58b704ea5d4a9b536240f073ba127415.js"></script><!--kg-card-end: html--><p>Now we need to fit the neural network that we have created to our train datasets. This is done by passing Xtrain, ytrain, batch size and the number of epochs in the fit() function.</p><p>The batch size refers to the number of data points that the model uses to compute the error before backpropagating the errors and making modifications to the weights. The number of epochs represents the number of times the training of the model will be performed on the train dataset.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/8a992f43ea401e4a29ca8d8cda56b050.js"></script><!--kg-card-end: html--><h3 id="step-7-setting-the-prediction-parameters">Step 7: Setting the prediction parameters</h3><p>With this, our artificial neural network in Python has been compiled and is ready to make predictions.</p><p>Now that the neural network has been compiled, we can use the predict() method for making the prediction. We pass X_test as its argument and store the result in a variable named ypred. We then convert ypred to store binary values by storing the condition ypred &gt;0.5. Now, the variable y_pred stores either True or False depending on whether the predicted value was greater or less than 0.5.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/cef7ba6bf8377d0e5b0d3cccc09be14f.js"></script><!--kg-card-end: html--><p>Next, we create a new column in the dataframe dataset with the column header ‘y_pred’ and store NaN values in the column. We then store the values of y_pred in this new column, starting from the rows of the test dataset.</p><p>This is done by slicing the dataframe using the iloc method as shown in the code above. We then drop all the NaN values from the dataset and store them in a new dataframe named trade_price_AAPL.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/417b6970d4c42d4a76d63243f3c29a3b.js"></script><!--kg-card-end: html--><h3 id="step-8-computation-of-strategy-returns-and-determine-trade-positions">Step 8: Computation of strategy returns and determine trade positions</h3><p>Now that we have the predicted values of the stock movement. We can compute the returns of the strategy. We will be taking a long position when the predicted value of y is true and will take a short position when the predicted signal is False.</p><p>We first compute the returns that the strategy will earn if a long position is taken at the end of today and squared off at the end of the next day. We start by creating a new column named ‘Tomorrows Returns’ in the trade_price_AAPL and store in it a value of 0.</p><p>We use decimal notation to indicate that floating point values will be stored in this new column. Next, we store in it the log returns of today, i.e. logarithm of the closing price of today divided by the closing price of yesterday. Next, we shift these values upwards by one element so that tomorrow’s returns are stored against the prices of today.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/d3c394c6d0535735ba2b148d47b46c8d.js"></script><!--kg-card-end: html--><p>Next, we will compute the strategy returns. We create a new column under the header ‘StrategyReturns’ and initialise it with a value of 0 to indicate storing floating point values.</p><p>By using the np.where() function, we then store the value in the column ‘Tomorrows Returns’ if the value in the ‘ypred’ column stores True (a long position), else we would store the negative of the value in the column ‘Tomorrows Returns’ (a short position); into the ‘Strategy Returns’ column.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/6f44ba6581d51bb5699bc7b97a7bf709.js"></script><!--kg-card-end: html--><p>We now compute the cumulative returns for both the market and the strategy. These values are computed using the cumsum() function. We will use the cumulative sum to plot the graph of market and strategy returns in the last step.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/9ff879097282b10e69bce1c3a22224b9.js"></script><!--kg-card-end: html--><p>We will now plot the market returns and our strategy returns to visualise how our strategy is performing against the market. For this, we will import matplotlib.pyplot.</p><p>We then use the plot function to plot the graphs of Market Returns and Strategy Returns using the cumulative values stored in the dataframe trade_dataset. We then create the legend and show the plot using the legend() and show() functions respectively.</p><!--kg-card-begin: html--><script src="https://gist.github.com/quantra-go-algo/d240bdac91edb0a5e20c46733bc85bc0.js"></script><!--kg-card-end: html--><p>The plot shown below is the output of the code. The green line represents the returns generated using the strategy and the red line represents the market returns.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/05/Returns.jpg" class="kg-image" alt="Returns"></figure><p>You can see in the output above that the strategy returns peaked in Jan, 2023 after fluctuating (upwards and downwards) throughout the other time periods.</p><p>The strategy returns are seen outperforming the market returns as well occasionally.</p><p>Similarly, you can modify the strategy parameters according to your understanding of the market and expectations.</p><hr><p><strong>Bibliography</strong></p><p><a href="https://ijrpr.com/uploads/V3ISSUE5/IJRPR4299.pdf">Srinath R1, Sarvaesh Raam S2, May 2022</a></p><hr><h2 id="conclusion">Conclusion</h2><p>With the blog coming to an end, we believe that you can now build your own Artificial Neural Network in Python and start trading using the power and intelligence of your machines. </p><p>Apart from Neural Networks, there are many other machine learning models that can be used for trading. The Artificial Neural Network or any other Deep Learning model will be most effective when you have more than 100,000 data points for training the model.</p><p><a href="https://quantra.quantinsti.com/course/introduction-to-machine-learning-for-trading">Artificial intelligence in trading</a> has become pivotal for real-time data processing and strategic analysis. By using AI, platforms can interpret market sentiments and respond to emerging patterns faster than traditional methods, enhancing the effectiveness of trading decisions and risk management.</p><p>This model was developed on daily prices to make you understand how to build the model. It is advisable to use the minute or tick data for training the model, which will give you enough data for effective training.   </p><h3 id="next-steps">Next Steps</h3><p>If you want to strengthen your understanding of neural networks and how they are applied in trading, these resources can help you build both conceptual clarity and practical skills:</p><ul><li><a href="https://blog.quantinsti.com/convolutional-neural-networks/" rel="noopener">Convolutional Neural Networks in Trading</a> - Explore how CNN models process structured financial data and identify patterns for trading.</li><li><a href="https://blog.quantinsti.com/introduction-deep-learning-neural-network/" rel="noopener">Introduction to Deep Learning and Neural Network</a> - Build a strong foundation in neural networks and deep learning concepts.</li><li><a href="https://blog.quantinsti.com/deep-learning-artificial-neural-network-tensorflow-python/" rel="noopener">Deep Learning - Artificial Neural Network Using TensorFlow In Python</a> - Learn how to implement neural networks using TensorFlow with Python.</li><li><a href="https://blog.quantinsti.com/forward-propagation-neural-networks/" rel="noopener">Forward Propagation In Neural Networks</a> - Understand how data flows through neural networks during prediction.</li></ul><p>To move from concepts to practical implementation:</p><ul><li><a href="https://quantra.quantinsti.com/course/neural-networks-deep-learning-trading-ernest-chan" rel="noopener">Neural Networks &amp; Deep Learning in Trading Course</a> - Learn how to apply neural networks, including advanced architectures like LSTM and RNN, to build trading strategies and evaluate performance.</li><li><a href="https://quantra.quantinsti.com/course/python-for-trading" rel="noopener">Python for Trading Course</a> - Build the programming foundation required to work with financial data, indicators, and machine learning models.</li></ul><p>Neural networks are a key part of modern quantitative trading. However, applying them effectively requires a structured approach across data, modelling, and validation.</p><h3 id="serious-about-learning">Serious about learning?</h3><p>For a comprehensive pathway covering machine learning, deep learning, and strategy development in trading, the <a href="https://www.quantinsti.com/epat">Executive Programme in Algorithmic Trading (EPAT)</a> provides a structured learning experience with practical implementation focus.</p><p>Connect with an EPAT career counsellor to explore how it aligns with your goals:</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><hr><!--kg-card-begin: html--><p><em><small>Note: The original post has been revamped on 11th May 2023 for accuracy, and recentness.</small></em></p><!--kg-card-end: html--><!--kg-card-begin: html--><p><em><small>Disclaimer: All data and information provided in this article are for informational purposes only. QuantInsti<sup>®</sup> makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information in this article and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis.</small></em></p> <!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Algorithmic Trading & Options Risk Management]]></title><description><![CDATA[Watch the algorithmic trading webinar recording covering Python and AI for trading, strategy development, and options risk management. Includes session recap, code files, and expert insights.]]></description><link>https://www.quantinsti.com/articles/algorithmic-trading-python-ai-options-risk-management-webinar/</link><guid isPermaLink="false">69ce37ff74e6f000074e66fe</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[MOHIT KARWAL]]></dc:creator><pubDate>Thu, 02 Apr 2026 09:35:35 GMT</pubDate><content:encoded><![CDATA[<h2 id="use-python-ai-for-trading-recap-and-recording">Use Python &amp; AI for Trading | Recap and Recording</h2><p>On April 9, QuantInsti hosted a highly anticipated live workshop focused on moving from discretionary ideas to systematic, rule-based decision-making. If you missed the live session or just want to re-watch the deep dive into how professionals build institutional-level trading systems you can watch the full recording below.</p><p></p><!--kg-card-begin: html--><style>
  .auth-only, .guest-only {
    display: none;
  }
  #auth-loader {
    text-align: center;
    padding: 30px;
  }
  .loader-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    margin: 0 auto 10px;
    animation: spin 1s linear infinite;
  }
  @keyframes spin {
    100% { transform: rotate(360deg); }
  }
  .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
  }
  .video-wrapper iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
  }
  .video-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
  }
  .video-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s ease;
  }
  .thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.4s ease;
  }
  .watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    background: #009F54;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .watch-btn:active {
    transform: scale(0.97);
  }
  .play-icon-wrap {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    transform: scale(0.8);
    pointer-events: none;
  }
  .ripple-ring {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    animation: ripple-out 2s ease-out infinite;
    opacity: 0;
  }
  .ripple-ring:nth-child(2) { animation-delay: 0.6s; }
  .ripple-ring:nth-child(3) { animation-delay: 1.2s; }
  @keyframes ripple-out {
    0%   { transform: scale(1);   opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
  }
  .video-thumb:hover img {
    filter: brightness(0.45);
  }
  .video-thumb:hover .thumb-overlay {
    background: rgba(0, 0, 0, 0.45);
  }
  .video-thumb:hover .watch-btn {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
  }
  .video-thumb:hover .play-icon-wrap {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
  }
</style>

<div id="auth-loader">
  <div class="loader-spinner"></div>
  Checking access...
</div>
<div class="auth-only">
  <div class="video-wrapper">
    <iframe src="https://www.youtube.com/embed/CJIHDVa9Xxg?si=g_fwWaJW1yS5WBAj&autoplay=1&mute=1&rel=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
    </iframe>
  </div>
</div>
<div class="guest-only">
  <div class="video-thumb" onclick="handleLoginClick()">
    <img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/Algo-Trading-Workshop-April-2026-2.png" alt="Course thumbnail">
    <div class="thumb-overlay">
      <button class="watch-btn">
        <svg width="16" height="16" viewbox="0 0 16 16" fill="#fff">
          <polygon points="3,2 13,8 3,14"/>
        </svg>
        Login &amp; Watch Now
      </button>
      <div class="play-icon-wrap">
        <div class="ripple-ring"></div>
        <div class="ripple-ring"></div>
        <div class="ripple-ring"></div>
        <svg width="72" height="72" viewbox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
          <circle cx="36" cy="36" r="35" stroke="rgba(255,255,255,0.9)" stroke-width="1.5"/>
          <polygon points="28,20 54,36 28,52" fill="white"/>
        </svg>
      </div>
    </div>
  </div>
</div>

<script>
(function () {
  function showLoader(show) {
    const loader = document.getElementById('auth-loader');
    if (loader) loader.style.display = show ? 'block' : 'none';
  }
  function injectAuthContent() {
    document.querySelectorAll('.auth-iframe').forEach(iframe => {
      const src = iframe.getAttribute('data-src');
      if (src) iframe.setAttribute('src', src);
    });
  }
  function showAuthContent() {
    document.querySelectorAll('.auth-only').forEach(el => el.style.display = 'block');
    document.querySelectorAll('.guest-only').forEach(el => el.style.display = 'none');
    injectAuthContent();
  }
  function showGuestContent() {
    document.querySelectorAll('.auth-only').forEach(el => el.style.display = 'none');
    document.querySelectorAll('.guest-only').forEach(el => el.style.display = 'block');
  }
  function handleAuth(user) {
    if (user && user.email) {
      showAuthContent();
    } else {
      showGuestContent();
    }
    showLoader(false);
  }
  function initAuthCheck() {
    showLoader(true);
    if (typeof window.ssoGetUserInfo === 'function') {
      try {
        const result = window.ssoGetUserInfo();
        if (result && typeof result.then === 'function') {
          result.then(handleAuth).catch(() => handleAuth(null));
        } else {
          handleAuth(result);
        }
      } catch (err) {
        console.error('SSO error:', err);
        handleAuth(null);
      }
    } else {
      handleAuth(null);
    }
  }
  document.addEventListener('DOMContentLoaded', initAuthCheck);
})();

function handleLoginClick() {
  window.ssoLogin(false, false);
}
</script><!--kg-card-end: html--><p></p><h3 id="download-code-files">DOWNLOAD CODE FILES</h3><p>You can download all presentation decks and code files here:</p><!--kg-card-begin: html--><p style="text-align: left;"><a href="https://www.quantinsti.com/articles/algorithmic-trading-python-ai-options-risk-management-webinar" class="download-button button"> Visit blog to download </a></p><!--kg-card-end: html--><!--kg-card-begin: html--><picture style="display:block; padding: 10px 0px 0px 0px;">
  <source media="(max-width: 768px)" srcset="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/Group-15-1.png">
  <img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/Group-16-1.png" alt="Download Resources" style="width:100%;">
</picture><!--kg-card-end: html--><!--kg-card-begin: html--><p>We'd love your feedback! Tell us what you think by taking our quick survey. Your insights help us improve future sessions. <a href="https://accounts.quantinsti.com/account?platform=quantinstiWeb&isLogin=false&isPopUp=false&redirect=https%3A%2F%2Fwww.quantinsti.com%2Fadmissions%3FstartExam%3Dtrue%26examType%3D6k469d4feed158df" target="_blank" rel="noopener noreferrer">Take survey now.</a></p>
<!--kg-card-end: html--><h3 id="what-s-covered">WHAT'S COVERED?</h3><p><strong>Part 1: Python for Trading Using AI</strong></p><ul><li>Using AI &amp; prompt engineering to quickly build and refine trading strategies</li><li>Why Python is the go-to language for quantitative and algorithmic trading</li><li>Understanding the full pipeline: idea → strategy design → backtesting → optimization → live execution</li></ul><p><strong>Part 2: Risk Management for Options Trading</strong></p><ul><li>How professionals structure and manage options strategies</li><li>Key mistakes retail traders make, and how to avoid them</li><li>Why disciplined risk management, not strategy, drives long-term success</li></ul><h3 id="industry-experts">INDUSTRY EXPERTS</h3><!--kg-card-begin: html--><style>
.faculty-section { font-family: inherit; padding: 1rem 0; }
.faculty-card { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 3rem; }
.faculty-card img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; flex-shrink: 0; align-self: flex-start; display: block; margin: 0 !important; padding: 0 !important; }
.faculty-info { flex: 1; }
.faculty-name { font-size: 17px !important; font-weight: 700 !important; margin: 0 0 1px !important; padding: 0; line-height: 1.4; }
.faculty-title { font-size: 14px !important; font-weight: 550 !important; color: #173871 !important; margin: 0 0 2px !important; padding: 0; line-height: 1.4; }
.faculty-desc { font-size: 16px; font-weight: 400; margin: 0 !important; padding: 0; line-height: 1; }
@media (max-width: 480px) {
  .faculty-card { flex-direction: column; align-items: flex-start; }
  .faculty-card img { width: 80px; height: 80px; }
}
</style>
<div class="faculty-section">
  <div class="faculty-card">
    <img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/Gaurav.png" alt="Dr. Gaurav Raizada">
    <div class="faculty-info">
      <p class="faculty-name"><strong>Dr. Gaurav Raizada</strong></p>
      <p class="faculty-title">Co-Founder, iRage &amp; EPAT Faculty</p>
      <p class="faculty-desc">Dr. Raizada shared his deep expertise in market microstructure and building robust, high-frequency trading systems.</p>
    </div>
  </div>
  <div class="faculty-card">
    <img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/Vivek.png" alt="Vivek Krishnamoorthy">
    <div class="faculty-info">
      <p class="faculty-name"><strong>Vivek Krishnamoorthy</strong></p>
      <p class="faculty-title">Head of Content &amp; Research, QuantInsti</p>
      <p class="faculty-desc">Vivek broke down the essentials of Python for data analysis, time-series analysis, and backtesting.</p>
    </div>
  </div>
  <div class="faculty-card">
    <img src="https://d1rwhvwstyk9gu.cloudfront.net/qi-cms-blog-prod/2026/04/Kelvin.png" alt="Dr. Kelvin Foo">
    <div class="faculty-info">
      <p class="faculty-name"><strong>Dr. Kelvin Foo</strong></p>
      <p class="faculty-title">Founder &amp; Managing Partner, Elemen79</p>
      <p class="faculty-desc">Dr. Foo brought in his extensive background in quant methods, risk management, and AI applications in financial markets.</p>
    </div>
  </div>
</div><!--kg-card-end: html--><h3 id="next-steps">NEXT STEPS</h3><p>We’d love your feedback! Tell us what you think by taking our quick survey. Your insights help us improve future sessions.</p><!--kg-card-begin: html--><style>
.download-button {
  background: transparent !important;
  border: 2px solid #009F54 !important;
  color: #009F54 !important;
  border-radius: 6px !important;
  font-family: 'Open Sans', sans-serif !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  padding: 5px 25px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-block !important;
  margin-top: 10px !important;
  margin-bottom: 20px !important;
}
</style>

<a class="download-button" href="https://accounts.quantinsti.com/account?platform=quantinstiWeb&isLogin=false&isPopUp=false&redirect=https%3A%2F%2Fwww.quantinsti.com%2Fadmissions%3FstartExam%3Dtrue%26examType%3D6k469d4feed158df" target="_blank">Share Feedback</a><!--kg-card-end: html--><p>This workshop provided a practical introduction to the core concepts taught in QuantInsti’s flagship <strong>Executive Programme In Algorithmic Trading (EPAT)</strong>.</p><h3 id="serious-about-learning">Serious about learning?</h3><p>For a comprehensive pathway covering machine learning, deep learning, and strategy development in trading, the <a href="https://www.quantinsti.com/epat">Executive Programme in Algorithmic Trading (EPAT)</a> provides a structured learning experience with practical implementation focus.</p><p>Connect with an EPAT career counsellor to explore how it aligns with your goals:</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><hr><!--kg-card-begin: html--><p><em><small>Disclaimer: All data and information provided in this article are for informational purposes only. QuantInsti<sup>®</sup> makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information in this article and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis.</small></em></p> <!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Proprietary Trading: Strategies, Career Opportunities!]]></title><description><![CDATA[Proprietary trading is when firms trade using their own capital in financial markets. Learn what is proprietary trading, explore proprietary trading strategies, career opportunities, and key regulations such as the Volcker Rule.]]></description><link>https://www.quantinsti.com/articles/proprietary-trading/</link><guid isPermaLink="false">69ca6dc874e6f000074e6693</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[MuniRaja Puthuru]]></dc:creator><pubDate>Wed, 01 Apr 2026 04:15:38 GMT</pubDate><content:encoded><![CDATA[<p><strong>Author:</strong> <a href="https://www.linkedin.com/in/chainika-bahl-thakar-b32971155/">Chainika Thakar</a></p><p>In the fast-paced world of finance, where markets ebb and flow with the speed of information, proprietary trading stands as a dynamic and influential force. Proprietary trading, the practice of trading financial assets using a firm's own capital, has witnessed significant evolution, driven by regulatory changes, market trends, and the pursuit of profit.</p><p>This evolution has shaped the landscape of proprietary trading, presenting both opportunities and challenges for those involved. In this article, we will be understanding its evolution, recognising the hurdles it presents,  journey through the strategies employed by traders, the regulatory landscape that governs their actions, and the diverse career opportunities it offers.</p><p>From the trading floors of proprietary trading firms to the executive offices of hedge funds, we will unravel the intricacies of this high-stakes world, shedding light on its past, present, and future.</p><p>Some of the concepts regarding proprietary trading in this blog have been taken from our <a href="https://www.quantinsti.com/epat">algorithmic trading course</a>.</p><hr><h2 id="what-is-proprietary-trading">What is proprietary trading?</h2><p>Proprietary trading refers to the trading activities conducted by entities like banks or firms using their own capital. These investments can encompass various financial assets, including stocks, derivatives, bonds, commodities, and more.</p><p>In proprietary trading, the entity utilises its own funds rather than the client’s capital. Consequently, the profits generated from these trades accrue entirely to the entity conducting the trading, eliminating the need to depend on commissions earned from client investments.</p><p>Proprietary trading, often referred to as prop desk trading, involves the deployment of a financial institution's capital to engage in market transactions, distinguishing itself by not relying on client funds, thereby embracing a higher risk and reward profile.</p><hr><h2 id="strategies-in-proprietary-trading">Strategies in proprietary trading</h2><p>Traders employed at a proprietary trading firm have a range of strategies at their disposal to maximise the profitability of their trades. Let's delve into the following strategies:</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/09/Strategies-in-Proprietary-Trading-1.jpg" class="kg-image" alt="Strategies in prop trading"><figcaption>Strategies in prop trading</figcaption></figure><h3 id="merger-arbitrage">Merger arbitrage</h3><p>Merger arbitrage, often referred to as risk arbitrage, is an investment approach where the trading firm purchases stocks from companies involved in mergers. This strategy capitalises on market inefficiencies by simultaneously buying and selling the stocks of two or more merging companies, creating less risky yet profitable opportunities.</p><h3 id="index-arbitrage">Index arbitrage</h3><p>The index arbitrage strategy seeks to profit from the difference between a stock's current price and its theoretical future price. Suppose you're an investor who notices that the S&amp;P 500 Index ETF (Exchange-Traded Fund) is trading at $500, while the individual stocks within the index are collectively worth $505 based on their current prices. This situation presents an index arbitrage opportunity. Here's how it works:</p><ul><li><strong>Buy the S&amp;P 500 Index ETF: </strong>You purchase shares of the S&amp;P 500 Index ETF at $500 each.</li><li><strong>Simultaneously Sell the Underlying Stocks: </strong>You identify the individual stocks that make up the S&amp;P 500 and sell them short. In this case, the combined value of those stocks is $505.</li><li><strong>Wait for Convergence: </strong>You wait for the market to correct itself. The idea is that the ETF's price will eventually rise to match the collective value of the underlying stocks (in this case, $505).</li><li><strong>Profit from the Price Difference: </strong>Once the ETF's price reaches $505, you cover your short positions in the individual stocks, making a profit of $5 per ETF share ($505 - $500).</li></ul><h3 id="global-macro-trading">Global macro-trading</h3><p>Global macro-trading relies on interpreting macroeconomic events at regional, national, or global levels. Successful implementation of this strategy involves portfolio managers analysing macroeconomic and geopolitical factors, such as interest rates, currency exchange rates, political events, international trade, and global relations. It is important to note that this strategy is influenced by systematic market risks beyond the organisation's control.</p><h3 id="volatility-arbitrage">Volatility arbitrage</h3><ul><li>Volatility arbitrage aims to profit from disparities between the <a href="https://blog.quantinsti.com/implied-volatility/">implied volatility</a> of options and corresponding movements in the underlying assets. Typically executed in a delta-neutral portfolio that includes both options and underlying assets, this strategy capitalises on the relationship between volatility and option prices. For beginners exploring <a href="https://quantra.quantinsti.com/course/volatility-trading-strategies">volatility trading strategies</a>, understanding the fundamentals of volatility arbitrage can provide valuable insights into managing risk and profiting from market inefficiencies.</li><li>Traders may choose to employ a long call option and a short position in the underlying asset when they anticipate an increase in future volatility <a href="https://quantra.quantinsti.com/course/momentum-trading-strategies">momentum</a>. If volatility indeed rises, the option's value increases, resulting in a favourable outcome for the trader, even if the underlying asset's price remains relatively stable.</li></ul><p>Prop desk trading employs diverse strategies, ranging from high-frequency trading algorithms to quantitative models, meticulously crafted to capitalize on market inefficiencies and generate alpha.</p><p>To expand your knowledge of volatility-based strategies, consider exploring <a href="https://quantra.quantinsti.com/course/options-volatility-trading">options volatility trading</a>, where you'll learn advanced concepts like options Greeks, GARCH modeling, and practical techniques for real-world trading.</p><p>There are also many more sophisticated <a href="https://quantra.quantinsti.com/course/quantitative-trading-strategies-models">trading strategies</a> used by seasoned traders and quants. Explore some of these trading techniques in our <a href="https://quantra.quantinsti.com/learning-track/algorithmic-trading-for-quants">Advanced Algorithmic Trading Strategies</a> learning track which is developed in collaboration with leading industry experts.</p><hr><h2 id="career-opportunities-in-proprietary-trading">Career opportunities in proprietary trading</h2><p>In the dynamic and ever-evolving world of finance and investment, there exists a plethora of exciting career opportunities for individuals. The core of these career opportunities resides in the individual’s passion for markets, a knack for analysis, and a drive for success. There are several important interview questions which you can explore in our <a href="https://quantra.quantinsti.com/course/quant-interview-questions-preparation">quant interview preparations course</a> as well.</p><p>Let us find out more about proprietary trading career opportunities.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/09/Organisations-for-Career-Opportunities.jpg" class="kg-image" alt="Organisations for career opportunities "><figcaption>Organisations for career opportunities&nbsp;</figcaption></figure><h3 id="proprietary-trading-firms">Proprietary trading firms</h3><p>At the heart of prop desk trading lies a synergy of cutting-edge technology and sophisticated trading strategies, empowering traders to navigate complex market dynamics, execute trades swiftly, and seize fleeting opportunities for profit generation.</p><p>In the proprietary trading firms, following roles below can be taken up by a proprietary trader.</p><ul><li><strong>Junior Trader:</strong> Entry-level traders typically start here, learning the ropes and gaining experience in executing trades and managing risk.</li><li><strong>Senior Trader: </strong>With experience, traders can advance to senior roles, where they have more responsibility and often manage a team of junior traders.</li><li><strong>Quantitative Analyst (<a href="https://www.quantinsti.com/articles/quantitative-trader/">Quant Trader</a>): </strong>Proprietary trading firms often hire traders with strong quantitative skills to develop and implement algorithmic trading strategies.</li><li><strong>Risk Manager: </strong>Some traders transition into risk management roles, where they assess and manage the risks associated with the firm's trading activities.</li></ul><p>Usually, you will start from the junior trader level in case you are an undergraduate. Apart from a trader, there are some other <a href="https://www.quantinsti.com/quant-jobs">quant job</a> opportunities one can seek at a proprietary trading firm such as:</p><ul><li><strong>Quant Researcher:</strong> Establishing mathematical models for trading algorithms and strategies.</li><li><strong>Developer:</strong> Implementing the researchers’ models or strategies and creating algorithms for helping the traders trade algorithmically.</li><li><strong>Data Scientist:</strong> Help to devise trading strategies for the firm.</li></ul><h3 id="hedge-funds">Hedge funds</h3><p>Let us find out the career opportunities or roles for a proprietary trader in a hedge fund below. For a detailed, step-by-step guide specifically focused on breaking into hedge funds, check out our resource on <a href="https://www.quantinsti.com/articles/hedge-fund-jobs/">how to get a job at a hedge fund</a>.</p><ul><li><strong>Portfolio Manager: </strong>Experienced traders can become portfolio managers at hedge funds, where they oversee a portfolio of assets and make investment decisions on behalf of investors.</li><li><strong>Quantitative Researcher:</strong> Hedge funds value traders with strong analytical and quantitative skills to develop proprietary trading strategies and conduct market research.</li><li><a href="https://www.quantinsti.com/articles/risk-analyst/"><strong>Quantitative Risk Analyst</strong></a><strong>:</strong> Traders can transition into risk analysis roles within hedge funds, assessing and mitigating risks associated with the fund's investments.</li><li><strong>Compliance Officer: </strong>Some traders may move into compliance roles, ensuring that the fund operates within regulatory guidelines.</li></ul><h3 id="investment-banks">Investment banks</h3><p>Now we will see how the investment banks can be utilised by the proprietary trader for job roles. You can see the different roles of a proprietary trader in the investment banking industry below.</p><ul><li><strong>Sales and Trading:</strong> Investment banks often have proprietary trading desks where traders execute trades for the bank's own account. Traders may also work in sales and trading roles, interacting with clients and executing orders on their behalf.</li><li><strong>Quantitative Researcher:</strong> Investment banks employ <a href="https://www.quantinsti.com/articles/quantitative-analyst-researcher/">quantitative researchers</a> to develop trading strategies and provide analytical support for trading desks.</li><li><strong>Risk Management: </strong>Traders can transition into risk management roles within investment banks, focusing on market and credit risk assessment.</li><li><strong>Asset Management:</strong> Investment banks often have asset management divisions where traders can manage portfolios for institutional or retail clients.</li></ul><p>Exploring career opportunities in prop desk trading unveils a dynamic landscape, where individuals with quantitative prowess and a keen understanding of financial markets can thrive, spearheading innovative trading strategies and cultivating robust risk management frameworks.</p><p>Whether you aspire to work in proprietary trading firms, hedge funds, or investment banks, the financial industry offers a diverse range of roles, each with its unique challenges and rewards. This guide explores the promising career paths that await those with the ambition to thrive in this dynamic and competitive field.</p><hr><h2 id="how-to-get-started-with-a-career-in-proprietary-trading">How to get started with a career in proprietary trading?</h2><p>To kickstart a career in proprietary trading, consider gaining practical experience through internships or entry-level positions at financial institutions. Additionally, practice trading in simulated environments to refine your skills and strategies.</p><p>As you gain experience and build a track record of successful trading, you can pursue opportunities at proprietary trading firms or even explore proprietary trading desks within larger financial institutions. Undoubtedly, the qualification, skills and the personal qualities of a trader are the basic foundations for starting the career as a trader in a proprietary trading firm.</p><p>One cool thing about prop desk trading? These traders get to experiment with sophisticated strategies that most retail investors wouldn't even dream of - it's like being in the major league of financial wizardry.</p><p>Let us find out more about the aspects namely qualification, skills and the personal qualities of a trader below.</p><h3 id="qualification-needed-to-become-a-proprietary-trader">Qualification needed to become a proprietary trader</h3><ul><li><strong>Educational Background: </strong>While there is no specific educational path, a strong foundation in finance, economics, mathematics, or a related field is beneficial. Many proprietary traders hold bachelor's degrees, and some pursue advanced degrees such as Master's in Finance or MBA.</li><li><strong>Financial Knowledge: </strong>Deep understanding of financial markets, instruments, and trading strategies is crucial. Consider taking courses, reading books, and staying updated with financial news.</li></ul><h3 id="skills-and-personal-qualities-needed-to-become-a-trader-at-a-proprietary-firm">Skills and personal qualities needed to become a trader at a proprietary firm</h3><ul><li><strong>Analytical Skills:</strong> Proprietary traders must analyse market data, economic indicators, and company financials to make informed trading decisions.</li><li><strong>Quantitative Skills:</strong> Proficiency in quantitative analysis is vital for creating and implementing trading algorithms and models.</li><li><strong>Risk Management:</strong> Traders need to manage and mitigate risks associated with their positions. A solid grasp of <a href="https://blog.quantinsti.com/trading-risk-management/">risk management trading</a> techniques is essential.</li><li><strong>Decision-Making:</strong> Quick and rational decision-making, even under pressure, is a hallmark of successful traders.</li><li><strong>Discipline:</strong> Proprietary trading often involves adhering to trading strategies and risk parameters with unwavering discipline.</li><li><strong>Emotional Control:</strong> Maintaining emotional composure during periods of market volatility is crucial to prevent impulsive decisions.</li><li><strong>Adaptability:</strong> Markets are dynamic; traders must adapt to changing conditions and strategies.</li><li><strong>Tech Savviness:</strong> Familiarity with trading platforms, algorithmic trading tools, and market data systems is advantageous.</li><li><strong>Knowledge of a programming language:</strong> It is an advantage to hold proficiency in a programming language such as <a href="https://quantra.quantinsti.com/course/python-for-trading">Python</a> as it enhances the capabilities of a proprietary trader for algorithmic trading and data analysis.</li><li><strong>Continuous Learning:</strong> Proprietary traders must stay updated with market trends, news, and evolving trading strategies.</li><li><strong>Networking:</strong> Building relationships within the industry can open doors to opportunities and insights.</li></ul><p>Remuneration in prop desk trading is directly correlated with performance. Entering the realm of prop desk trading requires an individual to possess exceptional resilience and psychological fortitude, as the practice entails making high-stakes decisions with the firm’s capital, subject to the volatile nature of financial markets.</p><hr><h2 id="volcker-rule-on-proprietary-trading">Volcker rule on proprietary trading</h2><p>In the United States, during the period of the Great Recession, several firms and hedge funds came under close examination. The prevailing belief was that the 2008 financial crisis was primarily attributed to credit defaults. Consequently, the federal government introduced the Volcker Rule as a preventive measure to avert another crisis.</p><p>The Volcker Rule, established in 2010, was a regulatory measure enacted as part of the Dodd-Frank Wall Street Reform. Its primary objective was to impose constraints on depository banks, preventing them from engaging in high-volatility, high-risk investments.</p><p>This regulatory initiative was championed by Paul Volcker, a former Federal Reserve Chairman, with the main aim of segregating commercial banking and investment banking activities.</p><p>Paul Volcker's decision was chiefly motivated by the observation that proprietary trading was negatively impacting the overall economy. It was apparent that banks and similar entities were prioritising profit generation over safeguarding the interests of the consumer market. Many banks involved in proprietary trading had been using derivatives to minimise risk, inadvertently increasing risk exposure in various other sectors.</p><p>Consequently, the Volcker Rule mandated that banks redirect their focus towards ensuring customer satisfaction rather than prioritising their profit-driven activities at the expense of customer safety. In response to the Volcker Rule, numerous banks either separated their proprietary trading operations from their core activities or ceased these operations altogether.</p><p>Over the past decade since the inception of the Volcker Rule, it has sparked various perspectives and discussions within the industry, leading to significant developments and adaptations.</p><hr><h2 id="hedge-fund-vs-proprietary-trading">Hedge fund vs Proprietary trading</h2><p>Let us now see some of the key differences between hedge funds and proprietary trading firms below.</p><!--kg-card-begin: html-->
<table>
<tbody>
<tr>
<td>
<p><strong>Aspect</strong></p>
</td>
<td>
<p><strong>Hedge Funds</strong></p>
</td>
<td>
<p><strong>Proprietary Trading Firms</strong></p>
</td>
</tr>
<tr>
<td>
<p>Capital Source</p>
</td>
<td>
<p>Utilise clients' funds for investments.</p>
</td>
<td>
<p>Invest the firm's own capital.</p>
</td>
</tr>
<tr>
<td>
<p>Accountability</p>
</td>
<td>
<p>Accountable to clients; fiduciary duty.</p>
</td>
<td>
<p>Not accountable to external clients.</p>
</td>
</tr>
<tr>
<td>
<p>Profit Distribution</p>
</td>
<td>
<p>Receive a commission from clients' profits.</p>
</td>
<td>
<p>Retain the entire profit for the firm.</p>
</td>
</tr>
<tr>
<td>
<p>Investment Objective</p>
</td>
<td>
<p>Act on behalf of clients' best interests.</p>
</td>
<td>
<p>Focus on generating profits for the firm.</p>
</td>
</tr>
</tbody>
</table>
<!--kg-card-end: html--><p>Contrasting hedge fund and proprietary trading realms underscores nuanced differences in approach and objectives, where hedge funds typically manage external capital with a focus on absolute returns, while prop desk trading centers on leveraging a firm's own capital to maximize profitability within defined risk parameters.</p><p>These key differences highlight how hedge funds and proprietary trading firms operate in the financial markets and how they handle capital, accountability, profit distribution, and investment objectives.</p><hr><h2 id="regulatory-and-compliance-risks">Regulatory and Compliance Risks</h2><p>Regulatory and compliance risks in the context of proprietary trading are significant considerations for financial institutions engaged in this activity.</p><p>Below is an overview of key<strong> “regulatory and compliance risks”</strong> associated with proprietary trading.</p><ul><li><strong><strong><strong>Volcker Rule Compliance</strong></strong>: </strong>The Volcker Rule, part of the Dodd-Frank Wall Street Reform and Consumer Protection Act, prohibits banks from engaging in proprietary trading activities that could pose risks to their stability. Compliance with this rule is essential for proprietary trading firms to avoid regulatory penalties.</li><li><strong><strong><strong>Market Manipulation</strong></strong>: </strong>Proprietary trading firms must adhere to market integrity regulations to prevent market manipulation, such as insider trading, spoofing, and front-running. Violations can lead to severe legal consequences.</li><li><strong><strong><strong>Risk Management</strong></strong>: </strong>Effective risk management is crucial for proprietary trading firms to mitigate market, credit, and operational risks. Firms must establish robust risk assessment and risk monitoring processes.</li><li><strong><strong><strong>Capital Adequacy</strong></strong>: </strong>Regulatory authorities often impose capital adequacy requirements on proprietary trading firms to ensure they maintain sufficient capital reserves to cover potential losses. Failure to meet these requirements can result in regulatory action.</li><li><strong><strong><strong>Conflict of Interest</strong></strong>: </strong>Proprietary trading firms need to manage conflicts of interest, especially when executing trades on behalf of clients while also engaging in proprietary trading. This requires clear policies and transparency.</li><li><strong><strong><strong>Compliance Reporting</strong></strong>: </strong>Firms must accurately report their trading activities to regulatory authorities. Failure to provide timely and accurate reports can lead to fines and sanctions.</li><li><strong><strong><strong>Liquidity Risk</strong></strong>: </strong>Proprietary trading firms face liquidity risk, particularly during market downturns. Compliance requires adequate liquidity management practices to ensure the firm's solvency.</li><li><strong><strong><strong>Cross-Border Regulations</strong></strong>: </strong>Global proprietary trading firms must navigate a complex web of regulations in different jurisdictions. Complying with local and international regulations is challenging but essential.</li><li><strong><strong><strong>Technology and Cybersecurity</strong></strong>: </strong>The reliance on technology for trading exposes firms to cybersecurity risks. Compliance involves implementing robust cybersecurity measures to protect sensitive data and trading systems.</li><li><strong><strong><strong>Record</strong></strong> <strong><strong>keeping and Documentation</strong></strong>: </strong>Proper record keeping and documentation of trading activities are essential for demonstrating compliance with regulations. Firms must maintain accurate records for audit and reporting purposes.</li><li><strong><strong><strong>Regulatory Changes and Updates</strong></strong>: </strong>Regulatory frameworks can change frequently. Staying updated on regulatory changes and promptly adapting to new requirements is crucial for ongoing compliance.</li><li><strong><strong><strong>Employee Training and Conduct</strong></strong>: </strong>Ensuring that employees are well-informed about compliance policies and follow ethical conduct is essential. Training programs and codes of conduct can help mitigate risks associated with employee behaviour.</li></ul><p>Proprietary trading firms must establish comprehensive compliance programs, appoint compliance officers, and regularly audit their operations to identify and address regulatory and compliance risks effectively. Failure to do so can result in severe legal and financial consequences, including fines, loss of licences, and reputational damage.</p><hr><h2 id="evolving-regulations-in-proprietary-trading">Evolving regulations in proprietary trading</h2><p>Proprietary trading has evolved significantly due to regulatory changes aimed at enhancing transparency, reducing risks, and improving oversight. The evolution of prop desk trading has been significantly influenced by regulatory changes, necessitating a continuous adaptation of strategies to mitigate risks while capitalizing on emerging market opportunities.</p><p>The mentioned amendments to the regulations implementing section 13 of the Bank Holding Company Act highlight this evolution. Here's a brief overview of how proprietary trading has evolved:</p><ul><li><strong>Regulatory Response:</strong> In response to the global financial crisis of 2008, regulators recognised the need to address excessive risk-taking by financial institutions, including proprietary trading activities.</li><li><strong>Dodd-Frank Act: </strong>The Dodd-Frank Wall Street Reform and Consumer Protection Act introduced significant regulatory reforms to the financial industry, including section 13 of the Bank Holding Company Act. This contains provisions related to the reporting and public disclosure of financial information by bank holding companies and their subsidiaries.</li><li><strong>Section 13 Provisions:</strong> Section 13 imposed restrictions on proprietary trading by banking entities and their relationships with hedge funds and private equity funds. These restrictions were designed to prevent conflicts of interest, reduce risk exposure, and protect the stability of the financial system.</li><li><strong>Clarity and Supervision:</strong> The recent amendments to section 13 regulations, adopted by agencies such as the OCC, Board, FDIC, SEC, and CFTC, aim to provide banking entities with greater clarity regarding prohibited activities. These amendments seek to enhance supervision and implementation of section 13, ensuring that financial institutions understand the boundaries of proprietary trading.</li><li><strong>Risk Mitigation: </strong>The evolution of proprietary trading regulation is driven by a desire to mitigate risks associated with speculative trading and potential conflicts of interest. These regulations aim to strike a balance between allowing legitimate market-making activities and curbing excessive proprietary trading.</li><li><strong>Enhanced Oversight: </strong>Regulatory bodies have intensified their oversight of proprietary trading activities to ensure that banking entities comply with the law and do not engage in activities that could jeopardise financial stability.</li><li><strong>Transparency:</strong> Proprietary trading regulations have become more transparent, providing financial institutions with clearer guidelines on what is permitted and what is prohibited.</li></ul><p>In summary, proprietary trading has evolved in response to regulatory reforms aimed at safeguarding the financial system. The amendments to section 13 regulations reflect a commitment to providing greater clarity, improving supervision, and reducing the potential risks associated with proprietary trading by banking entities.</p><p>These changes represent a pivotal shift in the financial industry's approach to proprietary trading activities.</p><hr><h2 id="pros-of-working-at-a-proprietary-trading-firm">Pros of working at a Proprietary Trading Firm</h2><p>The pros of working at a Proprietary Trading Firm are as follows:</p><ul><li><strong>Lower Risk</strong>: As an employee, you are not personally responsible for the firm's financial health or regulatory compliance, reducing personal financial and legal risks.</li><li><strong>Access to Resources:</strong> Proprietary trading firms often provide access to cutting-edge trading technology, data feeds, research, and market analysis tools, which can enhance your trading capabilities.</li><li><strong>Learning Opportunity:</strong> You can gain experience and refine your trading skills while learning from experienced colleagues and mentors within the firm.</li><li><strong>Collaboration</strong>: Proprietary trading firms often encourage collaboration among traders and analysts, fostering a dynamic and supportive work environment.</li><li><strong>Less Administrative Burden: </strong>Employees can focus primarily on trading and strategy development, with less responsibility for administrative tasks, regulatory filings, and compliance.</li></ul><hr><h2 id="pros-of-owning-a-proprietary-trading-firm">Pros of owning a Proprietary Trading Firm</h2><p>The pros of owning a Proprietary Trading Firm are as follows:</p><ul><li><strong>Control and Autonomy: </strong>You have full control over the trading strategies, risk management, and decision-making processes of the firm. You can shape the firm's direction according to your vision. Moreover, you have greater flexibility in choosing the asset classes, markets, and trading strategies to pursue, allowing you to adapt to changing market conditions.</li><li><strong>Brand and Reputation:</strong> Building and managing your proprietary trading firm allows you to establish your brand and reputation in the industry, potentially attracting clients and investors.</li><li><strong>Long-Term Wealth Creation:</strong> Successful ownership of a proprietary trading firm can lead to long-term wealth creation and the potential for substantial financial rewards.</li><li><strong>New Trading Strategies: </strong>You can experiment with innovative trading strategies and technologies, potentially gaining a competitive edge.</li></ul><p>It's essential to consider your financial goals, risk tolerance, and career preferences when deciding between working at a proprietary trading firm and owning one. Both options offer unique advantages and challenges, and the right choice depends on your individual circumstances and aspirations.</p><hr><h2 id="challenges-of-working-at-a-proprietary-trading-firm">Challenges of working at a Proprietary Trading Firm</h2><p>The challenges of working at a Proprietary Trading Firm are as follows:</p><ul><li><strong>Performance Pressure:</strong> Traders and analysts often face intense pressure to consistently generate profits, which can be mentally and emotionally taxing.</li><li><strong>Market Volatility:</strong> Proprietary trading is subject to market volatility, and traders may experience substantial losses during turbulent market conditions.</li><li><strong>Long Working Hours:</strong> Proprietary trading often involves long working hours, especially during peak trading times, which can lead to burnout.</li><li><strong>High Competition:</strong> The industry is highly competitive, with traders vying for profitable opportunities, making it challenging to secure consistent profits.</li><li><strong>Limited Autonomy: </strong>Traders may have limited autonomy, as they are required to follow the firm's trading strategies and risk management protocols.</li><li><strong>Regulatory Compliance:</strong> Traders must adhere to strict regulatory guidelines, and non-compliance can result in legal and financial consequences.</li></ul><hr><h2 id="challenges-of-owning-a-proprietary-trading-firm">Challenges of owning a Proprietary Trading Firm</h2><p>The challenges of owning a Proprietary Trading Firm are as follows:</p><ul><li><strong>Financial Risk: </strong>Owners are personally responsible for the firm's financial health. Losses can directly impact personal finances and may even lead to bankruptcy.</li><li><strong>Regulatory Compliance: </strong>Owning a proprietary trading firm involves navigating complex regulatory frameworks, which can be time-consuming and costly to maintain.</li><li><strong>Capital Requirements:</strong> Establishing and maintaining sufficient capital reserves to cover potential losses is a significant challenge for owners.</li><li><strong>Operational Responsibilities: </strong>Owners are responsible for managing all aspects of the business, including administrative tasks, compliance, and risk management, which can be demanding.</li><li><strong>Technological Investment:</strong> Owners must invest in advanced trading technology and infrastructure, which requires a substantial upfront financial commitment.</li><li><strong>Market Access: </strong>Building relationships and gaining access to markets can be difficult, particularly for new firms entering the industry.</li><li><strong>Competition for Talent: </strong>Attracting and retaining talented traders and analysts can be competitive and may require offering competitive compensation packages.</li></ul><p>It's important to recognise that both working at a proprietary trading firm and owning one come with their own set of challenges and risks. The decision to pursue either path should be based on an individual's risk tolerance, financial situation, career goals, and willingness to take on responsibility.</p><hr><h2 id="tips-for-success-in-proprietary-trading">Tips for success in proprietary trading</h2><p>Individuals engaged in prop desk trading are required to possess not only an exceptional understanding of market dynamics but also the resilience to withstand substantial fluctuations in their trading positions. Below are some tips to help overcome the challenges associated with both working at a proprietary trading firm and owning one:</p><h3 id="tips-for-overcoming-challenges-as-an-employee-at-a-proprietary-trading-firm">Tips for overcoming challenges as an Employee at a Proprietary Trading Firm</h3><ul><li><strong>Continuous Learning:</strong> Invest in ongoing education and skill development to stay competitive in the industry. Expanding your knowledge can help you adapt to changing market conditions.</li><li><strong>Mental Resilience: </strong>Develop strategies to manage stress and maintain mental resilience. Techniques like mindfulness, meditation, and regular breaks can help you stay focused and composed under pressure.</li><li><strong>Risk Management: </strong>Focus on effective risk management strategies to minimise potential losses and protect your trading capital.</li><li><strong>Networking:</strong> Build a strong professional network within and outside the firm. Networking can provide valuable insights, mentorship opportunities, and potential collaboration.</li><li><strong>Work-Life Balance:</strong> Strive to maintain a healthy work-life balance. Setting boundaries and taking time for relaxation and recreation is essential for long-term well-being.</li></ul><h3 id="tips-for-overcoming-challenges-as-an-owner-of-a-proprietary-trading-firm">Tips for Overcoming Challenges as an Owner of a Proprietary Trading Firm</h3><ul><li><strong>Financial Planning: </strong>Establish a comprehensive financial plan that includes capital reserves, risk management strategies, and contingency plans for adverse scenarios.</li><li><strong>Legal and Regulatory Expertise: </strong>Invest in legal and regulatory expertise. Engaging legal counsel or compliance professionals can help you navigate complex regulatory requirements.</li><li><strong>Operational Efficiency: </strong>Streamline and automate operational processes wherever possible to minimise administrative burdens and reduce overhead costs.</li><li><strong>Client Relations: </strong>Develop strong client relationships and provide excellent customer service to attract and retain clients and investors.</li><li><strong>Strategic Alliances: </strong>Consider forming strategic alliances or partnerships with other firms to expand market access and share resources.</li><li><strong>Technology Investment:</strong> Continuously invest in cutting-edge technology and cybersecurity to stay competitive and protect sensitive data.</li><li><strong>Talent Management: </strong>Attract and retain top talent by offering competitive compensation packages and creating a positive work environment.</li><li><strong>Market Research:</strong> Stay informed about market trends, competitor activities, and emerging technologies to identify new opportunities and threats.</li><li><strong>Diversification: </strong>Consider diversifying your trading strategies and asset classes to spread risk and capture a broader range of opportunities.</li><li><strong>Mentorship: </strong>Seek mentorship or advice from experienced industry professionals or business owners who can provide guidance and insights.</li></ul><p>It is a must to note that the challenges are a natural part of both working in and owning a proprietary trading firm. Success often comes from a combination of perseverance, adaptability, and a commitment to continuous improvement.</p><p>The strategic approach adopted by traders within the realm of prop desk trading often involves the utilization of advanced and sophisticated methodologies, far beyond those typically accessible to the average investor. It's crucial to remain agile and open to adjustments in your approach as you encounter and address these challenges.</p><hr><h2 id="future-trends-in-proprietary-trading">Future trends in proprietary trading</h2><p>In the context of the future of proprietary trading, it appears that a substantial portion of prop trading firms, approximately 73% based on interviews, <a href="https://contentworks.agency/prop-trading-fad-or-future/">anticipated</a> that 2023 would present abundant trading prospects. However, only 18% of these firms expressed confidence in their ability to capitalise on these opportunities. </p><p>This confidence may have stemmed from the trader base they managed to amass in 2022. Nevertheless, it's essential to recognise that the trading landscape remains challenging, and the industry's reputation can be volatile, even for the most accomplished proprietary trading firms. Consequently, to attract exceptional traders in the future, a formidable marketing strategy will be indispensable.</p><p>Overall, the future of proprietary trading for 2024 and beyond appears to be promising in terms of potential opportunities, but it will likely require a combination of skill, strategy, and effective marketing to achieve success in an environment that is perceived as challenging and volatile.</p><p>Traders and firms will need to remain adaptable and well-prepared to make the most of these opportunities while managing associated risks.</p><hr><h3 id="bibliography">Bibliography</h3><ol><li><a href="https://blog.quantinsti.com/proprietary-trading-desk/">Proprietary Trading Desk Setup: A Step by Step Guide</a></li><li><a href="https://www.napatech.com/wp-content/uploads/2017/12/DN-1131_Case-study-Proprietary-trading-firm-strengthens-regulatory-compliance.pdf">Case study - Global proprietary firm strengthens regulatory compliance</a></li><li><a href="https://www.federalreserve.gov/newsevents/pressreleases/files/bcreg20191008a1.pdf">Revisions to Prohibitions and Restrictions on Proprietary Trading and Certain Interests in, and Relationships With, Hedge Funds and Private Equity Funds</a></li><li><a href="https://contentworks.agency/prop-trading-fad-or-future/">Proprietary trading: Fad or future?</a></li></ol><hr><h3 id="conclusion">Conclusion</h3><p>A proprietary trading firm is an entity which invests its own money in a particular financial instrument or combination of financial instruments. One can work in a proprietary trading firm with some knowledge about trading practice, a good educational background and some skills.</p><p>Proprietary trading is a dynamic and evolving field within the financial industry. It involves trading financial assets using a firm's own capital rather than client funds, with various strategies employed to maximise profitability. The industry offers a range of career opportunities, whether as an employee in a proprietary trading firm, an owner of such a firm, or within investment banks and hedge funds.</p><p>The allure of prop desk trading lies not only in its potential for substantial financial rewards but also in the intellectual challenge it presents, enticing ambitious individuals to immerse themselves in the intricacies of quantitative analysis, risk management, and strategic decision-making within a fast-paced trading environment.</p><p>Overall, proprietary trading continues to evolve in response to regulatory changes and market dynamics. Success in this field requires a combination of skills, adaptability, and a keen understanding of market trends and regulations. Whether as an employee or an owner, individuals in proprietary trading will need to navigate challenges while seizing opportunities in the ever-changing financial landscape.</p><h3 id="next-steps">Next Steps</h3><p>If you want to deepen your understanding of proprietary trading and how firms operate, the following resources can help you explore practical aspects and industry insights:</p><ul><li><a href="https://www.quantinsti.com/articles/proprietary-trading-desk/" rel="noopener">Proprietary Trading Desk Setup</a> - Learn how proprietary trading desks are structured, including infrastructure, technology, and capital requirements.</li><li><a href="https://www.quantinsti.com/articles/hft-prop-trading-firms/" rel="noopener">Top Prop Trading and HFT Firms</a> - Explore leading proprietary trading and high-frequency trading firms and how they operate in global markets.</li></ul><p>Many traders begin by understanding trading strategies and career paths in proprietary trading. The next step is learning how these strategies are implemented using quantitative methods and automated systems.</p><h3 id="serious-about-learning">Serious about learning?</h3><p>For those looking to bridge this gap with a structured, practitioner-led approach, the <a href="https://www.quantinsti.com/epat">Executive Programme in Algorithmic Trading (EPAT)</a> offers a natural next step. It focuses on a learn-by-coding approach to help professionals transition from manual trading to automated trading.</p><p>Connect with an EPAT career counsellor to discuss the right quant role for your background.</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><hr><!--kg-card-begin: html--><p><em><small>Note: The original post has been revamped on 2nd November 2023 for accuracy, and recentness.</small></em></p>

<p><em><small>Disclaimer: All data and information provided in this article are for informational purposes only. QuantInsti<sup>®</sup> makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information in this article and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages 	arising from its display or use. All information is provided on an as-is basis.</small></em></p> <!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Bearish Candlestick Patterns Explained]]></title><description><![CDATA[Bearish candlestick patterns are chart signals that indicate potential price declines. Learn their meaning, types, examples, and how traders use them in trading strategies.]]></description><link>https://www.quantinsti.com/articles/bearish-candlestick-patterns/</link><guid isPermaLink="false">69bd1d2e74e6f000074e663a</guid><category><![CDATA[Learn Algo Trading]]></category><dc:creator><![CDATA[MuniRaja Puthuru]]></dc:creator><pubDate>Fri, 20 Mar 2026 11:57:45 GMT</pubDate><content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/chainika-bahl-thakar-b32971155/">Chainika Thakar</a></p><p>In the dynamic world of trading, understanding the language of the markets is imperative and that includes the most valuable skills of the ability to read and interpret candlestick patterns. Among these, bearish candlestick patterns stand out as crucial indicators of potential price declines. In this all-encompassing guide, we embark on an enlightening journey through the world of bearish candlestick patterns. </p><p>From unravelling their underlying concepts to grasping their diverse types, we will delve into the techniques that empower traders to identify, interpret, and capitalise on these telltale indicators.</p><p>Whether you're a seasoned trader seeking to refine your skills or a newcomer looking for market mastery, this guide equips you with the essential insights into bearish candlestick patterns.</p><p>Some of the concepts covered in this blog are taken from this Quantra learning course on <a href="https://quantra.quantinsti.com/course/candlestick-patterns-automated-trading">Candlestick Patterns based Automated Trading</a>. You can take a <a href="https://quantra.quantinsti.com/startCourseDetails/?cid=267&amp;section_no=1&amp;unit_no=1&amp;preview=true&amp;course_type=paid&amp;unit_type=Video">Free Preview</a> of the courses by clicking on the green-coloured Free Preview button.</p><hr><h2 id="what-is-a-bearish-candlestick-pattern">What is a bearish candlestick pattern?</h2><p>A bearish candlestick pattern is a visual representation of price movement on a trading chart that suggests a potential downward trend or price decline in an asset.</p><p>It's formed by the arrangement of the candle's open, close, high, and low prices, creating a specific pattern that indicates selling pressure and a possible shift in market sentiment towards pessimism. Traders use these patterns to anticipate and make informed decisions about potential market downturns.</p><hr><h2 id="common-types-of-bearish-candlestick-patterns">Common types of bearish candlestick patterns</h2><p>You might have heard of patterns like the Bearish Engulfing, Evening Star, and more – they each signal potential price drops. These patterns are like clues that traders analyse to make informed decisions.</p><p>Let us see some common types of bearish candlestick patterns below.</p><h3 id="bearish-engulfing-pattern">Bearish Engulfing Pattern</h3><p>This occurs when a larger bearish candle fully engulfs the previous smaller bullish candle, suggesting a reversal from an uptrend to a potential downtrend.</p><p>You can see the same in the image below.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Bearish-Engulfing-Pattern.png" class="kg-image" alt="Bearish engulfing"><figcaption>Bearish engulfing</figcaption></figure><h3 id="evening-star-pattern">Evening Star Pattern</h3><p>Comprising three candles, the evening star pattern starts with a bullish candle, followed by a small-bodied or doji candle, and then a larger bearish candle. It signifies a potential reversal.</p><p>Here is an image to get a clear idea about an evening star pattern.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Bearish-evening-star-pattern.png" class="kg-image" alt="Evening star"><figcaption>Evening star</figcaption></figure><h3 id="shooting-star-pattern">Shooting Star Pattern</h3><p>A single candle with a long upper wick and a small body, indicating an unsuccessful attempt by buyers to push prices higher. It's often seen at the end of an uptrend.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Shooting-Star-Pattern.png" class="kg-image" alt="Shooting star"><figcaption>Shooting star</figcaption></figure><h3 id="dark-cloud-cover-pattern">Dark Cloud Cover Pattern</h3><p>Formed by two candles, this pattern starts with a bullish candle followed by a bearish candle that opens above the previous candle's high and closes below its midpoint, indicating potential selling pressure.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Dark-Cloud-Cover-Pattern.png" class="kg-image" alt="Dark cloud cover"><figcaption>Dark cloud cover</figcaption></figure><h3 id="hanging-man-pattern">Hanging Man Pattern</h3><p>Similar to the shooting star but appears at the end of a downtrend, the hanging man has a small body and a long lower wick, suggesting potential bullish reversal.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Hanging-Man-Pattern.png" class="kg-image" alt="Hanging man"><figcaption>Hanging man</figcaption></figure><hr><h2 id="key-factors-to-consider-when-identifying-bearish-patterns">Key factors to consider when identifying bearish patterns</h2><p>When identifying bearish candlestick patterns, several key factors play a pivotal role in accurate recognition and interpretation. These factors enhance your ability to distinguish potential price declines and make informed trading decisions. </p><p>Here are the key considerations:</p><h3 id="candle-body-and-wick-characteristics">Candle Body and Wick Characteristics</h3><p>Examine the size and position of the candle's body and wick. Long upper wicks and small bodies often indicate selling pressure and potential downward movement.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Candlestick.png" class="kg-image" alt="Candlestick"><figcaption>Candlestick</figcaption></figure><h3 id="volume-analysis">Volume Analysis</h3><p>Analyse the trading volume accompanying the pattern. Higher volume during a bearish pattern can strengthen the pattern's validity and potential impact and vice versa.</p><p>This can be seen in the image below.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Volume-Analysis.png" class="kg-image" alt="Volume analysis"><figcaption>Volume analysis</figcaption></figure><p>The values on the x-axis can be any variable, such as earnings per share (EPS), revenue, cash flow etc. This kind of column bar graphs are often used to depict trading volume. Usually, the graph appears in a panel below a security's or an asset’s price chart.</p><h3 id="support-and-resistance-levels">Support and Resistance Levels</h3><p>Consider the pattern's interaction with support and resistance levels. Patterns forming near these levels can have greater significance and impact.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Support-and-Resistance-Levels.png" class="kg-image" alt="Support and resistance levels"><figcaption>Support and resistance levels</figcaption></figure><p>By carefully observing these factors, you'll be better equipped to identify and confirm bearish patterns, leading to more confident trading decisions.</p><hr><h2 id="how-do-you-read-bearish-candlestick-patterns">How do you read bearish candlestick patterns?</h2><p>Reading bearish candlestick patterns involves analysing the visual formations on a price chart to understand potential downward price movements. </p><p>Here's a step-by-step guide on how to read bearish candlestick patterns:</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/How-do-you-read-bearish-candlestick-patterns.png" class="kg-image" alt="Reading bearish candlestick patterns "><figcaption>Reading bearish candlestick patterns&nbsp;</figcaption></figure><h3 id="step-1-identify-the-pattern">Step 1: Identify the Pattern</h3><p>Look for recognisable bearish patterns like Bearish Engulfing, Evening Star, Shooting Star, Dark Cloud Cover, and Hanging Man. These patterns consist of specific arrangements of candlesticks.</p><h3 id="step-2-check-the-trend">Step 2: Check the Trend</h3><p>Consider the prevailing trend. Bearish patterns are more significant when they appear after an uptrend, suggesting a potential reversal.</p><h3 id="step-3-examine-candle-characteristics">Step 3: Examine Candle Characteristics</h3><p>Focus on the candle's body and wick. A long upper wick and a small body indicate sellers' control and potential downward pressure.</p><h3 id="step-4-confirm-with-volume">Step 4: Confirm with Volume</h3><p>Analyse trading volume accompanying the pattern. Higher volume in the bearish candle pattern adds weight to the pattern's significance and potential impact.</p><h3 id="step-5-consider-support-and-resistance">Step 5: Consider Support and Resistance</h3><p>Look at the pattern's interaction with support and resistance levels. Patterns near these levels can have stronger implications.</p><h3 id="step-6-additional-indicators">Step 6: Additional Indicators</h3><p>When identifying bearish candlestick patterns, it's valuable to confirm the signals with other <a href="https://quantra.quantinsti.com/course/technical-indicators-strategies-python">technical indicators</a> like Moving Averages, Relative Strength Index (RSI), and MACD (Moving Average Convergence/Divergence). To code these confirmation indicators yourself, our tutorial on <a href="https://blog.quantinsti.com/build-technical-indicators-in-python/">technical analysis in Python</a> covers RSI, moving averages, ATR, and volume-based indicators step by step with full Python examples. These indicators provide additional insights into potential price declines and enhance the accuracy of your trading decisions.</p><h3 id="step-7-distinguish-false-signals">Step 7: Distinguish False Signals</h3><p>Keep in mind that not all patterns result in price declines. False signals can occur, especially in volatile markets, so additional confirmation is beneficial.</p><p>In order to bolster the reliability of bearish signals and mitigate the risk of false indications, traders can adopt a multifaceted approach to verification. This involves seeking convergence from multiple indicators and patterns that corroborate the bearish signal, particularly around significant support or resistance levels. </p><p>Moreover, observing higher trading volume during the pattern's emergence can provide broader market consensus, while consistency across various timeframes and the incorporation of supplementary indicators like trendlines or oscillators can fortify the bearish outlook. By waiting for confirmed price movement that aligns with the initial signal, traders can solidify their decisions with a more comprehensive perspective, ultimately leading to more informed and strategic trading outcomes.</p><h3 id="step-8-make-informed-decisions">Step 8: Make Informed Decisions</h3><p>Based on your analysis of the pattern, trend, volume, and supporting indicators, you can make informed trading decisions. This might involve short-selling, setting stop-loss levels, and planning entry and exit points.</p><hr><h2 id="what-are-bearish-indicators">What are bearish indicators?</h2><p>Bearish <a href="https://blog.quantinsti.com/technical-indicators-trading/">indicators</a> are tools or signals in technical analysis that suggest a potential downward price movement in a financial asset. These indicators help traders anticipate and identify market trends that might result in price declines. </p><p>Here are some common bearish indicators:</p><h3 id="moving-averages">Moving Averages</h3><p>When a shorter-term <a href="https://quantra.quantinsti.com/course/technical-indicators-strategies-python">moving average</a> crosses below a longer-term moving average (like the 50-day crossing below the 200-day), it can signal a potential weakness in the prices and vice versa.</p><p>You can see an example of moving averages below.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/MA.png" class="kg-image" alt="MA"><figcaption>MA</figcaption></figure><p>A simple interpretation of the chart:</p><ul><li>If the SMA line cuts the closing price line from above, it could imply that the price is rising, and we have a bull trend. This is also known as a bullish crossover. The green stars marked in this chart are all instances of a bullish crossover.</li><li>But if the SMA line cuts the closing price line from below, it implies that the price is decreasing and we have a bear trend. You can refer to this as the bearish crossover. The red stars marked in this chart are all instances of a bearish crossover.</li></ul><h3 id="relative-strength-index-rsi-">Relative Strength Index (RSI)</h3><p>An <a href="https://blog.quantinsti.com/rsi-indicator/">RSI value</a> above 70 indicates overbought conditions, suggesting that a potential reversal or price decline might be imminent.</p><p>You can see both RSI and close lines in the graph below.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Relative-Strength-Index--RSI-.png" class="kg-image" alt="RSI and close lines"><figcaption>RSI and close lines</figcaption></figure><p>In the chart above, red lines indicate both 14 days RSI plot and the levels for RSI,</p><p>while the blue line indicates the close price of the cryptocurrency BTC/USD. As discussed above, at around 30 RSI plot is indicating oversold conditions and at around 70, the plot is indicating overbought conditions.</p><p>These overbought and oversold indications shouldn’t be interpreted as direct buy/sell signals. Though, they can be a part of the signal generating decision process.</p><h3 id="moving-average-convergence-divergence-macd-">Moving Average Convergence Divergence (MACD)</h3><p>A bearish crossover between the <a href="https://blog.quantinsti.com/moving-average-trading-strategies/">MACD line</a> and the signal line could indicate a shift towards downward momentum. A bearish crossover is a technical analysis signal that occurs when one indicator crosses below another indicator on a price chart, suggesting a potential downward movement in the asset's price. It often indicates a shift in market sentiment from bullish to bearish.</p><p>Moving Average Bearish Crossover is one of the examples. This is how moving average bearish crossover works-</p><ul><li><strong>Indicators</strong>: A short-term moving average (e.g., 50-day) crosses below a longer-term moving average (e.g., 200-day).</li><li><strong>Interpretation</strong>: The crossover suggests that the asset's recent price performance is weakening compared to its historical performance. This could indicate a potential downtrend, and traders might consider this as a signal to enter short positions or take a more cautious approach.</li></ul><p>This example illustrates how a bearish crossover, such as a moving average crossover, can be used as a technical indicator to anticipate potential price declines and adjust trading strategies accordingly.</p><p>You can see the MACD signal in the graph below and what it indicates.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/MACD.png" class="kg-image" alt="MACD"><figcaption>MACD</figcaption></figure><p>In the graph above, when the blue line crosses above the orange line, long entry signals are generated.</p><p>In other words, when the MACD line crosses the signal line from above, a buy signal is generated.</p><p>Hence, buy when the MACD line &gt; Signal line.</p><h3 id="volume">Volume</h3><p>Increasing <a href="https://quantra.quantinsti.com/glossary/Traded-Volume">volume</a> during a downtrend can signify stronger selling pressure and validate a bearish trend.</p><p><strong>Example</strong></p><p>Suppose a trader-1 buys 1000 shares of Apple, the trader-2 buys 1500 shares of Apple and  trader-3 sells 1000 shares of Apple to a trader other than 1st and 2nd traders above, in a period of one hour. Then, the total traded volume for that stock in that one hour is 3500 shares. Simply put, Volume traded is the sum of all completed trades.</p><p>Volume is analysed by technical analysts to confirm the price trends by backing a price trend with a volume trend. Similarly, volume helps to confirm price reversals in case the prices move aggressively upwards or downwards.</p><h3 id="bearish-divergence">Bearish Divergence</h3><p>The bearish <a href="https://blog.quantinsti.com/divergence-trading/">divergence</a> occurs when the price of an asset makes higher highs, but an indicator (like RSI or MACD) makes lower highs. It suggests weakening upward momentum and a potential reversal.</p><p>There are two types of divergence, that is regular divergence and hidden divergence.</p><p><strong>Regular Bearish Divergence</strong></p><p>In case of Regular Bearish Divergence:</p><ul><li>The Indicator shows Lower Highs</li><li>Actual Market Price shows Higher Highs</li></ul><p><strong>Hidden Bearish Divergence</strong></p><p>In case of Regular Bearish Divergence:</p><ul><li>The Indicator shows Higher Highs</li><li>Actual Market Price shows Lower Highs</li></ul><p>You can see both Regular Divergence and Hidden Divergences in the graph below.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/Divergence.png" class="kg-image" alt="Regular Divergence and Hidden Divergences"><figcaption>Regular Divergence and Hidden Divergences</figcaption></figure><p>In the graph above, you can see that a Regular Divergence makes for a reversal in the trend and thus, the price moves down +-/-350 pips.</p><p>Also, it is visible that a Hidden Divergence makes for a continuation in the trend, which makes the price go up 400 pips and it goes on.</p><h3 id="chart-patterns">Chart Patterns</h3><p>Chart patterns like <a href="https://blog.quantinsti.com/head-shoulders-pattern/">Head and Shoulders</a>, Double Tops, and Rising Wedges can also act as bearish indicators when they break downward.</p><p>These indicators provide traders with additional insights to corroborate bearish signals derived from candlestick patterns or other forms of analysis. It's important to use a combination of indicators and analysis techniques to make well-informed trading decisions.</p><hr><h2 id="trading-strategies-for-bearish-candlestick-patterns">Trading Strategies for Bearish Candlestick Patterns</h2><p>Trading strategies for bearish candlestick patterns involve using these patterns as signals to generate returns from trading decisions during potential price declines. </p><p>Here are some effective strategies:</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2023/08/trading-strategies-bearish-patterns.jpeg" class="kg-image" alt="Trading strategies for bearish candlestick patterns"><figcaption>Trading strategies for bearish candlestick patterns</figcaption></figure><h3 id="short-selling-opportunities">Short-Selling Opportunities</h3><p>Take advantage of bearish patterns by engaging in short-selling. Borrow the asset, sell it at the current market price, and aim to buy it back later at a lower price so that you can generate returns from the price drop.</p><h3 id="setting-stop-loss-and-take-profit-levels">Setting Stop-Loss and Take-Profit Levels</h3><p>Determine specific price levels where you'll exit the trade to limit losses and secure maximum returns. This helps <a href="https://blog.quantinsti.com/tag/portfolio-risk-management/">manage risk</a> and prevents emotions from dictating your actions.</p><ul><li>Stop Loss – A stop-loss order limits an investor’s loss on a position in a security. It fires an order to square off the existing long or short position to avoid further losses and helps to take emotion out of trading decisions.</li><li>Take Profit – Take-profit orders are used to automatically close out existing positions in order to lock in profits when there is a move in a favourable direction.</li></ul><h3 id="confirmation-with-indicators">Confirmation with Indicators</h3><p>Combine the bearish candlestick patterns with other indicators like Moving Averages or RSI to validate the signals. When multiple indicators align, it strengthens the likelihood of a price decline.</p><h3 id="using-trendlines-and-channels">Using Trendlines and Channels</h3><p>Draw trendlines and channels on your chart to identify potential entry and exit points. When a bearish pattern forms near a trendline or channel resistance, it enhances the reliability of the signal.</p><h3 id="scale-in-strategy">Scale-In Strategy</h3><p>Instead of opening a full position at once, consider scaling in by entering the trade in multiple smaller parts. This allows you to manage risk and adjust your strategy as the trade progresses.</p><hr><h2 id="bearish-vs-bullish-candlestick-patterns">Bearish vs bullish candlestick patterns</h2><p>Now, let us see how bearish candlestick patterns are different from the <a href="https://blog.quantinsti.com/bullish-candlestick-patterns/">bullish candlestick patterns</a>.</p><!--kg-card-begin: html-->
<table>
<tbody>
<tr>
<td>
<h4><strong>Aspect</strong></h4>
</td>
<td>
<h4><strong>Bearish Candlestick Patterns</strong></h4>
</td>
<td>
<h4><strong>Bullish Candlestick Patterns</strong></h4>
</td>
</tr>
<tr>
<td>
<p>Direction</p>
</td>
<td>
<p>Suggests potential price decline</p>
</td>
<td>
<p>Suggests potential price rise</p>
</td>
</tr>
<tr>
<td>
<p>Market Sentiment</p>
</td>
<td>
<p>Indicates bearish sentiment</p>
</td>
<td>
<p>Indicates bullish sentiment</p>
</td>
</tr>
<tr>
<td>
<p>Formation</p>
</td>
<td>
<p>Significant when formed after uptrend</p>
</td>
<td>
<p>Significant when formed after downtrend</p>
</td>
</tr>
<tr>
<td>
<p>Examples</p>
</td>
<td>
<p>Bearish Engulfing, Evening Star, Shooting Star, Dark Cloud Cover, Hanging Man</p>
</td>
<td>
<p>Bullish Engulfing, Morning Star, Hammer, Piercing Line, Bullish Harami</p>
</td>
</tr>
<tr>
<td>
<p>Volume</p>
</td>
<td>
<p>Higher volume can confirm pattern</p>
</td>
<td>
<p>Higher volume can confirm pattern</p>
</td>
</tr>
<tr>
<td>
<p>Support/Resistance Levels</p>
</td>
<td>
<p>Patterns near these levels carry significance</p>
</td>
<td>
<p>Patterns near these levels carry significance</p>
</td>
</tr>
<tr>
<td>
<p>Confirmation</p>
</td>
<td>
<p>Use additional indicators for validation</p>
</td>
<td>
<p>Use additional indicators for validation</p>
</td>
</tr>
<tr>
<td>
<p>Reversal Indication</p>
</td>
<td>
<p>Suggests potential change to downtrend</p>
</td>
<td>
<p>Suggests potential change to uptrend</p>
</td>
</tr>
<tr>
<td>
<p>Trading Strategy</p>
</td>
<td>
<p>Short-selling, setting stop-loss levels for long trades and take-profit levels for short trades</p>
</td>
<td>
<p>Buying, setting stop-loss levels for short trades and take-profit levels for long trades</p>
</td>
</tr>
<tr>
<td>
<p>Risk Management</p>
</td>
<td>
<p>Crucial for managing potential losses</p>
</td>
<td>
<p>Crucial for managing potential losses</p>
</td>
</tr>
<tr>
<td>
<p>Profits</p>
</td>
<td>
<p>Seek to profit from price fall</p>
</td>
<td>
<p>Seek to profit from price rise</p>
</td>
</tr>
</tbody>
</table><!--kg-card-end: html--><p>Keep in mind that while these general characteristics apply to many candlestick patterns, each trade is unique, and other factors like market conditions, timeframe, and additional technical analysis tools should also be considered when making trading decisions.</p><hr><h2 id="pros-of-using-bearish-candlestick-patterns">Pros of using bearish candlestick patterns</h2><p>Using bearish candlestick patterns in trading offers several advantages for traders looking to make informed decisions during potential price declines:</p><ul><li>Early Warning Signs: Bearish patterns can provide early indications of potential downtrends, allowing traders to position themselves ahead of price declines and capture profit opportunities.<br></li><li>Enhanced Risk Management: Recognising bearish patterns helps traders set appropriate stop-loss levels, minimising potential losses by exiting long positions before significant price drops occur.<br></li><li>Versatility: Bearish patterns can be identified across various timeframes, making them suitable for day traders, swing traders, and long-term investors.<br></li><li>Confirmation with Indicators: Combining bearish patterns with technical indicators provides stronger confirmation of potential price declines, improving the accuracy of trading decisions.<br></li><li>Short-Selling Opportunities: Bearish patterns are particularly useful for traders interested in short-selling, where they can profit from falling prices by borrowing and selling assets.<br></li><li>Flexibility in Bullish Markets: Even during overall bullish trends, bearish patterns can help traders identify potential price corrections or temporary reversals, allowing them to capitalise on short-term opportunities.<br></li><li>Visual Clarity: Candlestick patterns offer a clear visual representation of market sentiment, making it easier for traders to interpret and act upon potential reversals.<br></li><li>Effective Entry Points: Bearish patterns can guide traders to optimal entry points for short positions, increasing the potential for profitable trades.<br></li><li>Use in Conjunction with Other Tools: Bearish patterns can be combined with other forms of technical analysis, such as trendlines, moving averages, and support/resistance levels, to refine trading strategies.<br></li><li>Continuous Learning: Mastering the art of identifying and trading bearish patterns encourages continuous learning and improvement, enhancing overall trading skills.</li></ul><p>By leveraging the advantages of bearish candlestick patterns, traders can gain a competitive edge in the market by making well-timed and informed trading decisions during potential price declines.</p><hr><h2 id="challenges-of-using-bearish-candlestick-patterns-and-how-to-overcome-them">Challenges of using bearish candlestick patterns and how to overcome them?</h2><!--kg-card-begin: html-->
<table>
<tbody>
<tr>
<td>
<h4><strong>Challenge</strong></h4>
</td>
<td>
<h4><strong>Explanation of Challenge</strong></h4>
</td>
<td>
<h4><strong>Ways to Overcome</strong></h4>
</td>
</tr>
<tr>
<td>
<p>False Signals</p>
</td>
<td>
<p>Bearish patterns can be the false signals and not actually the bearish signal.&nbsp;</p>
</td>
<td>
<p>For this, you can combine different indicators for confirmation. Also, you must wait for additional confirmation before acting. Moreover, you can use longer timeframes to reduce noise impact.</p>
</td>
</tr>
<tr>
<td>
<p>Market Conditions</p>
</td>
<td>
<p>Bearish patterns may be less reliable in volatile markets.</p>
</td>
<td>
<p>Adapt strategy based on market conditions to overcome this. Also, utilise wider stop-loss levels for volatility.</p>
</td>
</tr>
<tr>
<td>
<p>Pattern Variability</p>
</td>
<td>
<p>Differentiating valid and unreliable patterns is a challenge.</p>
</td>
<td>
<p>Focus on well-established, reliable patterns and prioritise patterns after prolonged trends. Lastly, you must rely on patterns showing clear bearish traits.</p>
</td>
</tr>
<tr>
<td>
<p>Subjectivity</p>
</td>
<td>
<p>Interpretation of patterns varies among traders.</p>
</td>
<td>
<p>Gain experience and refine pattern recognition. You must learn from experienced traders in communities. You also should use predetermined stop-loss and take-profit levels and stick to predefined rules for pattern recognition.</p>
</td>
</tr>
</tbody>
</table><!--kg-card-end: html--><p>By being aware of these challenges and applying the suggested strategies, traders can improve their ability to effectively use bearish candlestick patterns and navigate the complexities of the market.</p><hr><h3 id="conclusion">Conclusion</h3><p>In the ever-evolving landscape of trading, the mastery of understanding market dynamics is a prerequisite for success. Among the arsenal of skills at a trader's disposal, the art of reading and interpreting candlestick patterns holds unparalleled significance. Amidst these patterns, the bearish candlestick formations emerge as pivotal indicators, offering insights into potential price declines.</p><p>This comprehensive guide has embarked on an illuminating journey through the realm of bearish candlestick patterns.</p><p>Whether you're a seasoned trader refining your strategies or a newcomer aspiring for market mastery, this guide aims to equip you with the essential knowledge needed to navigate the intricate world of bearish candlestick patterns. Armed with these insights, you're poised to make more informed trading decisions, enhancing your ability to seize opportunities during the phase of bearish candlestick patterns.</p><h3 id="next-steps">Next Steps</h3><p>If you want to strengthen your understanding of candlestick patterns and apply them in trading strategies, the following resources can help you move from pattern recognition to practical implementation:</p><p><a href="https://www.quantinsti.com/articles/candlestick-patterns-meaning/" rel="noopener">Candlestick Patterns: How To Read Charts, Trading, and More</a> - Learn the basics of candlestick patterns and how to interpret price movements on charts.</p><p><a href="https://blog.quantinsti.com/bullish-candlestick-patterns/" rel="noopener">Bullish Candlestick Patterns</a> - Explore bullish patterns and understand how they differ from bearish signals.</p><p><a href="https://quantra.quantinsti.com/course/candlestick-patterns-automated-trading" rel="noopener">Candlestick Patterns based Automated Trading</a> - Learn how to build and implement trading strategies using candlestick patterns with Python.</p><p>Many traders begin by identifying individual candlestick patterns such as bearish engulfing or evening star. The next step is understanding how to combine these patterns with indicators and convert them into rule-based trading strategies.</p><h3 id="serious-about-learning">Serious about learning? </h3><p>For those looking to bridge this gap with a structured, practitioner-led approach, the <strong><a href="https://www.quantinsti.com/epat">Executive Programme in Algorithmic Trading</a> (EPAT)</strong> offers a natural next step. It focuses on a learn-by-coding approach to help traders transition from manual trading to automated trading.</p><p>Connect with an EPAT career counsellor to discuss the right quant role for your background.</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><hr><!--kg-card-begin: html--><p><em><small>Disclaimer: All data and information provided in this article are for informational purposes only. QuantInsti<sup>®</sup> makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information in this article and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages 	arising from its display or use. All information is provided on an as-is basis.</small></em></p><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Long Strangle Option Strategy In Python]]></title><description><![CDATA[For all the Options lover here is a guide to Option’s long strangle strategy with an easy to follow example. You can also learn how to design a payoff chart for this strategy using Python Programming.]]></description><link>https://www.quantinsti.com/articles/long-strangle-option-strategy-in-python/</link><guid isPermaLink="false">69b23ee874e6f000074e63f4</guid><category><![CDATA[Options Trading Strategies]]></category><dc:creator><![CDATA[MuniRaja Puthuru]]></dc:creator><pubDate>Mon, 16 Mar 2026 04:24:54 GMT</pubDate><content:encoded><![CDATA[<p>By <a href="https://www.quantinsti.com/">QuantInsti</a></p><p>Traders dealing in options enjoy the leverage of choosing the size of investment that they make and reducing the risk of losing a lot in the trading process. Options are believed to be cost-efficient and less risky in comparison to a lot of other instruments in the market.</p><p>What I like the most about Options trading is that there are numerous strategies that one can practice and follow. However, a lot of traders fail to understand <a href="https://www.quantinsti.com/articles/basics-options-trading/">options trading basics</a> and the range of strategies available at their disposal that best suits their trading style.</p><p>To name a few</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/03/Option-trading-strategies-1.jpg" class="kg-image" alt="Option trading strategies"></figure><p>Today, we are going to talk about the Long Strangle trading strategy.</p><h2 id="what-is-long-strangle-in-options-trading">What is ‘Long Strangle’ in Options trading?</h2><p>Long Strangle is one of the most popular <a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-basic">Options trading strategy</a> that allows the trader to hold a position in both call and put with the same expiration cycle but with the different strike price.</p><h3 id="strategy-highlights">Strategy highlights</h3><p>Moneyness of the options to be purchased:</p><ol><li>Out of the money put</li><li>Out of the money call option</li></ol><p>Profit Potential: Unlimited</p><p>Maximum Loss: Call Premium + Put Premium</p><p>Breakeven: Breakeven on the Upside = Strike Price + Call Premium + Put Premium</p><p>Breakeven on the Downside = Strike Price - Call Premium - Put Premium</p><h2 id="how-to-implement-this-strategy">How to implement this strategy?</h2><p>I will use Fortis Healthcare Ltd. (Ticker – NSE: FORTIS) option for this example. Traders benefit from a long strangle strategy if the underlying asset moves a lot, regardless of which way it moves. The same has been witnessed in the share price of Fortis if you have a look at the chart below:</p><p>Last 1-month stock price movement (source – Google Finance)</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/03/Fortis-stock-price-1.jpg" class="kg-image" alt="Fortis stock price"></figure><p>There has been a lot of movement in the stock price of Fortis, the highest being INR 157.30 and lowest being 114.20 in last 1 month. The current value being INR 138.90 as per Google Finance and an IV of 83.35%</p><p>For the purposes of this example; I will buy 1 out-of-the-money put and 1 out-of-the-money call Options.</p><p>Here is the option chain of Fortis for the expiry date of 22nd February 2018.</p><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/03/Fortis-Option-Chain-1.jpg" class="kg-image" alt="Fortis Option Chain"></figure><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/03/Fortis-call-chain-1.jpg" class="kg-image" alt="Fortis call chain"></figure><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/03/Fortis-put-chain-1.jpg" class="kg-image" alt="Fortis put chain"></figure><p>Source: <a href="https://www.nseindia.com/" rel="noopener">nseindia.com</a></p><p>I will pay INR 4 for the put with a strike price of INR 135 and INR 3.50 for the call with a strike price of INR 145. The options will expire on 22nd February 2018 and in order for me to make a profit out of it, there should be a substantial movement in the Fortis stock before the expiry.</p><p>The net premium paid to initiate this trade will be INR 7.50 hence the stock needs to move down to INR 127.5 on the downside or INR 152.50 on the upside before this strategy will break even. Considering the massive amount of volatility in the market due to various factors and taking into account the market recovery process from the recent downfall we can assume that there can be an opportunity to book a profit here.</p><h2 id="how-to-calculate-the-strategy-payoff-in-python">How to calculate the strategy payoff in Python?</h2><p>Now, let me take you through the Payoff chart using the Python programming code.</p><h3 id="importing-libraries">Importing libraries</h3><!--kg-card-begin: html--><pre><span style="font-weight: 400;">import numpy as np</span>
<span style="font-weight: 400;">import matplotlib.pyplot as plt</span>
<span style="font-weight: 400;">import seaborn</span></pre><!--kg-card-end: html--><h3 id="defining-parameters">Defining parameters</h3><!--kg-card-begin: html--><pre><span style="font-weight: 400;"># Fortis stock price </span>
<span style="font-weight: 400;">spot_price = 138.90</span>

<span style="font-weight: 400;"># Long put</span>
<span style="font-weight: 400;">strike_price_long_put = 135</span>
<span style="font-weight: 400;">premium_long_put = 4</span>

<span style="font-weight: 400;"># Long call</span>
<span style="font-weight: 400;">strike_price_long_call = 145 </span>
<span style="font-weight: 400;">premium_long_call = 3.50</span>

<span style="font-weight: 400;"># Stock price range at expiration of the put</span>
<span style="font-weight: 400;">sT = np.arange(0.7*spot_price,1.3*spot_price,1)</span></pre><!--kg-card-end: html--><h3 id="call-payoff">Call payoff</h3><p>We define a function that calculates the payoff from buying a call option. The function takes sT which is a range of possible values of the stock price at expiration, the strike price of the call option and premium of the call option as input. It returns the call option payoff.</p><!--kg-card-begin: html--><pre><span style="font-weight: 400;">def call_payoff(sT, strike_price, premium):</span>
<span style="font-weight: 400;">       return np.where(sT &gt; strike_price, sT - strike_price, 0) – premium</span>
<span style="font-weight: 400;">payoff_long_call = call_payoff(sT, strike_price_long_call, premium_long_call)</span>

<span style="font-weight: 400;"># Plot</span>
<span style="font-weight: 400;">fig, ax = plt.subplots()</span>
<span style="font-weight: 400;">ax.spines['bottom'].set_position('zero')</span>
<span style="font-weight: 400;">ax.plot(sT,payoff_long_call,label='Long Call',color='r')</span>
<span style="font-weight: 400;">plt.xlabel('Stock Price')</span>
<span style="font-weight: 400;">plt.ylabel('Profit and loss')</span>
<span style="font-weight: 400;">plt.legend()</span>
<span style="font-weight: 400;">plt.show()</span></pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/03/Long-Call-Payoff-1.jpg" class="kg-image" alt="Long Call Payoff"></figure><h3 id="put-payoff">Put payoff</h3><p>We define a function that calculates the payoff from buying a put option. The function takes sT which is a range of possible values of the stock price at expiration, the strike price of the put option and premium of the put option as input. It returns the put option payoff.</p><!--kg-card-begin: html--><pre><span style="font-weight: 400;">def put_payoff(sT, strike_price, premium):</span>
<span style="font-weight: 400;">      return np.where(sT &lt; strike_price, strike_price - sT, 0) – premium</span>
<span style="font-weight: 400;">payoff_long_put = put_payoff(sT, strike_price_long_put, premium_long_put)</span>

<span style="font-weight: 400;"># Plot</span>
<span style="font-weight: 400;">fig, ax = plt.subplots()</span>
<span style="font-weight: 400;">ax.spines['bottom'].set_position('zero')</span>
<span style="font-weight: 400;">ax.plot(sT,payoff_long_put,label='Long Put',color='g')</span>
<span style="font-weight: 400;">plt.xlabel('Stock Price')</span>
<span style="font-weight: 400;">plt.ylabel('Profit and loss')</span>
<span style="font-weight: 400;">plt.legend()</span>
<span style="font-weight: 400;">plt.show()</span></pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/03/Put-Payoff-1.jpg" class="kg-image" alt="Put Payoff"></figure><h3 id="strangle-payoff">Strangle payoff</h3><!--kg-card-begin: html--><pre><span style="font-weight: 400;">payoff_strangle = payoff_long_call + payoff_long_put</span>

<span style="font-weight: 400;">print ("Max Profit: Unlimited")</span>
<span style="font-weight: 400;">print ("Max Loss:", min(payoff_strangle))</span>

<span style="font-weight: 400;"># Plot</span>
<span style="font-weight: 400;">fig, ax = plt.subplots()</span>
<span style="font-weight: 400;">ax.spines['bottom'].set_position('zero')</span>

<span style="font-weight: 400;">ax.plot(sT,payoff_long_call,'--',label='Long Call',color='r')</span>
<span style="font-weight: 400;">ax.plot(sT,payoff_long_put,'--',label='Long Put',color='g')</span>

<span style="font-weight: 400;">ax.plot(sT,payoff_strangle,label='Strangle')</span>
<span style="font-weight: 400;">plt.xlabel('Stock Price')</span>
<span style="font-weight: 400;">plt.ylabel('Profit and loss')</span>
<span style="font-weight: 400;">plt.legend()</span>
<span style="font-weight: 400;">plt.show()</span></pre><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-width-full"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/03/Strangle-payoff.jpg" class="kg-image" alt="Strangle payoff"></figure><p>As you can see in the above Payoff plot the maximum anyone can lose is the total premium paid for holding both call and put positions i.e. INR 7.50 in my case. This is when the strike price falls between the two options that we have purchased at the time of its expiry.</p><p>On the other hand, there is no limit for the profit that you can gain once the stock price moves significantly in any direction.</p><p>In my next post, I will be talking about the ‘Bull Call Spread Strategy’</p><h3 id="download-data-file"><strong><strong>Download Data File</strong></strong></h3><ul><li>Option_Strangle_Strategy.ipynb</li></ul><!--kg-card-begin: markdown--><p><a href="https://www.quantinsti.com/articles/long-strangle-option-strategy-in-python" class="download-button button"> Visit blog to download </a></p><!--kg-card-end: markdown--><hr><h3 id="next-steps">Next Steps</h3><p>If you want to explore more options trading strategies and implement them using Python, the following resources can help you move from strategy concepts to practical implementation:</p><p><a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-basic" rel="noopener">Options Trading Strategies In Python: Basic</a> - Learn how common options strategies are structured and analyse their payoff using Python.</p><p><a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-intermediate" rel="noopener">Options Trading Strategies In Python: Intermediate</a> - Explore additional options strategies and analyse them using Python-based workflows.</p><p><a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-advanced" rel="noopener">Options Trading Strategies In Python: Advanced</a> - Work with more complex multi-leg strategies and quantitative analysis of options trades.</p><p>Many traders begin by learning individual strategies such as strangle and other options strategies. The next step is understanding how these strategies can be tested and implemented systematically.</p><h3 id="serious-about-learning">Serious about learning? </h3><p>For those looking to bridge this gap with a structured, practitioner-led approach, the <a href="https://www.quantinsti.com/epat"><strong>Executive Programme in Algorithmic Trading (EPAT)</strong></a> offers a natural next step. It focuses on a learn-by-coding approach to help traders transition from manual trading to automated trading.</p><p>Connect with an EPAT career counsellor to discuss the right quant role for your background.</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><hr><!--kg-card-begin: html--><p><em><small>Disclaimer:&nbsp;All investments and trading in the stock market involve risk. Any decisions to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.</small></em></p><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Trading Options: Iron Condor Trading Strategy In Python]]></title><description><![CDATA[The Iron Condor options trading strategy is a combination of the bull put spread options trading strategy and bear call spread options trading strategy.]]></description><link>https://www.quantinsti.com/articles/iron-condor-options-trading-strategy/</link><guid isPermaLink="false">69b242b174e6f000074e644d</guid><category><![CDATA[Options Trading Strategies]]></category><dc:creator><![CDATA[MuniRaja Puthuru]]></dc:creator><pubDate>Mon, 16 Mar 2026 04:24:49 GMT</pubDate><content:encoded><![CDATA[<p>By <a href="https://www.quantinsti.com/">QuantInsti</a></p><p>I have been trying to cover some of the simplest Option strategies including the Options Strangle Strategy and the Bull Call Spread Strategy which can be easily practised by traders who are new to Options. If you are new to options trading then you can check the <a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-basic" rel="noopener">options trading for dummies</a> free course on Quantra. This time I will cover the Iron Condor trading strategy.</p><p>Anyone who trades in Option is well aware that they are constantly fighting against time decay, especially when you are on the buy side. A lot of strategies that are being practised are designed with an objective to have the time factor work for them rather than the other way around. One such strategy that can make the time decay work in your favour is the ‘Iron Condor’.</p><h2 id="what-is-iron-condor-trading-strategy">What Is Iron Condor Trading Strategy?</h2><p>Iron Condor strategy is one of the simplest strategies that can be practised by traders even with a small account. For people who are familiar with other <a href="https://www.quantinsti.com/articles/basics-options-trading/">basic Option trading strategies</a>, Iron Condor strategy is basically a combination of the bull put spread and bear call spread Option trading strategy.</p><p>Another simpler explanation for those who are not aware of the above-mentioned strategies is that Iron Condor strategy is a four-legged trade that starts with selling out-of-the-money put and selling out-of-the-money call for the same underlying security and expiration date. The trader will hope that the stock price stays between these positions at the time of its expiration. But shorting options can involve a lot of risks and any unfavourable situation can result in a tremendous loss. Hence, to protect this risk the trader buys further out-of-the-money put and call, these four options are together called as Iron Condor strategy.</p><p>It is important to understand that Iron Condor strategy is a limited risk strategy and works best in a stable market with low volatility which can help the trader to earn limited profits.</p><h2 id="strategy-characteristics">Strategy Characteristics</h2><h3 id="moneyness-of-the-options-">Moneyness of the options:</h3><p>Sell 1 OTM Put (Higher Strike) Sell 1 OTM Call (Lower Strike) Buy 1 OTM Put (Lower Strike) Buy 1 OTM Call (Higher Strike)</p><p><strong>Maximum Profit</strong>: Net Premium Received</p><p><strong>Maximum Loss</strong>:</p><p>Strike Price of Long Call - Strike Price of Short Call - Net Premium Received or Strike Price of Short Put - Strike Price of Long Put - Net Premium Received whichever is higher</p><p><strong>Breakeven:</strong></p><p>Upper side: Strike Price of Short Call + Net Premium Received Lower side: Strike Price of Short Put - Net Premium Received</p><h2 id="how-does-this-strategy-work">How does this strategy work?</h2><p>Let us assume that a stock ABC is trading at a price of INR 100, to execute an Iron Condor trading strategy we will: Sell 80 Strike Put for INR 2.5 Sell 120 Strike Call for INR 2.5</p><p>With a hope that the price will remain within these two strike prices that we booked so that we make a profit. But, due to the risk of unlimited loss, we would protect our positions by: Buy 60 Strike Put for INR 1 Buy 140 Strike Call for INR 1</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/1-300x239.png" class="kg-image" alt="Call Strike and Put"></figure><p>Collectively these four positions will form the Iron Condor for us:</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/2-300x132.png" class="kg-image" alt="Formation of Iron Condor"></figure><h2 id="how-to-implement-this-strategy">How to implement this strategy?</h2><p>Let us see how we can execute this strategy in a live market scenario.</p><p>For this, I will take the Option for Yes Bank Limited (Ticker – YESBANK) with an expiration date of 28th March 2018 and the current stock price of INR 323.40</p><p>Last 1-month stock price movement (source – Google Finance)</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/3.png" class="kg-image" alt="1-month stock price movement"></figure><p>Here is the option chain of YESBANK for the expiry date of 28th March 2018.</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/4.png" class="kg-image" alt="Option Chain"></figure><p>I will be taking the following positions: Sell 350 Call at INR 3.30 Sell 300 Put at INR 3.40 Buy 370 Call at INR 1.30 Buy 280 Put at INR 1.20</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/5.png" class="kg-image" alt="Call Options"></figure><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/6.png" class="kg-image" alt="Put Options"></figure><p>Source: nseindia.com</p><h3 id="maximum-profit-">Maximum Profit:</h3><p>In case the stock doesn’t bounce much and stays between my booked positions i.e. between the price of INR 300 and INR 350. My payoff will be as follows:</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/7-300x166.png" class="kg-image" alt="Max Profit"></figure><p>So we made money on the initial positions that we booked by Selling the options but we lost them on the positions that we booked for protection. The total payoff turns out to be positive on 4.2 points.</p><h3 id="maximum-loss-">Maximum Loss:</h3><p>Let’s assume that there is a major volatility or the market bumps due to an uncertain event and made the stock to go up to INR 390. So this means that the positions booked as long and short put is out of the money for us. Here is how the payoff will look like in this scenario:</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/8-300x165.png" class="kg-image" alt="Max Loss"></figure><p>We made INR 3.4 on the short put and lost INR 1.2 on the long put. The short call is 40 points in the money so we made a loss of INR 36.7 (3.30 – 40) and the long call is 20 points in the money which made us INR 18.7 (20 – 1.30). The total tally brings us to a loss of INR 15.8. Remember, the long call that we bought for protection helped us to minimize our loss on the total trade.</p><p>Another important thing to note is that this is the maximum we can lose on this trade no matter how far or low the stock goes.</p><p>Now let’s see how will be the payoff for a series of underlying price:</p><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/9-1.png" class="kg-image" alt="Payoff chart"></figure><p><strong>We will now use the <a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-basic" rel="noopener">Python code </a>to show you the payoff summary:</strong></p><h2 id="import-libraries">Import Libraries</h2><!--kg-card-begin: html--><pre>import numpy as np
import matplotlib.pyplot as plt
import seaborn</pre><!--kg-card-end: html--><h3 id="call-payoff">Call Payoff</h3><!--kg-card-begin: html--><pre>def call_payoff(sT, strike_price, premium):
return np.where(sT &gt; strike_price, sT - strike_price, 0) – premium<br># Stock price
spot_price = 323.40<br># Long call
strike_price_long_call = 370
premium_long_call = 1.30<br># Short call
strike_price_short_call = 350
premium_short_call = 3.30<br># Stock price range at expiration of the call
sT = np.arange(0.5*spot_price,2*spot_price,1)

<strong>payoff_long_call = call_payoff(sT, strike_price_long_call, premium_long_call)</strong>

fig, ax = plt.subplots()
ax.spines['bottom'].set_position('zero')
ax.plot(sT,payoff_long_call,label='Long 370 Strike Call',color='g')
plt.xlabel('Stock Price')
plt.ylabel('Profit and loss')
plt.legend()
#ax.spines['top'].set_visible(False) # Top border removed
#ax.spines['right'].set_visible(False) # Right border removed<br>#ax.tick_params(top=False, right=False) # Removes the tick-marks on the RHS
plt.grid()
plt.show()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/10.png" class="kg-image" alt="Strike Call"></figure><!--kg-card-begin: html--><pre><strong>payoff_short_call = call_payoff(sT, strike_price_short_call, premium_short_call) * -1.0</strong>

fig, ax = plt.subplots()
ax.spines['bottom'].set_position('zero')
ax.plot(sT,payoff_short_call,label='Short 350 Strike Call',color='r')
plt.xlabel('Stock Price')
plt.ylabel('Profit and loss')
plt.legend()
plt.grid()
plt.show()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/11.png" class="kg-image" alt="Strike Call"></figure><h3 id="put-payoff">Put Payoff</h3><!--kg-card-begin: html--><pre>def put_payoff(sT, strike_price, premium):
return np.where(sT &lt; strike_price, strike_price - sT, 0) – premium<br># Stock price
spot_price = 323.40<br># Long put
strike_price_long_put = 280
premium_long_put = 1.20<br># Short put
strike_price_short_put = 300
premium_short_put = 3.40<br># Stock price range at expiration of the put
sT = np.arange(0.5*spot_price,2*spot_price,1)

<strong>payoff_long_put = put_payoff(sT, strike_price_long_put, premium_long_put)</strong>

fig, ax = plt.subplots()
ax.spines['bottom'].set_position('zero')
ax.plot(sT,payoff_long_put,label='Long 280 Strike Put',color='y')
plt.xlabel('Stock Price')
plt.ylabel('Profit and loss')
plt.legend()
plt.grid()
plt.show()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/12.png" class="kg-image" alt="Short Put"></figure><!--kg-card-begin: html--><pre><strong>payoff_short_put = put_payoff(sT, strike_price_short_put, premium_short_put) * -1.0</strong>

fig, ax = plt.subplots()
ax.spines['bottom'].set_position('zero')
ax.plot(sT,payoff_short_put,label='Short 300 Strike Put',color='m')
plt.xlabel('Stock Price')
plt.ylabel('Profit and loss')
plt.legend()
plt.grid()
plt.show()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/13.png" class="kg-image" alt="Strike Put"></figure><h3 id="iron-condor-strategy-payoff">Iron Condor Strategy Payoff</h3><!--kg-card-begin: html--><pre><strong>payoff = payoff_long_call + payoff_short_call + payoff_long_put + payoff_short_put</strong>

fig, ax = plt.subplots()
ax.spines['bottom'].set_position('zero')
ax.plot(sT,payoff_long_call,'--',label='Long 370 Strike Call',color='g')
ax.plot(sT,payoff_short_call,'--',label='Short 350 Strike Call',color='r')
ax.plot(sT,payoff_long_put,'--',label='Long 280 Strike Put',color='y')
ax.plot(sT,payoff_short_put,'--',label='Short 300 Strike Put',color='m')
ax.plot(sT,payoff,label='Iron Condor')
plt.xlabel('Stock Price')
plt.ylabel('Profit and loss')
plt.legend()
plt.grid()
plt.show()</pre><!--kg-card-end: html--><figure class="kg-card kg-image-card"><img src="https://d1rwhvwstyk9gu.cloudfront.net/2018/04/14.png" class="kg-image" alt="Iron Condor"></figure><h3 id="download-python-code">Download Python Code</h3><ul><li>Iron Condor Trading Strategy Python Code File</li></ul><!--kg-card-begin: markdown--><p style="text-align: center;"><a href="https://www.quantinsti.com/articles/iron-condor-options-trading-strategy" class="download-button button"> Visit blog to download </a></p><!--kg-card-end: markdown--><hr><h3 id="next-steps">Next Steps</h3><p>If you want to explore more options trading strategies and implement them using Python, the following resources can help you move from strategy concepts to practical implementation:</p><p><a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-basic" rel="noopener">Options Trading Strategies In Python: Basic</a> - Learn how common options strategies are structured and analyse their payoff using Python.</p><p><a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-intermediate" rel="noopener">Options Trading Strategies In Python: Intermediate</a> - Explore additional options strategies and analyse them using Python-based workflows.</p><p><a href="https://quantra.quantinsti.com/course/options-trading-strategies-python-advanced" rel="noopener">Options Trading Strategies In Python: Advanced</a> - Work with more complex multi-leg strategies and quantitative analysis of options trades.</p><p>Many traders begin by learning individual strategies such as Iron Condor and other multi-leg options strategies. The next step is understanding how these strategies can be tested and implemented systematically.</p><h3 id="serious-about-learning">Serious about learning? </h3><p>For those looking to bridge this gap with a structured, practitioner-led approach, the <a href="https://www.quantinsti.com/epat"><strong>Executive Programme in Algorithmic Trading (EPAT)</strong></a> offers a natural next step. It focuses on a learn-by-coding approach to help traders transition from manual trading to automated trading.</p><p>Connect with an EPAT career counsellor to discuss the right quant role for your background.</p><!--kg-card-begin: html--><div class="calendly-inline-widget" data-url="https://calendly.com/counsellor-1/speak-to-epat-counsellors?month=2025-04&embed_type=Inline&hide_gdpr_banner=1" style="min-width:320px;height:630px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script><!--kg-card-end: html--><hr><!--kg-card-begin: html--><p><em><small>Disclaimer:&nbsp;All investments and trading in the stock market involve risk. Any decisions to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.</small></em></p><!--kg-card-end: html-->]]></content:encoded></item></channel></rss>