{"id":104,"date":"2013-04-23T12:18:00","date_gmt":"2013-04-23T12:18:00","guid":{"rendered":"http:\/\/zerodha.com\/z-connect\/?p=271"},"modified":"2024-02-02T15:56:54","modified_gmt":"2024-02-02T10:26:54","slug":"algoz-trading-systems","status":"publish","type":"post","link":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems","title":{"rendered":"Trading Systems"},"content":{"rendered":"<p style=\"text-align: left;\"><a class=\"l\" href=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/algoz_logo.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"348\" height=\"74\" class=\"size-full wp-image-550 aligncenter\" alt=\"algoZ_logo.jpg\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/algoz_logo.jpg\" srcset=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/algoz_logo.jpg 348w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/algoz_logo-300x63.jpg 300w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">Beginners, don&#8217;t worry if you don&#8217;t understand when you read this manual. We will explain how to code your technical analysis strategy in the &#8220;<a href=\"https:\/\/zerodha.com\/z-connect\/blog\/view\/code-your-technical-analysis-strategy\">Code your strategy<\/a>&#8221; section.<\/p>\n<h3>Trading systems<\/h3>\n<p style=\"text-align: left;\">A trading system is basically a set of rules that determine entry and exit points for any given stock. Traders often refer to these points as trade signals.<\/p>\n<p style=\"text-align: left;\">A trading system is objective and mechanical. The purpose is to provide a strategy to produce profits greater than losses by controlling your trades for you.<\/p>\n<p style=\"text-align: left;\">This chapter provides hands-on learning by teaching the trader how to translate Trading System rules into script form using real trading systems as examples.<\/p>\n<p style=\"text-align: left;\">Trading Systems usually include one or more technical indicators in their implementation. For example, a Moving Average Crossover system would buy when a short-term moving average crosses above a long-term moving average and sell when a short-term moving average crosses below a long-term moving average.<\/p>\n<p style=\"text-align: left;\">Trading Systems may have any number of rules, such as don&#8217;t buy unless volume is trending upwards, or exit if Parabolic SAR crosses the close, etc.<\/p>\n<p style=\"text-align: left;\">The actual profitability of a Trading System depends on how well the Trading System&#8217;s rules perform on a trade-by-trade basis. Traders spend much of their time optimizing their trading systems in order to increase profits and reduce risks.<\/p>\n<p style=\"text-align: left;\">In the case of a basic Moving Average Crossover system, this is accomplished by modifying the parameters of the moving averages themselves.<\/p>\n<p style=\"text-align: left;\">A trader may optimize a Trading System by means of backtesting. The backtesting feature of NEST Pulse allows you to backtest your trading systems and modify parameters to achieve the maximum amount of profit and minimum amount of risk.<\/p>\n<p style=\"text-align: left;\"><strong>MOVING AVERAGE CROSSOVER SYSTEM<br \/>\n<\/strong><\/p>\n<p style=\"text-align: left;\">The Moving Average Crossover System is perhaps the simplest of all trading systems. This system uses two moving averages to generate signals. A buy signal is generated when a short-term moving average crosses over a long term moving average, and sells when a short-term moving average crosses below a long-term moving average.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1077\" title=\"Moving Average Crossover\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/10\/img_526619f23f1a5.png\" width=\"779\" height=\"349\" \/><\/p>\n<p style=\"text-align: left;\">The number of signals generated by this trading system is proportional to the length and type of moving averages used. Short-term moving averages generate more signals and enter into trades sooner than longer-term moving averages. Unfortunately, a very short-term moving average crossover system will also generate more false signals than a longer-term system, while a very long-term system will generate fewer false signals, but will also miss a larger proportion of profits. This difficult balance applies to nearly every trading system and is the core subject of numerous books on technical analysis.<\/p>\n<p style=\"text-align: left;\">One solution to this problem is to use a secondary technical indicator to confirm entry and\/or exit signals. A popular technical indicator used primarily for exit signals is the Parabolic SAR. The following script uses a 20\/60 EMA for entries and a Parabolic SAR for exits.<\/p>\n<p style=\"text-align: left;\"><strong>Moving Average Crossover System Script <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># 20-period EMA crosses over the 60-period EMA<\/p>\n<pre style=\"text-align: left;\">CROSSOVER(EMA(CLOSE, 20), EMA(CLOSE, 60))<\/pre>\n<p style=\"text-align: left;\">Sell Signals<\/p>\n<p style=\"text-align: left;\"># 20-period EMA crosses under the 60-period EMA<\/p>\n<pre style=\"text-align: left;\">CROSSOVER(EMA(CLOSE, 60), EMA(CLOSE, 20))<\/pre>\n<p style=\"text-align: left;\">Exit Long<\/p>\n<p style=\"text-align: left;\"># The close crosses above the Parabolic SAR<\/p>\n<pre style=\"text-align: left;\">CROSSOVER(CLOSE, PSAR(CLOSE, 0.02, 0.2))<\/pre>\n<p style=\"text-align: left;\">Exit Short<\/p>\n<p style=\"text-align: left;\"># The close crosses below the Parabolic SAR<\/p>\n<pre style=\"text-align: left;\">CROSSOVER(PSAR(CLOSE, 0.02, 0.2), CLOSE)<\/pre>\n<p style=\"text-align: left;\"><strong>Sample Script 1 (For Bullish Markets) <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># 10-period EMA crosses over the 30-period EMA and a positive MACD<\/p>\n<pre style=\"text-align: left;\">(EMA(CLOSE,10) &gt; EMA(CLOSE,30)) AND (MACD(6,12,9,EXPONENTIAL) &gt; 0)<\/pre>\n<p style=\"text-align: left;\">Exit Long<\/p>\n<p style=\"text-align: left;\"># 30-period EMA crosses over the 10-period EMA and a negative MACD<\/p>\n<pre style=\"text-align: left;\">(EMA(CLOSE,10) &lt; EMA(CLOSE,30)) AND (MACD(6,12,9,EXPONENTIAL) &lt; 0)<\/pre>\n<p style=\"text-align: left;\"><strong>Sample Script 2 (For Bullish Markets) <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># A combination of Simple moving average,MACD and stochastic.<\/p>\n<pre style=\"text-align: left;\">(SMA(CLOSE,2) &gt; SMA(CLOSE,10)) AND MACD(6,12,9,SIMPLE) &gt; 0 AND (SOPK(9, 3, 9, SIMPLE) &gt; 80 OR SOPD(9, 3, 9, SIMPLE) &gt; 80)<\/pre>\n<p style=\"text-align: left;\">Exit Long<\/p>\n<p style=\"text-align: left;\"># A combination of Simple moving average,MACD and stochastic<\/p>\n<pre style=\"text-align: left;\">(SMA(CLOSE,2) &lt; SMA(CLOSE,10)) AND MACD(6,12,9,SIMPLE) &lt; 0 AND (SOPK(9, 3, 9, SIMPLE) &lt; 20 OR SOPD(9, 3, 9, SIMPLE) &lt; 20)<\/pre>\n<p style=\"text-align: left;\"><strong>Price Gap System <\/strong><\/p>\n<p style=\"text-align: left;\">An upward price gap occurs when a stock opens substantially higher than the previous day\u00e2\u20ac\u2122s high price. This often occurs after an unexpected announcement, much better than expected earnings report, and so forth.<\/p>\n<p style=\"text-align: left;\">A large number of buy orders are executed when the market opens. During this time the price may be exaggerated as investors may be buying the stock simply because it shows strength at the opening.<\/p>\n<p style=\"text-align: left;\">The price often retreats to fill the gap once orders stop coming in and the demand for the stock subsides. The key to this trading system is that reversals usually occur during the first hour of trading. In other words, if the gap is not filled during the first hour then we may assume that buying will continue.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1084\" title=\"Price Gap Ups\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/10\/img_52661cdcc3913.png\" width=\"773\" height=\"342\" \/><\/p>\n<p style=\"text-align: left;\">This trading system is often more successful if volume is around twice the fiveday average of volume.<\/p>\n<p style=\"text-align: left;\">Example: The script returns securities that have gapped up by 2% and closed near the high. When the market opens on the following day, the strategy would be to buy stock after the first hour of trading if the strength sustained.<\/p>\n<p style=\"text-align: left;\">A stop-loss order would be set at the day&#8217;s low. A conservative profit objective would normally be half the percentage of the gap, or 1% in this case.<\/p>\n<p style=\"text-align: left;\"><strong>Price Gap Script <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># A 2% gap up in price over the previous day on high volume<\/p>\n<pre style=\"text-align: left;\">LOW &gt;REF(HIGH,1) * 1.02 AND VOLUME &gt; SMA(VOLUME, 5) * 2<\/pre>\n<p style=\"text-align: left;\">Sell Signals<\/p>\n<p style=\"text-align: left;\"># A 2% gap down in price over the previous day on high volume<\/p>\n<pre style=\"text-align: left;\">HIGH &lt;REF(LOW,1) * 0.98 AND VOLUME &gt; SMA(VOLUME, 5) * 2<\/pre>\n<p style=\"text-align: left;\">Exit Long<\/p>\n<p style=\"text-align: left;\">Use a profit objective roughly \u00bd the size of the gap with a stop-loss.<\/p>\n<p style=\"text-align: left;\">Exit Short<\/p>\n<p style=\"text-align: left;\">Use a profit objective roughly \u00bd the size of the gap with a stop-loss.<\/p>\n<p style=\"text-align: left;\"><strong>Bollinger Bands System <\/strong><\/p>\n<p style=\"text-align: left;\">Bollinger bands are similar to moving averages except they are shifted above and below the price by a certain number of standard deviations to form an envelope around the price.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1086\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/10\/img_52661dba03da3.png\" \/><\/p>\n<p style=\"text-align: left;\">Unlike a Moving Average or a Moving Average Envelope, Bollinger bands are calculated in such a way that allows them to widen and contract based on market volatility. Prices usually stay contained within the bands. One strategy is to buy or sell after the price touches and then retreats from one of the bands. A move that originates at one band usually tends to move all the way to the other band. Another strategy is to buy or sell if the price goes outside the bands. If this occurs, the market is likely to continue in that direction for some length of time. The Bollinger band trading system outlined in this example uses a combination of both trading strategies. The system buys if a recent bar touched the bottom band and the current bar is within the bands, and also buys if the current high has exceeded the top band by a certain percentage. The system sells based on the opposite form of this strategy.<\/p>\n<p style=\"text-align: left;\"><strong>Bollinger Bands Script <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># Buy if a previous value was below the low band and is now above<\/p>\n<pre style=\"text-align: left;\">SET Bottom = BBB(CLOSE, 20, 2, EXPONENTIAL)<\/pre>\n<pre style=\"text-align: left;\">SET Top = BBT(CLOSE, 20, 2, EXPONENTIAL)<\/pre>\n<pre style=\"text-align: left;\">((REF(CLOSE, 1) &lt; REF(Bottom, 1)) AND CLOSE &gt; Bottom) OR<\/pre>\n<p style=\"text-align: left;\"># Also buy if the close is above the top band plus 2%<\/p>\n<pre style=\"text-align: left;\">CLOSE &gt; Top * 1.02<\/pre>\n<p style=\"text-align: left;\">Sell Signals<\/p>\n<p style=\"text-align: left;\"># Sell if a previous value was above the high band and is now below<\/p>\n<pre style=\"text-align: left;\">SET Bottom = BBB(CLOSE, 20, 2, EXPONENTIAL)<\/pre>\n<pre style=\"text-align: left;\">SET Top = BBT(CLOSE, 20, 2, EXPONENTIAL)<\/pre>\n<pre style=\"text-align: left;\">((REF(CLOSE, 1) &gt; REF(Top, 1)) AND CLOSE &lt; Top) OR<\/pre>\n<p style=\"text-align: left;\"># Also sell if the close is below the bottom band minus 2%<\/p>\n<pre style=\"text-align: left;\">CLOSE &lt; Bottom * 0.98<\/pre>\n<p style=\"text-align: left;\"><strong>Historical Volatility and Trend <\/strong><\/p>\n<p style=\"text-align: left;\">This trading system buys or sells on increasing volume and lessening volatility.<\/p>\n<p style=\"text-align: left;\">The concept is that trends are more stable if volatility has been decreasing and volume has been increasing over many days.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1091\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/10\/img_526621bda0234.png\" \/><\/p>\n<p style=\"text-align: left;\">Volume is an important component to this trading system since almost every important turning point in a stock is accompanied by an increase in volume.<\/p>\n<p style=\"text-align: left;\">The key element in this trading system is the length of the primary price trend.<\/p>\n<p style=\"text-align: left;\">The longer the price trend is, the more reliable the signal.<\/p>\n<p style=\"text-align: left;\">Also try experimenting with this trading system by substituting the TREND function for volume with the Volume Oscillator function, or the Volume Rate of Change function.<\/p>\n<p style=\"text-align: left;\"><strong>Historical Volatility and Trend Script <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># Buy if volatility is decreasing and volume is increasing with price in an uptrend<\/p>\n<pre style=\"text-align: left;\">HistoricalVolatility(CLOSE, 15, 252, 2) &lt; REF(HistoricalVolatility(CLOSE, 15, 365, 2), 15) AND TREND(VOLUME, 5) = UP AND TREND(CLOSE, 40) = UP<\/pre>\n<p style=\"text-align: left;\"># Sell if volatility is decreasing and volume is increasing with price in a downtrend<\/p>\n<pre style=\"text-align: left;\">HistoricalVolatility(CLOSE, 15, 252, 2) &lt; REF(HistoricalVolatility(CLOSE, 15, 365, 2), 15) ANDTREND(VOLUME, 5) = UP AND TREND(CLOSE, 40) = DOWN<\/pre>\n<p style=\"text-align: left;\"><strong>Parabolic SAR \/ MA System <\/strong><\/p>\n<p style=\"text-align: left;\">This system is a variation of a standard moving average crossover system. Normally a Parabolic SAR is used only as a signal for exit points, however in this trading system we use the crossover of two exponential moving averages to decide if we should buy or sell whenever the Parabolic SAR indicator crosses over the close.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1104\" title=\"Parabolic SAR\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/10\/img_52662b59baa7b.png\" width=\"769\" height=\"312\" \/><\/p>\n<p style=\"text-align: left;\">The Parabolic SAR can be used in the normal way after the trade has been opened. Profits should be taken when the close crosses the Parabolic SAR.<\/p>\n<p style=\"text-align: left;\">This example shows how to use Boolean logic to find securities that match the condition either for the current trading session or the previous trading day.<\/p>\n<p style=\"text-align: left;\"><strong>Parabolic SAR \/ MA Script <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># Buy if the Mas crossed today or yesterday and<\/p>\n<p style=\"text-align: left;\"># if the PSAR crossed today or yesterday<\/p>\n<pre style=\"text-align: left;\">FIND STOCKS WHERE (CROSSOVER(CLOSE, PSAR(0.02, 0.2)) OR CROSSOVER(REF(CLOSE,1), PSAR(0.02, 0.2))) AND (CROSSOVER(EMA(CLOSE, 10), EMA(CLOSE, 20)) OR CROSSOVER(REF(EMA(CLOSE, 10),1), REF(EMA(CLOSE, 20),1)))<\/pre>\n<p style=\"text-align: left;\">Sell Signals<\/p>\n<p style=\"text-align: left;\"># Sell if the Mas crossed today or yesterday and<\/p>\n<p style=\"text-align: left;\"># if the PSAR crossed today or yesterday<\/p>\n<pre style=\"text-align: left;\">FIND STOCKS WHERE (CROSSOVER(PSAR(0.02, 0.2), CLOSE) OR CROSSOVER(PSAR(0.02, 0.2), REF(CLOSE,1))) AND (CROSSOVER(EMA(CLOSE, 20), EMA(CLOSE, 10)) OR CROSSOVER(REF(EMA(CLOSE, 20),1), REF(EMA(CLOSE, 10),1)))<\/pre>\n<p style=\"text-align: left;\"><strong>MACD Momentum System <\/strong><\/p>\n<p style=\"text-align: left;\">In this trading system we use an exponential moving average and the TREND function to identify market inertia, and we use the Moving Average Convergence \/ Divergence (MACD) indicator to detect market momentum.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1105\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/10\/img_52662ea7ac2cb.png\" \/><\/p>\n<p style=\"text-align: left;\">As you may know, the MACD indicator reflects the change of power between traders who are on the long side and traders who are on the short side. When the trend of the MACD indicator goes up, it indicates that the market is predominated by bulls, and when it falls, it indicates that bears have more influence. This is known as market momentum. This system buys when both inertia (a TREND of the EMA) and momentum (the MACD) are both in favor of rising prices. The system sells when the reverse is true. Exit signals are generated whenever either signal turns to the opposite direction.<\/p>\n<p style=\"text-align: left;\"><strong>MACD Momentum Script <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># Buy if both momentum and inertia are favourable<\/p>\n<pre style=\"text-align: left;\">TREND(EMA(CLOSE, 20), 15) = UP AND TREND(MACD(13, 26, 9, SIMPLE), 5) = UP<\/pre>\n<p style=\"text-align: left;\">Sell Signals<\/p>\n<p style=\"text-align: left;\"># Sell if both momentum and inertia are favorable<\/p>\n<pre style=\"text-align: left;\">TREND(EMA(CLOSE, 20), 15) = DOWN AND TREND(MACD(13, 26, 9, SIMPLE), 5) = DOWN<\/pre>\n<p style=\"text-align: left;\">Exit Long Signal<\/p>\n<p style=\"text-align: left;\"># Exit if either momentum or inertia become unfavorable<\/p>\n<pre style=\"text-align: left;\">TREND(EMA(CLOSE, 20), 15) = DOWN OR TREND(MACD(13, 26, 9, SIMPLE), 5) = DOWN<\/pre>\n<p style=\"text-align: left;\">Exit Short Signal # Exit if either momentum or inertia become unfavorable.<\/p>\n<pre style=\"text-align: left;\">TREND(EMA(CLOSE, 20), 15) = UP OR TREND(MACD(13, 26, 9, SIMPLE), 5) = UP<\/pre>\n<p style=\"text-align: left;\"><strong>Narrow Trading Range Breakout<\/strong><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1136\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/10\/img_526658ba82419.png\" \/><\/p>\n<p style=\"text-align: left;\">Stocks that remain bound by narrow trading ranges often tend to continue in the direction of their breakout. That is to say, if a stock remains in a narrow range between $40 and $45 for an extended period then breaks above $50, it is likely to continue rising for the foreseeable future. The premise being that the longer a stock remains in a tight range, the more difficult it is becomes to breakout of the trading range. Therefore when the breakout occurs, the uptrend should continue.<\/p>\n<p style=\"text-align: left;\"><strong>Narrow Trading Range Script <\/strong><\/p>\n<p style=\"text-align: left;\"># Define a 2% trading range over 50 days<\/p>\n<pre style=\"text-align: left;\">FIND STOCKS WHERE<\/pre>\n<pre style=\"text-align: left;\">MAX(CLOSE, 50) &lt; CLOSE * 1.01 AND<\/pre>\n<pre style=\"text-align: left;\">MIN(CLOSE, 50) &gt; CLOSE * 0.98 AND<\/pre>\n<p style=\"text-align: left;\"># Filter out inactive securities<\/p>\n<pre style=\"text-align: left;\">CLOSE != REF(CLOSE, 1) AND<\/pre>\n<pre style=\"text-align: left;\">REF(CLOSE,1) != REF(CLOSE, 2) AND<\/pre>\n<pre style=\"text-align: left;\">REF(CLOSE,2) != REF(CLOSE, 3)<\/pre>\n<p style=\"text-align: left;\"><strong>Outside Day System <\/strong><\/p>\n<p style=\"text-align: left;\">An Outside Day occurs when the current bar&#8217;s high price is higher than the previous bar&#8217;s high price, and the current bar&#8217;s low price is lower than the previous bar&#8217;s low price. The close must be opposite of the trend (if the trend is up, the close must be lower than the open). Outside days occur frequently and may be used as part of a short term trading strategy.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1146\" title=\"Outside Dat System\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/10\/img_5266616954a3b.png\" width=\"774\" height=\"345\" \/><\/p>\n<p style=\"text-align: left;\">Outside days that occur after a strong uptrend\u00a0 indicate market indecision, and may signal a reversal or temporary correction in price.<\/p>\n<p style=\"text-align: left;\">Depending on market direction, outside days can be either bullish or extremely bearish. If the reversal occurs at the stock&#8217;s resistance level, it is interpreted as bearish. If it occurs at the stock&#8217;s support level, it is interpreted as bullish.<\/p>\n<p style=\"text-align: left;\"><strong>Outside Day Script <\/strong><\/p>\n<p style=\"text-align: left;\">Buy Signals<\/p>\n<p style=\"text-align: left;\"># Find outside days<\/p>\n<pre style=\"text-align: left;\">LOW &lt;REF(LOW, 1) AND<\/pre>\n<pre style=\"text-align: left;\">HIGH &gt;REF(HIGH, 1) AND<\/pre>\n<pre style=\"text-align: left;\">HIGH &gt;REF(HIGH, 1) AND<\/pre>\n<pre style=\"text-align: left;\">CLOSE &lt; OPEN AND<\/pre>\n<p style=\"text-align: left;\"># Outside days are more significant if the<\/p>\n<p style=\"text-align: left;\"># previous bar is shorter in height<\/p>\n<pre style=\"text-align: left;\">HIGH - LOW &gt; (REF(HIGH, 1) - REF(LOW, 1)) * 1.5 AND<\/pre>\n<p style=\"text-align: left;\"># The trend should be up<\/p>\n<pre style=\"text-align: left;\">TREND(CLOSE, 30) = UP<\/pre>\n<p style=\"text-align: left;\">Sell Signals<\/p>\n<p style=\"text-align: left;\"># Find outside days<\/p>\n<pre style=\"text-align: left;\">LOW &lt;REF(LOW, 1) AND<\/pre>\n<pre style=\"text-align: left;\">HIGH &gt;REF(HIGH, 1) AND<\/pre>\n<pre style=\"text-align: left;\">HIGH &gt;REF(HIGH, 1) AND<\/pre>\n<pre style=\"text-align: left;\">CLOSE &lt; OPEN AND<\/pre>\n<pre style=\"text-align: left;\">HIGH - LOW &gt; (REF(HIGH, 1) - REF(LOW, 1)) * 1.5 AND<\/pre>\n<p style=\"text-align: left;\"># The trend should be down for a sell signal<\/p>\n<pre style=\"text-align: left;\">TREND(CLOSE, 30) = DOWN<\/pre>\n<p style=\"text-align: left;\">Happy Trading.<\/p>\n<p style=\"text-align: left;\">This blog is an extended series of the User Manual for algoZ.\u00a0 You can find the Glossary of Indicators available on algoZ <a href=\"https:\/\/drive.google.com\/file\/d\/0Bz0Cuw1XVkpdREFkUmNGY2pvOWs\/edit?usp=sharing\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Beginners, don&#8217;t worry if you don&#8217;t understand when you read this manual. We will explain how to code your technical analysis strategy in the &#8220;Code your strategy&#8221; section. Trading systems A trading system is basically a set of rules that determine entry and exit points for any given stock. Traders often refer to these points [&hellip;]<\/p>\n","protected":false},"author":176551,"featured_media":1269,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[531],"tags":[186,229],"class_list":["post-104","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general","tag-algoz","tag-script"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.5 (Yoast SEO v26.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Trading Systems &#8211; Z-Connect by Zerodha<\/title>\n<meta name=\"description\" content=\"Beginners, don&#039;t worry if you don&#039;t understand when you read this manual. We will explain how to code your technical analysis strategy in the &quot;Code your\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Trading Systems\" \/>\n<meta property=\"og:description\" content=\"Beginners, don&#039;t worry if you don&#039;t understand when you read this manual. We will explain how to code your technical analysis strategy in the &quot;Code your\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems\" \/>\n<meta property=\"og:site_name\" content=\"Z-Connect by Zerodha\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/zerodha.social\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/zerodha.social\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-23T12:18:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-02T10:26:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"708\" \/>\n\t<meta property=\"og:image:height\" content=\"375\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Team Zerodha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@zerodhaonline\" \/>\n<meta name=\"twitter:site\" content=\"@zerodhaonline\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Team Zerodha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems\",\"url\":\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems\",\"name\":\"Trading Systems &#8211; Z-Connect by Zerodha\",\"isPartOf\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#primaryimage\"},\"image\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#primaryimage\"},\"thumbnailUrl\":\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg\",\"datePublished\":\"2013-04-23T12:18:00+00:00\",\"dateModified\":\"2024-02-02T10:26:54+00:00\",\"author\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/ab459269e8365cddd9d34c1885428210\"},\"description\":\"Beginners, don't worry if you don't understand when you read this manual. We will explain how to code your technical analysis strategy in the \\\"Code your\",\"breadcrumb\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#primaryimage\",\"url\":\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg\",\"contentUrl\":\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg\",\"width\":708,\"height\":375},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zerodha.com\/z-connect\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\/\/zerodha.com\/z-connect\/category\/general\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Trading Systems\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/#website\",\"url\":\"https:\/\/zerodha.com\/z-connect\/\",\"name\":\"Zerodha product and business updates\",\"description\":\"Z-Connect is Zerodha&#039;s official blog. Get the latest updates, product announcements news, and insights all in one place.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zerodha.com\/z-connect\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/ab459269e8365cddd9d34c1885428210\",\"name\":\"Team Zerodha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/48197431b96187c109ad9cec95277dad5d96c853020ea2b0f26c675792bd17a5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/48197431b96187c109ad9cec95277dad5d96c853020ea2b0f26c675792bd17a5?s=96&d=mm&r=g\",\"caption\":\"Team Zerodha\"},\"description\":\"Simple and secure, no nonsense investing and trading.\",\"sameAs\":[\"https:\/\/facebook.com\/zerodha.social\",\"https:\/\/x.com\/zerodhaonline\"],\"url\":\"https:\/\/zerodha.com\/z-connect\/author\/team-zerodha\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Trading Systems &#8211; Z-Connect by Zerodha","description":"Beginners, don't worry if you don't understand when you read this manual. We will explain how to code your technical analysis strategy in the \"Code your","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems","og_locale":"en_US","og_type":"article","og_title":"Trading Systems","og_description":"Beginners, don't worry if you don't understand when you read this manual. We will explain how to code your technical analysis strategy in the \"Code your","og_url":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems","og_site_name":"Z-Connect by Zerodha","article_publisher":"https:\/\/www.facebook.com\/zerodha.social","article_author":"https:\/\/facebook.com\/zerodha.social","article_published_time":"2013-04-23T12:18:00+00:00","article_modified_time":"2024-02-02T10:26:54+00:00","og_image":[{"width":708,"height":375,"url":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg","type":"image\/jpeg"}],"author":"Team Zerodha","twitter_card":"summary_large_image","twitter_creator":"@zerodhaonline","twitter_site":"@zerodhaonline","twitter_misc":{"Written by":"Team Zerodha","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems","url":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems","name":"Trading Systems &#8211; Z-Connect by Zerodha","isPartOf":{"@id":"https:\/\/zerodha.com\/z-connect\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#primaryimage"},"image":{"@id":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#primaryimage"},"thumbnailUrl":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg","datePublished":"2013-04-23T12:18:00+00:00","dateModified":"2024-02-02T10:26:54+00:00","author":{"@id":"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/ab459269e8365cddd9d34c1885428210"},"description":"Beginners, don't worry if you don't understand when you read this manual. We will explain how to code your technical analysis strategy in the \"Code your","breadcrumb":{"@id":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#primaryimage","url":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg","contentUrl":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg","width":708,"height":375},{"@type":"BreadcrumbList","@id":"https:\/\/zerodha.com\/z-connect\/general\/algoz-trading-systems#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zerodha.com\/z-connect\/"},{"@type":"ListItem","position":2,"name":"General","item":"https:\/\/zerodha.com\/z-connect\/category\/general"},{"@type":"ListItem","position":3,"name":"Trading Systems"}]},{"@type":"WebSite","@id":"https:\/\/zerodha.com\/z-connect\/#website","url":"https:\/\/zerodha.com\/z-connect\/","name":"Zerodha product and business updates","description":"Z-Connect is Zerodha&#039;s official blog. Get the latest updates, product announcements news, and insights all in one place.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zerodha.com\/z-connect\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/ab459269e8365cddd9d34c1885428210","name":"Team Zerodha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/48197431b96187c109ad9cec95277dad5d96c853020ea2b0f26c675792bd17a5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/48197431b96187c109ad9cec95277dad5d96c853020ea2b0f26c675792bd17a5?s=96&d=mm&r=g","caption":"Team Zerodha"},"description":"Simple and secure, no nonsense investing and trading.","sameAs":["https:\/\/facebook.com\/zerodha.social","https:\/\/x.com\/zerodhaonline"],"url":"https:\/\/zerodha.com\/z-connect\/author\/team-zerodha"}]}},"jetpack_featured_media_url":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/Details1.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/posts\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/users\/176551"}],"replies":[{"embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":22,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":1291,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/posts\/104\/revisions\/1291"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/media\/1269"}],"wp:attachment":[{"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}