<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rajeev Upadhye on Medium]]></title>
        <description><![CDATA[Stories by Rajeev Upadhye on Medium]]></description>
        <link>https://medium.com/@rajeevupadhye?source=rss-fb442a6185d0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*btuaEzuSZxYV5Ju-.</url>
            <title>Stories by Rajeev Upadhye on Medium</title>
            <link>https://medium.com/@rajeevupadhye?source=rss-fb442a6185d0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 20:19:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajeevupadhye/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[*Overfitting: A Guilt-Free Approach to Short-Term Market Predictions*
 — Rajeev Upadhye, Jan 2025]]></title>
            <link>https://rajeevupadhye.medium.com/overfitting-a-guilt-free-approach-to-short-term-market-predictions-rajeev-upadhye-jan-2025-5600f8451a6c?source=rss-fb442a6185d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5600f8451a6c</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Rajeev Upadhye]]></dc:creator>
            <pubDate>Tue, 04 Mar 2025 05:53:59 GMT</pubDate>
            <atom:updated>2025-03-04T05:53:59.264Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>*Overfitting: A Guilt-Free Approach to Short-Term Market Predictions*</strong><br> — Rajeev Upadhye, Jan 2025</p><p>In the world of financial markets, where chaos reigns and unpredictability is the norm, traditional machine learning wisdom often falls short. One such piece of wisdom — the avoidance of overfitting — may not always hold true, especially when it comes to short-term market predictions. In fact, overfitting can be a powerful tool when used strategically. Here’s why.</p><p><strong>### *Markets as Chaotic Systems*</strong><br>Financial markets are quintessential examples of chaotic systems. They are highly sensitive to initial conditions and influenced by a myriad of variables, many of which are unpredictable. Factors such as breaking news, geopolitical events, and shifts in investor sentiment can cause sudden and dramatic changes in market behavior.<br>While long-term predictions in such systems are notoriously difficult, short-term predictions can be more feasible. Over shorter time frames, the system’s behavior is less likely to diverge drastically, making it possible to capture temporary patterns. However, even short-term predictions are fraught with challenges due to the inherent noise and randomness in the data.</p><p><strong>### *Generality vs. Accuracy in Short-Term Predictions*</strong><br>In machine learning, generality — the ability of a model to perform well on unseen data — is often prized. For stable systems or long-term predictions, this is crucial, as the model must adapt to changing conditions over time. However, in the context of short-term market predictions, accuracy on the training data (or recent data) often takes precedence over generality.<br>Short-term market movements are frequently driven by specific, recent patterns that are unlikely to persist over the long term. In such cases, a model that captures these temporary patterns with high accuracy can be more valuable than one that generalizes well but fails to capture the nuances of the current market environment.</p><p><strong>### *The Case for Single-Use Models and Overfitting*</strong><br>Single-use models, which are trained for a specific, narrow purpose or time period, can be particularly effective in rapidly changing markets. These models are designed to capture the most recent patterns, making them well-suited for short-term predictions.<br>Overfitting, traditionally seen as a cardinal sin in machine learning, can actually be beneficial in this context. When the goal is to maximize accuracy on the training data — such as recent market data — overfitting can help the model capture the underlying patterns with high precision. A high R-squared value on the training data indicates that the model is performing exceptionally well on the data it was trained on, which is exactly what you want for short-term predictions.<br>Moreover, if the cost of training new models is low — thanks to readily available data and inexpensive computational resources — continuously updating or retraining models to reflect the latest market conditions becomes a viable strategy. This approach allows you to stay agile and adapt to the ever-changing market landscape.</p><p><strong>### *When Overfitting is Not a Problem*</strong><br>Overfitting becomes a problem only under certain conditions:<br>- *When the model needs to generalize to unseen data:* In long-term predictions or stable systems, generality is key, and overfitting can lead to poor performance on new data.<br>- *When the cost of retraining or updating models is high:* If computational resources are limited or data is scarce, the cost of constantly retraining models may outweigh the benefits of overfitting.<br>However, in the context of short-term market predictions, where the focus is on accuracy and the cost of training is low, overfitting can be a reasonable and even advantageous trade-off.</p><p><strong>### *Additional Considerations*</strong><br>While overfitting can be a useful tool, it’s important to approach it with caution and rigor:<br>- *Model Evaluation:* Even if overfitting is acceptable, it’s crucial to evaluate models rigorously. Techniques such as walk-forward validation or rolling-window backtesting can help ensure that the model’s performance remains consistent over time.<br>- *Risk Management:* Accuracy is only one part of the equation in trading. Effective risk management — such as position sizing and stop-losses — is equally important. Even a highly accurate model can lead to losses if not managed properly.<br>- *Adaptability:* Markets evolve, and patterns change. Ensure that your models can be quickly adapted or replaced as market conditions shift. Staying flexible is key to maintaining an edge in the market.</p><p><strong>### *Conclusion: Overfitting is Not Necessarily Bad*</strong><br>In the specific context of short-term market predictions, overfitting can be a powerful strategy. When the goal is to maximize accuracy on recent data and the cost of training new models is low, overfitting allows you to capture the nuances of the current market environment with precision. By embracing overfitting — guilt-free — you can gain a competitive edge in the chaotic world of financial markets. Just remember to evaluate your models rigorously, manage risk effectively, and stay adaptable as market conditions evolve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5600f8451a6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Effect of Lunations on Stock Returns]]></title>
            <link>https://rajeevupadhye.medium.com/the-effect-of-lunations-on-stock-returns-cf15a302ed31?source=rss-fb442a6185d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf15a302ed31</guid>
            <category><![CDATA[stocks]]></category>
            <dc:creator><![CDATA[Rajeev Upadhye]]></dc:creator>
            <pubDate>Tue, 11 Jul 2023 05:55:48 GMT</pubDate>
            <atom:updated>2023-07-11T05:55:48.097Z</atom:updated>
            <content:encoded><![CDATA[<p>- Rajeev Upadhye July 2023</p><p>I was always haunted by the question — if lunations (phases of the Moon) have any effect on stock market returns? I attempted to answer this some time ago. But that experiment design was flawed and I had discarded it.</p><p>Interestingly I asked the following question to three AIs — ChatGPT, Bard, Perplexity AI</p><p><strong><em>“Is there any research on the effect of lunations on stock market returns?”</em></strong></p><p>Here are the answers -</p><p><strong>ChatGPT </strong>— “As of my last knowledge update in September 2021, there was no widely accepted scientific evidence or research supporting a direct causal relationship between lunar cycles or lunations (the phases of the moon) and stock market returns. While the idea of lunar cycles influencing human behavior or financial markets has been the subject of speculation and folklore, it lacks robust empirical support.”</p><p><strong>Bard</strong> — “Yes, there has been some research on the effect of lunations on stock market returns. One study, published in the Harvard Business Review in 2009, found that annualized mean daily returns in G7 countries were higher around new moons than full moons. The study looked at data from 25 stock exchanges over the past 30 years and found that returns were two to three times higher during new moons in every single G7 country.</p><p>Another study, published in the Journal of Business Finance &amp; Accounting in 2012, found that there was a significant positive correlation between stock market returns and the lunar cycle. The study looked at data from the S&amp;P 500 index over the past 50 years and found that returns were higher during the waxing phase of the moon than during the waning phase.”</p><p><strong>Perplexity AI</strong> — “Yes, there is some research on the effect of lunar cycles on stock market returns. Some studies have shown that moon phases affect returns, while others have found no correlation. For example, a 20-year study by the University of Lausanne showed that trading strategies based on the full moon and lunar cycles outperformed the overall market by an average of 3.3% per year.”</p><p>So in light of the above, I was motivated to investigate this issue once again.</p><p>I used the following scan in ChartAlert to calculate rolling 3 days returns for each trading day from Jan 1, 2021-</p><pre>&#39;NewMoonFullMoon<br>List data from &quot;01-Jan-2021&quot;<br>Add Column Roc(3) as ROC format 0.000<br>Export to CSV c:\R Projects\nmfm.csv<br>Apply to SYMBOLS NIFTY</pre><p>I decided to use ~two years of data for this experiment. The market data was acquired from NSE and the lunation data was generated in “R” using the “lunar” package.</p><pre>library(lunar)<br>library(lubridate)<br>library(BSDA)<br>graphics.off()<br>setwd(&quot;C:/R Projects&quot;)<br># Get then three day returns from ChartAlert<br>sl &lt;- read.csv(&quot;nmfm.csv&quot;, stringsAsFactors = FALSE)<br>current_date &lt;- Sys.Date()<br># Calculate the start and end dates of the period<br>start_date &lt;- as.Date(&quot;2021–01–01&quot;)<br>end_date &lt;- current_date<br># Calculate the moon phases in the period<br>moon_phases &lt;- lunar.phase(seq(start_date, end_date, by = &quot;day&quot;), name = T)<br># Create a table of the results<br>table &lt;- data.frame(<br>date = seq(start_date, end_date, by = &quot;day&quot;),<br>moon_phase = moon_phases<br>)</pre><p>For each trading day, the lunar phase was assigned using the following code -</p><pre>lu &lt;- na.omit(subset(table,table$date %in% sl$Date))<br>sl$mp &lt;- lu$moon_phase</pre><p>Box plot was plotted to visualize the distribution of returns on Full moon and New moon days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*pEUn5-IvRV38anYMoHDB8Q.png" /></figure><p>We notice the mean of the Full moon returns is negative and the mean of the New moon returns is positive. Box sizes are indicative of the volatility (higher volatility around Full moons and lower volatility on New moons).</p><p>As the no of observations is more than 30 for each lunation, a Z test was done to see if the means are statistically different-</p><pre>z.test(sl$ROC[sl$mp ==&quot;Full&quot;],sl$ROC[sl$mp ==&quot;New&quot;], <br>       sigma.x = sd(sl$ROC[sl$mp ==&quot;Full&quot;]), sigma.y = sd(sl$ROC[sl$mp ==&quot;New&quot;]))<br><br>The results of the Z test are as follows -<br>Two-sample z-Test<br>data:  sl$ROC[sl$mp == &quot;Full&quot;] and sl$ROC[sl$mp == &quot;New&quot;]<br>z = -2.81, p-value = 0.004954<br>alternative hypothesis: true difference in means is not equal to 0<br>95 percent confidence interval:<br> -1.1617192 -0.2070333<br>sample estimates:<br> mean of x  mean of y <br>-0.1326780  0.5516983<br></pre><p><strong>Conclusion </strong>— The difference in mean returns on the New moon and Full days is statistically significant as p &lt; 0.05.</p><p>What is most interesting is that the “Lunation Effect” persists despite the majority of the trading being done by algos!</p><p>Ref:</p><p>1. <a href="https://www.quantifiedstrategies.com/full-moon-moon.../">https://www.quantifiedstrategies.com/full-moon-moon.../</a></p><p>2. <a href="https://escholarship.org/uc/item/70z5b0ng">https://escholarship.org/uc/item/70z5b0ng</a></p><p>3. <a href="https://www.jstor.org/stable/43503349">https://www.jstor.org/stable/43503349</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf15a302ed31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are the chances that a stock will give desired returns?]]></title>
            <link>https://rajeevupadhye.medium.com/what-are-the-chances-that-a-stock-will-give-desired-returns-44e32fb62461?source=rss-fb442a6185d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/44e32fb62461</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[probability]]></category>
            <dc:creator><![CDATA[Rajeev Upadhye]]></dc:creator>
            <pubDate>Sun, 09 Jan 2022 03:50:44 GMT</pubDate>
            <atom:updated>2022-01-20T02:35:54.870Z</atom:updated>
            <content:encoded><![CDATA[<p>- Rajeev Upadhye, Jan 2022</p><p>When a stock shows “unusual” price movement it becomes volatile and it leaves a footprint on volume. If this unusual price movement is positive then some thing positive or good is cooking up and the news is leaked to some chosen individuals and they passed it to their circle. The relative increase in volume indicates that the buyers are CONFIDENT about the future performance of the stock. The more authentic is the news or the information, the buying continues over a couple of trading sessions giving impetus to the price and attracting more buyers.</p><p>But how does one decide that the price movement is unusual?</p><p>The answer lies in the deviation of the price from mean price relative to standard deviation. So mathematically this can be stated as -</p><p><strong>Close — mean(look back period) / standard deviation(look back period)</strong></p><p>Lets call the above ratio as “Magnitude of Sudden buying interest (MSBI)” to keep the idea simple.</p><p>Now if the price deviation from mean is twice of the std dev then the price movement is treated “unusual” or “significant “ or worthy of attention.</p><p>I would like to demonstrate this with a stock recently. I bought “RAJESHEXPO” when it showed MSBI &gt;= 2 on the daily time frame. Now I want to know what are chances that this stock will give me 8–10% in a month?</p><p>To do this analysis, I used the following scan in ChartAlert to generate basic data. Also I have set the look back period equal to 20 which roughly 1 trading month-</p><p><strong>set var MSBI = (close — sma(20))/stddev(20)</strong></p><p><strong>List data from “01-Jan-2010”</strong></p><p><strong>Add Column MSBI as MSBI</strong></p><p><strong>Add Column ROC(20) as ROC20</strong></p><p><strong>Export to CSV c:\R Projects\hatrstd.csv</strong></p><p><strong>Apply to SYMBOLS RAJESHEXPO</strong></p><p>Pls note that this generates the historical data on daily time frame for 12 years! So it is quite exhaustive…</p><p>The following “R” code calculates the probability of the stock giving 8% or more returns in a months time! (Note — If MSBI is calculated on a higher time frame then the buying interest is more significant!)</p><p><strong>sm &lt;- read.csv(“hatrstd.csv”, stringsAsFactors = FALSE)</strong></p><p><strong>sm &lt;- na.omit(sm)</strong></p><p><strong>hist(lead(sm$ROC20[sm$MSBI &gt;=2],20), breaks =25, main=”Historical distribution of returns\n after 20 days from unusual buying”, xlab=”%Returns”)</strong></p><p><strong>x &lt;- table(sm$MSBI&gt;=2 )</strong></p><p><strong>print(“No of Events of significant buying interest”)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*1Fgewe0L45RcRhsGrm5aMg.png" /></figure><p><strong>print(x[2])</strong></p><p><strong>TRUE</strong></p><p><strong>256</strong></p><p><strong>y &lt;- table(sm$ROC20[sm$MSBI&gt;=2]&gt;=8 )</strong></p><p><strong>print(“No of Events of future returns &gt;= 8%”)</strong></p><p><strong>print(y[2])</strong></p><p><strong>TRUE</strong></p><p><strong>143</strong></p><p><strong>print(“Probability of the stock giving expected returns in 20 days”)</strong></p><p><strong>100*y[2]/x[2]</strong></p><p><strong>TRUE</strong></p><p><strong>55.85938</strong></p><p>So the probability is ~56%! Interestingly the stock was up 5.5% on the third day of buying. There are good chances that it will go up further as the market is expected to rally before the Union Budget.</p><p>Update Jan 20, 2021</p><p>PS. — Two days ago I exited RAJESHEXPO in just two weeks for the profit of 12%. Rest of the stocks are doing well as per expectations. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44e32fb62461" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cluster analysis for identifying stocks with buying interest!]]></title>
            <link>https://rajeevupadhye.medium.com/cluster-analysis-for-identifying-stocks-with-buying-interest-bc63b4f5872b?source=rss-fb442a6185d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc63b4f5872b</guid>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[cluster-ana]]></category>
            <category><![CDATA[stocks]]></category>
            <dc:creator><![CDATA[Rajeev Upadhye]]></dc:creator>
            <pubDate>Mon, 26 Apr 2021 08:56:03 GMT</pubDate>
            <atom:updated>2021-04-26T08:56:03.620Z</atom:updated>
            <content:encoded><![CDATA[<p>Rajeev Upadhye, April 2021</p><p>Since I dabbled into data science, I wrestled with “cluster analysis” for quite some time. I had a strong belief that stocks could be classified in clusters with properties such ashigh or low momentum, so that the stocks that have high momentum could give expected returns in desired period!</p><p>Only recently I could find a method to approach this problem using a well known technique in machine learning called ‘Cluster Analysis’.</p><p>Please note the entire ball game of finding high probability or high momentum stocks revolves around buying interest of bigplayers (aka smart money) and it reflects in v o l u m e, period!</p><p>When we classify volume in a given observational period ( 5wk in this study) in two types — a. buy volume b. sell volume</p><p>Buy volume candles are green and sell volume candles are red on candle stick/candle/volume charts.</p><p>Therefore ratio of Buy volume to total volume is a good indicator of buying interest when greater than 0.5. When buy volume percentage is greater than equal to 70 then we can say that the stock has gained reasonably high momentum.</p><p>I did a study to check if there is any significant relationship between buying interest and rate of change in a given period (here 5 wk period) and there is a significant and linear relationship which is evident from the following graph (top)!</p><p>The red line is a regression line with R- sqaured 0.39 and correlation coefficient = 0.62. The relationship is significant with p-value: &lt; 2.2e-16!</p><p>In the first graph below , you will notice that the green dots represent the stocks that have buy volume percentage greater than equal to 70! It is very clear from the above chart that most of the stocks have 5 wk rate of change more than zero. Those which are in the bottom right quadrant have negative rate of change. It simply means that they are attracting buying intrest and soon they will pick up!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*752kO8ug4PyFLuta" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*DRWV5LVgfyu_GNqg" /></figure><p>Now that we have identified a fairly good buying region, we can do further hair splitting with K-means clustering. Visual inspection of these clusters suggests approximate four bands</p><p>Green band — ROC 20 and above</p><p>Red band — 0 &lt;= ROC &lt;= 20</p><p>Blue band — -10 &lt;= ROC &lt;= 0</p><p>Black band ROC &lt;= -10</p><p>In a trending market as buying continues buying volume % will increase and ROC will also increase for most of the stocks in red cluster and they will move to green cluster. Therefore, stocks in red zone offer an edge!</p><p>Like</p><p>Comment</p><p>Share</p><h4>0 Comments</h4><p>Active</p><p>Write a public comment…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc63b4f5872b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Investor Confidence Index?]]></title>
            <link>https://rajeevupadhye.medium.com/what-is-investor-confidence-index-812956ebeb58?source=rss-fb442a6185d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/812956ebeb58</guid>
            <category><![CDATA[stocks]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Rajeev Upadhye]]></dc:creator>
            <pubDate>Fri, 16 Apr 2021 05:56:37 GMT</pubDate>
            <atom:updated>2021-04-27T03:49:24.460Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first wrote on Price Deviation Profile, I formulated a simple metric that quantified sentiments of investors and traders. The idea is essentially very simple but powerful.</p><p>Let’s consider the following chart -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*4hwXse89BzrKb2JtMRYCEQ.png" /></figure><p>The price has closed above the red line more no. of times than below during the period of observation. The red line is 5 day simple moving average. We all know that the stock is bullish when it is above its mean price and it is bearish when below its mean price. In the above example, the stock is above the 5 day simple moving average for most of the time during the observational period. Hence we can conclude that the investor confidence is very high!</p><p>Lets take another example of a hypothetical stock. In the observational period, the stock is above mean price (red line) for 4 days and below the mean price for 6 days and hence investor confidence is low.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*t7p0ir4Pp_LSABUcE53mYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*D0LowIZHvxl7gGvofTe3Gw.png" /></figure><p>In the second example above, the price is above the mean for six days and below for the four days.</p><p>Now we are in a position to define investor confidence index as -</p><p>= No of days price was above refrence price / No of days price was below reference price</p><p>In the above example reference price here is mean of 10 day prices!</p><p><strong>How does Investor Confidence Index help in trading decisions?</strong></p><p>Lets calculate ICI for a stock for a fairly long period say 10 years for different reference prices, say EMA15, EMA30, EMA50 and EMA100.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*cq9Dbt3LuOEir-tDT_lBdA.png" /></figure><p>From the above table we can infer easily that generally Hindustan Lever prices stay above EMAs considered above. So in case the price comes down below any particular EMA then one can expect it to bounce back. In fact onecan easily estimate the approximate time required for the price to come above reference price (EMA).</p><p>Lets explain this with an example. Let x be the average no of days price stayed above EMA10 and y be the average no of days price was below EMA10 then</p><p>x + y = 10 and x / y = 1.23</p><p>therefore x = 1.23 y</p><p>y + 1.23y = 10</p><p>2.23 y = 10</p><p>y = 4.484</p><p>x = 10–4.484 = 5.516</p><p>So if the stock has been trading below for 4 days for EMA10 you can expect it to take support and bounce back quickly!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=812956ebeb58" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Price Deviation Profile of Stocks]]></title>
            <link>https://rajeevupadhye.medium.com/price-deviation-profile-of-stocks-a75f8b67e30a?source=rss-fb442a6185d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a75f8b67e30a</guid>
            <category><![CDATA[moving-average]]></category>
            <category><![CDATA[stocks]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[price-movement]]></category>
            <dc:creator><![CDATA[Rajeev Upadhye]]></dc:creator>
            <pubDate>Sun, 28 Feb 2021 05:05:28 GMT</pubDate>
            <atom:updated>2021-04-03T09:19:32.796Z</atom:updated>
            <content:encoded><![CDATA[<p>© Rajeev Upadhye, February, 2021 <br>Email — upadhye.rajeev@gmail.com</p><p><strong>Introduction</strong></p><p>Price Deviation Profile (PDP) is a technique developed by me to determine if recent price movement of a stock is normal or abnormal. Abnormal price movements do NOT sustain. Therefore, determining nature of a price movement objectively becomes extremely important in making trading decisions. When a stock attracts our attention for buying then our mind is often crowded by questions such as -</p><ul><li>what is the chance that the stock will hit target price</li><li>what is the general sentiment about a stock</li><li>whether current movement of a stock is sustainable</li><li>whether current movement of a stock is normal or abnormal</li></ul><p>When I recently developed a technique to find stocks that are attracting smart money based purely on OHLC data considering information from three time frames(daily, weekly and monthly), I realized that these were some questions left unanswered. This motivated me to the development of <strong>Price Deviation Profile.</strong></p><p>You should be familiar with the concepts of standard deviation, moving averages, histograms to understand this technique.</p><p><em>Note — So far in my literature survey I have not come across any idea similar to this technique. But if you have come across same or similar idea then please share the details with exact reference. I will be happy to acknowledge the same in future updates of this document.</em></p><p><strong>Visual representations — their power and limitations</strong></p><p>Visual representations of data can be most powerful when they are simple and elegant. Charting techniques currently in vogue that help to assess nature of price movements are primarily a. moving averages and b. standard deviation channels ( a combination of these is seen in Bollinger bands). However, these techniques have limitations due to visual representations they use. For example, a moving average merely tells whether a stock is strong or weak with reference to a specific price often calculated by a moving average method of an individual’s choice. However, when you go on adding moving averages to your charts then they get cluttered and it makes decision making extremely difficult. Similarly, standard deviation channels can be confusing because their appearance changes with their range selected and also due to other chart elements. Add to all this headache of zooming in and out and scrolling charts frequently back and forth.</p><p><strong>What is “Normal Price Movement” and Normal Price Deviation?</strong></p><p><em>If price of a stock falls within 1 standard deviation from mean price then it is called as normal price movement.</em> Beyond it the stock is considered over priced or under priced. Here mean price is calculated over a given range and this idea is used in standard deviation channel.</p><p>Normal Price Deviation is an extension of the idea of Normal Price Movement.</p><p>However, to determine if price deviation is normal with respect to given moving average, price deviations with respect to the specific moving average is calculated historically in percentage.</p><p><strong>Price deviation with respect to moving average = 100 *( Price — Moving average(period))/ Moving average(period)</strong></p><p><strong>How Price Deviation is determined?</strong></p><p>First we calculate price deviation data for several EMA values. Typically, these values are EMA(15), EMA(30), EMA(50) and EMA(100). For exploration I have taken EMA(10), EMA(20) etc.</p><p>All the data is calculated from using the following scan in ChartAlert for NIFTY. The range is Jan 01, 2010 to Feb 26, 2021.</p><blockquote><strong><em>List data from “01-Jan-2010”</em></strong></blockquote><blockquote><strong><em>Add Column 100*(Close — EMA(10))/EMA(10) as devema10</em></strong></blockquote><blockquote><strong><em>Add Column 100*(Close — EMA(15))/EMA(15) as devema15</em></strong></blockquote><blockquote><strong><em>Add Column 100*(Close — EMA(20))/EMA(20) as devema20</em></strong></blockquote><blockquote><strong><em>Add Column 100*(Close — EMA(25))/EMA(25) as devema25</em></strong></blockquote><blockquote><strong><em>Add Column 100*(Close — EMA(30))/EMA(30) as devema30</em></strong></blockquote><blockquote><strong><em>Add Column 100*(Close — EMA(50))/EMA(50) as devema50</em></strong></blockquote><blockquote><strong><em>Add Column 100*(Close — EMA(100))/EMA(100) as devema100</em></strong></blockquote><blockquote><strong><em>Export to CSV c:\R Projects\pricedev.csv</em></strong></blockquote><blockquote><strong><em>Apply to SYMBOLS NIFTY</em></strong></blockquote><p>The results of the above scan look like this -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*Vgm9nYZpb0J-oqHXIEvsiQ.png" /></figure><p>From this data we can now plot histograms or <strong>Price Deviation Profiles</strong> for EMA(15), EMA(30), EMA(50) and EMA(100). These histograms once created tell a very powerful and interesting story of stock pricing.</p><p>Price deviation with respect to EMA(100) was max (= +15.17%) on Jan 12, 2021 and minimum (= -32.94%) on March 23, 2020.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DFqOxcqJA3D6QY_HEjHoyQ.png" /><figcaption>Maximum Negative NIFTY deviation from EMA(100)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*DnyiFXG3LDL55x21hCxRhA.png" /><figcaption>Maximum Positive NIFTY deviation from EMA(100)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pr9i4T_OUtgu3SQx_PsBTg.png" /><figcaption>Price Deviation profile for NIFTY based on the last 10 years data</figcaption></figure><p>The red line shows the deviation of current price for a given EMA. The blue lines are plotted at 1SD (Standard Deviation) on both sides of the mean (reference price indicated by moving average). First we will take the histogram for EMA(100) in the following figure (second row and second column ).</p><p>Here no of bars to the right of zero (1941) are more than no of bars to the left of zero (829). This means that NIFTY normally stays above EMA(100). The red line is still to the left of right blue line means price deviation with respect to EMA(100) is more than 1SD and hence some more correction can not be ruled out.</p><p>However, this correction may occur after some pull back and the reason for the pullback may be found in the histogram for Price deviations with respect to EMA(15). In this histogram, the red line (current price deviation) is to the left of blue line (-1 SD) to the right of zero.</p><p>Lets now take few more stocks for the discussion of this technique. For this purpose I am taking stocks suggested by Smart Money Foot Print Strategy © as of Feb 26, 2021. These are listed in the table below -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*A-VRZ_hb9EzjyjCpQvocNw.png" /></figure><p>NLCINDIA is topping the list but potential upside is ~8% only. So we will choose the next in the list, i.e., ELGIEQUIP.</p><p>Price Deviation profile for this stock is shown below -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQ1CbY-H6mhNyoJZRsDWkg.png" /></figure><p>You will immediately notice that the current price (red line) is to the right of blue line (+1SD), i.e., beyond one standard deviation on all four histograms. Hence it is over priced for all EMAs and therefore it is likely to correct in the immediate future. So it is prudent to wait for some time before taking position.</p><p>Lets take next stock suggested by Smart Money Foot Print Strategy. The stock is GMDCLTD. Price deviation profile shows the following picture -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xZaFfauSyNKVacSyscoHug.png" /></figure><p>Again it is clear that the stock is over priced.</p><p>Lets take example of KNRCON. The stock is showing some correction with respect to EMA(15) which may confirmed on candle stick chart. But it is over priced with respect to EMA(100). However pricing with respect to EMA(30) and EMA(50) is normal. Please note that KNRCON was above most of the time. So general sentiment of this stock is very positive. No harm in taking position for this immediately for the target upside of 10.36%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j0Pesbl8SgnSDZ_1bbRNgg.png" /></figure><p>In fact, here I am tempted to hypothesize that <strong>the stocks that stay above EMA(100) more number of times compared to their stay below EMA(100) historically are generally fundamentally good companies with strong investor/trader confidence</strong>. I would like to test this hypothesis sometime in future.</p><p><strong>Conclusion</strong></p><p>Price Deviation profiles compress and summarize very large historical price deviation information and deviation of price at a given moment with respect to specific moving average price in very small space elegantly.</p><p>Price Deviation profiles help to determine whether a stock is normally priced, over priced or under priced with reference to chosen price such as moving average.</p><p>This condensed information helps to draw several conclusions about the immediate future of a stock.</p><p>Positional traders, swing traders can greatly benefit from Price Deviation Profiles of stocks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a75f8b67e30a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>