{"id":15,"date":"2024-06-22T13:57:00","date_gmt":"2024-06-22T13:57:00","guid":{"rendered":""},"modified":"2025-06-21T15:30:05","modified_gmt":"2025-06-21T15:30:05","slug":"new-pine-script-cosine-kernel-regression","status":"publish","type":"post","link":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/","title":{"rendered":"New Pine Script: Cosine Kernel Regression"},"content":{"rendered":"<div class=\"separator\" style=\"clear: both; text-align: center;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s1024\/Cosine%20kernel%20Reg.jpg\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"><img fetchpriority=\"high\" decoding=\"async\" border=\"0\" data-original-height=\"1024\" data-original-width=\"1024\" height=\"320\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg\" width=\"320\" \/><\/a><\/div>\n<p><\/p>\n<p>&nbsp;This pine script is adapted from Cosine Kernel Regression by <a href=\"https:\/\/www.tradingview.com\/u\/QuantraSystems\/\" target=\"_blank\">QuantraSystems<\/a>. Credit goes to this brilliant script writer.&nbsp;<\/p>\n<p>The Cosine Kernel Regressions indicator (CKR) uses mathematical concepts to offer a unique approach to market analysis. This indicator employs Kernel Regressions using bespoke tunable Cosine functions in order to smoothly interpret a variety of market data, providing traders with incredibly clean insights into market trends. Details <a href=\"https:\/\/www.tradingview.com\/script\/wgTxuL34-Cosine-Kernel-Regressions-QuantraSystems\/\" target=\"_blank\">here..<\/a>&nbsp;<\/p>\n<p>Strategy Description: This stratgey uses many indicators to combine into an indicator that minimizes noises to get as accurate as possible. Order Buy is placed on <b>Oversold signal<\/b>, and exits the order when <b>Overbought signal<\/b>.<\/p>\n<h3 style=\"text-align: left;\"><u>Recommended Settings:<\/u><\/h3>\n<p>Pair: RNDRUSDT (Binance)<\/p>\n<p>Time frame: 1 hour<\/p>\n<p>Initial Capital: 100<\/p>\n<p>Base Currency: Default<\/p>\n<p>Order Size: 100% equity<\/p>\n<p>Pyramiding: 1 order<\/p>\n<p>Commission: 0.1 %&nbsp;<\/p>\n<p><\/p>\n<div style=\"background-color: #131722; color: white; font-family: Menlo, &quot;Ubuntu Mono&quot;, Consolas, source-code-pro, monospace, Consolas, &quot;Courier New&quot;, monospace; font-size: 13px; line-height: 18px; white-space: pre;\">\n<div><span style=\"color: #787b86;\">\/\/ <\/span><span style=\"color: #787b86; font-weight: bold;\">@version=<\/span><span style=\"color: #787b86;\">5<\/span><\/div>\n<div><span style=\"color: #5b9cf6;\">strategy<\/span>(<span style=\"color: #388e3c;\">&#8220;CKR: capayam.com credit to QuantraSystems&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">overlay<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">false<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">initial_capital<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">10<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">default_qty_type<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">strategy.percent_of_equity<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">default_qty_value<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">100<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">commission_type<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">strategy.commission.percent<\/span> <span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">commission_value<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">0.1<\/span>)<\/div>\n<div><span style=\"color: #42bda8;\">import<\/span> <span style=\"color: #5b9cf6;\">QuantraAI\/QuantraMAs\/2<\/span> <span style=\"color: #42bda8;\">as<\/span> <span style=\"color: #ba68c8;\">Dynamic<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Desc: refer to Cosine Kernel Regression by QuantraSystems for original pine script.<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ Default setting is best with TF1hour<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Input Groups<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #d1d4dc;\">GRP1<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;Display:&#8221;<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;Indicator Setup:&#8221;<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">GRP3<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;Kernel Calibration:&#8221;<\/span> <\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Indicator Calibrations<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">src<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.source<\/span>(<span style=\"color: #f77c80;\">close<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Source&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<p><\/p>\n<div><span style=\"color: #d1d4dc;\">bool_STOCH<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.bool<\/span> &nbsp;(<span style=\"color: #f77c80;\">true<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;STOCH&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">bool_RSI<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.bool<\/span> &nbsp;(<span style=\"color: #f77c80;\">true<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;RSI&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;) &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #d1d4dc;\">bool_BBPCT<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.bool<\/span> &nbsp;(<span style=\"color: #f77c80;\">true<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;BBPCT&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">bool_CMO<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.bool<\/span> &nbsp;(<span style=\"color: #f77c80;\">true<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;CMO&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">bool_CCI<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.bool<\/span> &nbsp;(<span style=\"color: #f77c80;\">true<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;CCI&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">bool_FISH<\/span> &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.bool<\/span> &nbsp;(<span style=\"color: #f77c80;\">true<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;FISH&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">bool_VZO<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.bool<\/span> &nbsp;(<span style=\"color: #f77c80;\">true<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;VZO&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<p><\/p>\n<div><span style=\"color: #d1d4dc;\">length_STOCH<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span> &nbsp; (<span style=\"color: #f57f17;\">14<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Stochastic Length&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;STOCH&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">length_RSI<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span> &nbsp; (<span style=\"color: #f57f17;\">14<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;RSI Length&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;RSI&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">length_BBPCT<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span> &nbsp; (<span style=\"color: #f57f17;\">20<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;BBPCT Length&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;BBPCT&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">length_CMO<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span> &nbsp; (<span style=\"color: #f57f17;\">14<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Chande Momentum Length&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;CMO&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">length_CCI<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span> &nbsp; (<span style=\"color: #f57f17;\">20<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;CCI Length&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;CCI&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">length_FISH<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span> &nbsp; (<span style=\"color: #f57f17;\">9<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Fisher Transform Length&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;FISH&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">length_VZO<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span> &nbsp; (<span style=\"color: #f57f17;\">21<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;VZO Length&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;VZO&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Cosine Kernel Setup<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">varient<\/span> &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.string<\/span>(<span style=\"color: #388e3c;\">&#8220;Tuneable&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Cosine Kernel Regression Type&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP3<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">options<\/span> <span style=\"color: #42bda8;\">=<\/span> [<span style=\"color: #388e3c;\">&#8220;Tuneable&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Stepped&#8221;<\/span>])<\/div>\n<div><span style=\"color: #d1d4dc;\">lookbackR<\/span> &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span> &nbsp; (<span style=\"color: #f57f17;\">60<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Regression Lookback&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP3<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">tuning<\/span> &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.float<\/span> (<span style=\"color: #f57f17;\">15.<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Tuning Coefficient&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP3<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Display<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">ColType<\/span> &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.string<\/span>(<span style=\"color: #388e3c;\">&#8220;Fast Trend&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #388e3c;\">&#8220;Choose Mode&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP1<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">options<\/span> <span style=\"color: #42bda8;\">=<\/span> [<span style=\"color: #388e3c;\">&#8220;None&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Fast Trend&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Slow Trend&#8221;<\/span>]<span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">tooltip<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;Signal Mode &#8211; Barcolor&#8221;<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">ColMode<\/span> &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.string<\/span>(<span style=\"color: #388e3c;\">&#8220;Modern&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Color Palette Choice&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;Drop&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP1<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">options<\/span> <span style=\"color: #42bda8;\">=<\/span> [<span style=\"color: #388e3c;\">&#8220;Classic&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Modern&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Robust&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Accented&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Monochrome&#8221;<\/span>])<\/div>\n<div><span style=\"color: #d1d4dc;\">man<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.bool<\/span> &nbsp;(<span style=\"color: #f77c80;\">false<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Custom Palette&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;Drop&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP1<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">manUpC<\/span> &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.color<\/span> (<span style=\"color: #f77c80;\">#00ff00<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Custom Up&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;Man&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP1<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;) <\/div>\n<div><span style=\"color: #d1d4dc;\">manDnC<\/span> &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.color<\/span> (<span style=\"color: #f77c80;\">#ff0000<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Custom Down&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">inline<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;Man&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #d1d4dc;\">group<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">GRP1<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Color assignment based on the selected palette<\/span><\/div>\n<div>[<span style=\"color: #d1d4dc;\">UpC<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">DnC<\/span>] &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #42bda8;\">switch<\/span> &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">ColMode<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Classic&#8221;<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=&gt;<\/span> [<span style=\"color: #f77c80;\">#00E676<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">#880E4F<\/span>]<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Modern&#8221;<\/span> &nbsp; &nbsp; <span style=\"color: #42bda8;\">=&gt;<\/span> [<span style=\"color: #f77c80;\">#5ffae0<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">#c22ed0<\/span>]<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Robust&#8221;<\/span> &nbsp; &nbsp; <span style=\"color: #42bda8;\">=&gt;<\/span> [<span style=\"color: #f77c80;\">#ffbb00<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">#770737<\/span>]<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Accented&#8221;<\/span> &nbsp; <span style=\"color: #42bda8;\">=&gt;<\/span> [<span style=\"color: #f77c80;\">#9618f7<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">#ff0078<\/span>]<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Monochrome&#8221;<\/span> <span style=\"color: #42bda8;\">=&gt;<\/span> [<span style=\"color: #f77c80;\">#dee2e6<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">#495057<\/span>]<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Override with custom colors if manual palette is selected<\/span><\/div>\n<div>[<span style=\"color: #d1d4dc;\">UpCol<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">DnCol<\/span>] &nbsp; <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #42bda8;\">switch<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">man<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #f77c80;\">false<\/span> &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=&gt;<\/span> [<span style=\"color: #d1d4dc;\">UpC<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">DnC<\/span> &nbsp; &nbsp; ]<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #f77c80;\">true<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=&gt;<\/span> [<span style=\"color: #d1d4dc;\">manUpC<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">manDnC<\/span> &nbsp;]<\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Define a function to compute the cosine of an input scaled by a frequency tuner<\/span><\/div>\n<div><span style=\"color: #3179f5;\">cosine<\/span>(<span style=\"color: #d1d4dc;\">x<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">z<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #787b86;\">\/\/ Where x = source input<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #787b86;\">\/\/ &nbsp; &nbsp; &nbsp; y = function output<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #787b86;\">\/\/ &nbsp; &nbsp; &nbsp; z = frequency tuner<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #d1d4dc;\">y<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">y<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #5b9cf6;\">math.cos<\/span>(<span style=\"color: #d1d4dc;\">z<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #d1d4dc;\">x<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">y<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ Define a kernel that utilizes the cosine function<\/span><\/div>\n<div><span style=\"color: #3179f5;\">kernel<\/span>(<span style=\"color: #d1d4dc;\">x<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">z<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #d1d4dc;\">y<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">y<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #3179f5;\">cosine<\/span>(<span style=\"color: #d1d4dc;\">x<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">z<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">math.abs<\/span>(<span style=\"color: #d1d4dc;\">x<\/span>) <span style=\"color: #42bda8;\">&lt;=<\/span> <span style=\"color: #f77c80;\">math.pi<\/span><span style=\"color: #42bda8;\">\/<\/span>(<span style=\"color: #f57f17;\">2<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #d1d4dc;\">z<\/span>) <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #5b9cf6;\">math.abs<\/span>(<span style=\"color: #d1d4dc;\">y<\/span>) <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f57f17;\">0.<\/span> &nbsp; &nbsp;<span style=\"color: #787b86;\">\/\/ &nbsp; &nbsp;cos(zx) = 0<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ &nbsp;The above restricts the wave to positive values &nbsp; &nbsp; &nbsp;\/\/ &nbsp; &nbsp; when x = \u03c0 \/ 2z<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ Kernel Regression &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><\/div>\n<div><span style=\"color: #3179f5;\">kernelRegression<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">lookback<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">tuning<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">currentWeight<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalWeight<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #42bda8;\">for<\/span> <span style=\"color: #d1d4dc;\">i<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">to<\/span> <span style=\"color: #5b9cf6;\">math.min<\/span>(<span style=\"color: #d1d4dc;\">lookback<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">1<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">bar_index<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">y<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">src<\/span>[<span style=\"color: #d1d4dc;\">i<\/span>] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">w<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #3179f5;\">kernel<\/span>(<span style=\"color: #d1d4dc;\">i<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">lookback<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">tuning<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">currentWeight<\/span> <span style=\"color: #42bda8;\">+=<\/span> <span style=\"color: #d1d4dc;\">y<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #d1d4dc;\">w<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalWeight<\/span> &nbsp; <span style=\"color: #42bda8;\">+=<\/span> <span style=\"color: #d1d4dc;\">w<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">currentWeight<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">totalWeight<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Multi Cosine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><\/div>\n<div><span style=\"color: #3179f5;\">multicosine<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">lookback<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">steps<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">regression<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #42bda8;\">for<\/span> <span style=\"color: #d1d4dc;\">i<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">to<\/span> <span style=\"color: #5b9cf6;\">math.min<\/span>(<span style=\"color: #d1d4dc;\">steps<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">1<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">bar_index<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">regression<\/span> <span style=\"color: #42bda8;\">+=<\/span> <span style=\"color: #3179f5;\">kernelRegression<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">lookback<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">i<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">regression<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">steps<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #3179f5;\">RSI_ReScale<\/span> &nbsp; (<span style=\"color: #d1d4dc;\">_res<\/span> &nbsp; &nbsp; &nbsp;) <span style=\"color: #42bda8;\">=&gt;<\/span> ( &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">_res<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">50<\/span> &nbsp; ) <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">2.8<\/span><\/div>\n<div><span style=\"color: #3179f5;\">STOCH_ReScale<\/span> (<span style=\"color: #d1d4dc;\">_stoch<\/span> &nbsp; &nbsp;) <span style=\"color: #42bda8;\">=&gt;<\/span> ( &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">_stoch<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">50<\/span> &nbsp; ) <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">2<\/span><\/div>\n<div><span style=\"color: #3179f5;\">BBPCT_ReScale<\/span> (<span style=\"color: #d1d4dc;\">_bbpct<\/span> &nbsp; &nbsp;) <span style=\"color: #42bda8;\">=&gt;<\/span> ( &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">_bbpct<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">0.5<\/span> &nbsp;) <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">120<\/span><\/div>\n<div><span style=\"color: #3179f5;\">CMO_ReScale<\/span> &nbsp; (<span style=\"color: #d1d4dc;\">_chandeMO<\/span> ) <span style=\"color: #42bda8;\">=&gt;<\/span> ( <span style=\"color: #d1d4dc;\">_chandeMO<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">1.15<\/span> )<\/div>\n<div><span style=\"color: #3179f5;\">CCI_ReScale<\/span> &nbsp; (<span style=\"color: #d1d4dc;\">_cci<\/span> &nbsp; &nbsp; &nbsp;) <span style=\"color: #42bda8;\">=&gt;<\/span> ( &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">_cci<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">2<\/span> &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #3179f5;\">FISH_ReScale<\/span> &nbsp;(<span style=\"color: #d1d4dc;\">_fish1<\/span> &nbsp; &nbsp;) <span style=\"color: #42bda8;\">=&gt;<\/span> ( &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">_fish1<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">30<\/span> &nbsp; )<\/div>\n<div><span style=\"color: #3179f5;\">VZO_ReScale<\/span> &nbsp; (<span style=\"color: #d1d4dc;\">_VP<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">_TV<\/span> &nbsp;) <span style=\"color: #42bda8;\">=&gt;<\/span> (<span style=\"color: #d1d4dc;\">_VP<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">_TV<\/span>) <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">110<\/span><\/div>\n<div><span style=\"color: #3179f5;\">DynamicStdev<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">actualLength<\/span> <span style=\"color: #42bda8;\">=<\/span> &nbsp; &nbsp;<span style=\"color: #5b9cf6;\">math.min<\/span>(<span style=\"color: #d1d4dc;\">length<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">bar_index<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #f57f17;\">1<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">mean<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #ba68c8;\">Dynamic<\/span><span style=\"color: #ba68c8;\">.<\/span><span style=\"color: #ba68c8;\">SMA<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">actualLength<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">sumSquares<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #42bda8;\">for<\/span> <span style=\"color: #d1d4dc;\">i<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">to<\/span> <span style=\"color: #d1d4dc;\">actualLength<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">1<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">sumSquares<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">sumSquares<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #5b9cf6;\">math.pow<\/span>(<span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">src<\/span>[<span style=\"color: #d1d4dc;\">i<\/span>]) <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">mean<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">2<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">stdev<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">math.sqrt<\/span>(<span style=\"color: #d1d4dc;\">sumSquares<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">actualLength<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">stdev<\/span><\/div>\n<div><span style=\"color: #3179f5;\">DynamicDev<\/span>(<span style=\"color: #d1d4dc;\">source<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">mean<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #ba68c8;\">Dynamic<\/span><span style=\"color: #ba68c8;\">.<\/span><span style=\"color: #ba68c8;\">SMA<\/span>(<span style=\"color: #d1d4dc;\">source<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">sum<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #42bda8;\">for<\/span> <span style=\"color: #d1d4dc;\">i<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">to<\/span> <span style=\"color: #d1d4dc;\">length<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">1<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">val<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">source<\/span>[<span style=\"color: #d1d4dc;\">i<\/span>]<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">sum<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">sum<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #5b9cf6;\">math.abs<\/span>(<span style=\"color: #d1d4dc;\">val<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">mean<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">dev<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">sum<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">length<\/span><\/div>\n<div>&nbsp; &nbsp; <\/div>\n<p><\/p>\n<div><span style=\"color: #3179f5;\">DynamicRMA<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">srcx<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">src<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">100<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #42bda8; font-weight: bold;\">float<\/span> <span style=\"color: #d1d4dc;\">rma<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">na<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">rma<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">length<\/span> <span style=\"color: #42bda8;\">==<\/span> <span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">?<\/span> <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #ba68c8;\">Dynamic<\/span><span style=\"color: #ba68c8;\">.<\/span><span style=\"color: #ba68c8;\">SMA<\/span>(<span style=\"color: #d1d4dc;\">srcx<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">:<\/span> <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;((<span style=\"color: #d1d4dc;\">rma<\/span>[<span style=\"color: #f57f17;\">1<\/span>] <span style=\"color: #42bda8;\">*<\/span> (<span style=\"color: #d1d4dc;\">length<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">1<\/span>) ) <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #d1d4dc;\">srcx<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">length<\/span> <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">rma<\/span><\/div>\n<div><span style=\"color: #3179f5;\">DynamicRSI<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #42bda8; font-weight: bold;\">float<\/span> <span style=\"color: #d1d4dc;\">res<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">na<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">len<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">math.min<\/span>(<span style=\"color: #d1d4dc;\">length<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #f77c80;\">bar_index<\/span> &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">u<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">math.max<\/span>(<span style=\"color: #d1d4dc;\">src<\/span> &nbsp; &nbsp; <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">src<\/span>[<span style=\"color: #f57f17;\">1<\/span>]<span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">0<\/span> &nbsp; &nbsp; &nbsp; &nbsp;) <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">d<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">math.max<\/span>(<span style=\"color: #d1d4dc;\">src<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp;<span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; <span style=\"color: #f57f17;\">0<\/span> &nbsp; &nbsp; &nbsp; )<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">rs<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #3179f5;\">DynamicRMA<\/span>(<span style=\"color: #d1d4dc;\">u<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">len<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #3179f5;\">DynamicRMA<\/span>(<span style=\"color: #d1d4dc;\">d<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">len<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">res<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">100<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">100<\/span> <span style=\"color: #42bda8;\">\/<\/span> (<span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #d1d4dc;\">rs<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #3179f5;\">RSI_ReScale<\/span>(<span style=\"color: #d1d4dc;\">res<\/span>)<\/div>\n<div><span style=\"color: #3179f5;\">DynamicSTOCH<\/span>(<span style=\"color: #d1d4dc;\">source<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">hi<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">lo<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">len<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> &nbsp; &nbsp;<span style=\"color: #5b9cf6;\">math.min<\/span>(<span style=\"color: #d1d4dc;\">length<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #f77c80;\">bar_index<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">lowestLow<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #5b9cf6;\">ta.lowest<\/span>(<span style=\"color: #d1d4dc;\">lo<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">len<\/span> &nbsp; &nbsp; &nbsp;)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">highestHigh<\/span> <span style=\"color: #42bda8;\">=<\/span> &nbsp;<span style=\"color: #5b9cf6;\">ta.highest<\/span>(<span style=\"color: #d1d4dc;\">hi<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">len<\/span> &nbsp; &nbsp; &nbsp;)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">stochastic<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #f57f17;\">100<\/span> <span style=\"color: #42bda8;\">*<\/span> (<span style=\"color: #d1d4dc;\">source<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">lowestLow<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(<span style=\"color: #d1d4dc;\">highestHigh<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">lowestLow<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #3179f5;\">STOCH_ReScale<\/span>(<span style=\"color: #d1d4dc;\">stochastic<\/span>)<\/div>\n<div><span style=\"color: #3179f5;\">DynamicBBPCT<\/span>(<span style=\"color: #d1d4dc;\">length<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">multi<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">basis<\/span> <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #ba68c8;\">Dynamic<\/span><span style=\"color: #ba68c8;\">.<\/span><span style=\"color: #ba68c8;\">SMA<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">dev<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #d1d4dc;\">multi<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #3179f5;\">DynamicStdev<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">upper<\/span> <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #d1d4dc;\">basis<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #d1d4dc;\">dev<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">lower<\/span> <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #d1d4dc;\">basis<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">dev<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">bbpct<\/span> <span style=\"color: #42bda8;\">=<\/span> &nbsp;(<span style=\"color: #d1d4dc;\">src<\/span> &nbsp; <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">lower<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(<span style=\"color: #d1d4dc;\">upper<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">lower<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #3179f5;\">BBPCT_ReScale<\/span>(<span style=\"color: #d1d4dc;\">bbpct<\/span>)<\/div>\n<p><\/p>\n<div>&nbsp;<\/div>\n<div><span style=\"color: #3179f5;\">DynamicCMO<\/span>(<span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">len<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">math.min<\/span>(<span style=\"color: #d1d4dc;\">length<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">bar_index<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #f57f17;\">1<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">momm<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">ta.change<\/span>(<span style=\"color: #d1d4dc;\">src<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">m1<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">momm<\/span> <span style=\"color: #42bda8;\">&gt;=<\/span> <span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">?<\/span> &nbsp;<span style=\"color: #d1d4dc;\">momm<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f57f17;\">0.0<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">m2<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">momm<\/span> <span style=\"color: #42bda8;\">&lt;<\/span> &nbsp;<span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span><span style=\"color: #d1d4dc;\">momm<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f57f17;\">0.0<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">sm1<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">math.sum<\/span>(<span style=\"color: #d1d4dc;\">m1<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">len<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">sm2<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">math.sum<\/span>(<span style=\"color: #d1d4dc;\">m2<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">len<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">div<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">sm1<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #d1d4dc;\">sm2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">chandeMO<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">div<\/span> <span style=\"color: #42bda8;\">!=<\/span> <span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #f57f17;\">100<\/span> <span style=\"color: #42bda8;\">*<\/span> (<span style=\"color: #d1d4dc;\">sm1<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">sm2<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">div<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f57f17;\">0<\/span> <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #3179f5;\">CMO_ReScale<\/span>(<span style=\"color: #d1d4dc;\">chandeMO<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #3179f5;\">DynamicCCI<\/span>(<span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">len<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">math.min<\/span>(<span style=\"color: #d1d4dc;\">length<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">bar_index<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #f57f17;\">1<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">ma<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #ba68c8;\">Dynamic<\/span><span style=\"color: #ba68c8;\">.<\/span><span style=\"color: #ba68c8;\">SMA<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">len<\/span>) <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">cci<\/span> <span style=\"color: #42bda8;\">=<\/span> (<span style=\"color: #d1d4dc;\">src<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">ma<\/span>) <span style=\"color: #42bda8;\">\/<\/span> (<span style=\"color: #f57f17;\">0.015<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #3179f5;\">DynamicDev<\/span>(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">len<\/span>))<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #3179f5;\">CCI_ReScale<\/span>(<span style=\"color: #d1d4dc;\">cci<\/span>)<\/div>\n<div><span style=\"color: #3179f5;\">DynamicFisher<\/span>(<span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">len<\/span> &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> &nbsp; <span style=\"color: #5b9cf6;\">math.min<\/span>(<span style=\"color: #d1d4dc;\">length<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #f77c80;\">bar_index<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">high_<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">ta.highest<\/span>(<span style=\"color: #f77c80;\">hl2<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">len<\/span> &nbsp; &nbsp; &nbsp;)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">low_<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> &nbsp;<span style=\"color: #5b9cf6;\">ta.lowest<\/span>(<span style=\"color: #f77c80;\">hl2<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">len<\/span> &nbsp; &nbsp; &nbsp;)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">value1<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">value2<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">value1<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">0.66<\/span> <span style=\"color: #42bda8;\">*<\/span> ((<span style=\"color: #f77c80;\">hl2<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">low_<\/span>) &nbsp;<span style=\"color: #42bda8;\">\/<\/span> (<span style=\"color: #d1d4dc;\">high_<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">low_<\/span>) <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #f57f17;\">0.5<\/span>) &nbsp;<span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #f57f17;\">0.67<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">value1<\/span>[<span style=\"color: #f57f17;\">1<\/span>])<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">value2<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">value1<\/span> <span style=\"color: #42bda8;\">&gt;<\/span> <span style=\"color: #f57f17;\">0.99<\/span> <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #f57f17;\">0.999<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">value1<\/span> <span style=\"color: #42bda8;\">&lt;<\/span> <span style=\"color: #f57f17;\">-.99<\/span> &nbsp;<span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #f57f17;\">-.999<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">value1<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">fish1<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0.0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">fish1<\/span> &nbsp;<span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">0.5<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #5b9cf6;\">math.log<\/span>((<span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #d1d4dc;\">value2<\/span>) <span style=\"color: #42bda8;\">\/<\/span> (<span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">value2<\/span>)) <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #f57f17;\">0.5<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">fish1<\/span>[<span style=\"color: #f57f17;\">1<\/span>]) <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #3179f5;\">FISH_ReScale<\/span>(<span style=\"color: #d1d4dc;\">fish1<\/span>)<\/div>\n<div><span style=\"color: #3179f5;\">DynamicVZO<\/span>(<span style=\"color: #d1d4dc;\">length<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">VP<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #ba68c8;\">Dynamic<\/span><span style=\"color: #ba68c8;\">.<\/span><span style=\"color: #ba68c8;\">EMA<\/span>(<span style=\"color: #5b9cf6;\">math.sign<\/span>(<span style=\"color: #5b9cf6;\">ta.change<\/span>(<span style=\"color: #f77c80;\">hlc3<\/span>)) <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f77c80;\">volume<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">3<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">TV<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #ba68c8;\">Dynamic<\/span><span style=\"color: #ba68c8;\">.<\/span><span style=\"color: #ba68c8;\">EMA<\/span>(<span style=\"color: #f77c80;\">volume<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">3<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #3179f5;\">VZO_ReScale<\/span>(<span style=\"color: #d1d4dc;\">VP<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">TV<\/span>)<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Function to check the status of user-bools<\/span><\/div>\n<div><span style=\"color: #3179f5;\">booleanCheck<\/span>(<span style=\"color: #d1d4dc;\">condition<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">func<\/span>) <span style=\"color: #42bda8;\">=&gt;<\/span> <span style=\"color: #d1d4dc;\">condition<\/span> <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #d1d4dc;\">func<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f77c80;\">na<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ Function to count active indicators<\/span><\/div>\n<div><span style=\"color: #3179f5;\">countCondition<\/span>(<span style=\"color: #d1d4dc;\">condition<\/span>) &nbsp; &nbsp; <span style=\"color: #42bda8;\">=&gt;<\/span> <span style=\"color: #d1d4dc;\">condition<\/span> <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ Pull all standardized base indicator values<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">val_RSI<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #3179f5;\">booleanCheck<\/span>(<span style=\"color: #d1d4dc;\">bool_RSI<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #3179f5;\">DynamicRSI<\/span> &nbsp; &nbsp;(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length_RSI<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">val_STOCH<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #3179f5;\">booleanCheck<\/span>(<span style=\"color: #d1d4dc;\">bool_STOCH<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #3179f5;\">DynamicSTOCH<\/span> &nbsp;(<span style=\"color: #d1d4dc;\">src<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">high<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">low<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">length_STOCH<\/span>) )<\/div>\n<div><span style=\"color: #d1d4dc;\">val_BBPCT<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #3179f5;\">booleanCheck<\/span>(<span style=\"color: #d1d4dc;\">bool_BBPCT<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #3179f5;\">DynamicBBPCT<\/span> &nbsp;(<span style=\"color: #d1d4dc;\">length_BBPCT<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">2<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">val_CMO<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #3179f5;\">booleanCheck<\/span>(<span style=\"color: #d1d4dc;\">bool_CMO<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #3179f5;\">DynamicCMO<\/span> &nbsp; &nbsp;(<span style=\"color: #d1d4dc;\">length_CMO<\/span> &nbsp; &nbsp; ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">val_CCI<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #3179f5;\">booleanCheck<\/span>(<span style=\"color: #d1d4dc;\">bool_CCI<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #3179f5;\">DynamicCCI<\/span> &nbsp; &nbsp;(<span style=\"color: #d1d4dc;\">length_CCI<\/span> &nbsp; &nbsp; ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">val_FISH<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #3179f5;\">booleanCheck<\/span>(<span style=\"color: #d1d4dc;\">bool_FISH<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #3179f5;\">DynamicFisher<\/span> (<span style=\"color: #d1d4dc;\">length_FISH<\/span> &nbsp; &nbsp;) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #d1d4dc;\">val_VZO<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #3179f5;\">booleanCheck<\/span>(<span style=\"color: #d1d4dc;\">bool_VZO<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #3179f5;\">DynamicVZO<\/span> &nbsp; &nbsp;(<span style=\"color: #d1d4dc;\">length_VZO<\/span> &nbsp; &nbsp; ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Count the number of active indicators<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">activeIndicators<\/span> <span style=\"color: #42bda8;\">=<\/span> <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #3179f5;\">countCondition<\/span>(<span style=\"color: #d1d4dc;\">bool_RSI<\/span> &nbsp;) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #3179f5;\">countCondition<\/span>(<span style=\"color: #d1d4dc;\">bool_STOCH<\/span>) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #3179f5;\">countCondition<\/span>(<span style=\"color: #d1d4dc;\">bool_BBPCT<\/span>) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #3179f5;\">countCondition<\/span>(<span style=\"color: #d1d4dc;\">bool_CMO<\/span> &nbsp;) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #3179f5;\">countCondition<\/span>(<span style=\"color: #d1d4dc;\">bool_CCI<\/span> &nbsp;) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #3179f5;\">countCondition<\/span>(<span style=\"color: #d1d4dc;\">bool_FISH<\/span> ) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #3179f5;\">countCondition<\/span>(<span style=\"color: #d1d4dc;\">bool_VZO<\/span> &nbsp;)<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Calculate the average only with active indicators<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">value<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">activeIndicators<\/span> <span style=\"color: #42bda8;\">&gt;<\/span> <span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">?<\/span> (<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">val_RSI<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #f57f17;\">0<\/span>) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">val_STOCH<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">0<\/span>) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">val_BBPCT<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">0<\/span>) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">val_CMO<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #f57f17;\">0<\/span>) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">val_CCI<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #f57f17;\">0<\/span>) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">val_FISH<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #f57f17;\">0<\/span>) <span style=\"color: #42bda8;\">+<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">nz<\/span>(<span style=\"color: #d1d4dc;\">val_VZO<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #f57f17;\">0<\/span>)<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">activeIndicators<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f77c80;\">na<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Gentle ALMA smoothing<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">value<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #ba68c8;\">Dynamic<\/span><span style=\"color: #ba68c8;\">.<\/span><span style=\"color: #ba68c8;\">ALMA<\/span>(<span style=\"color: #d1d4dc;\">value<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">9<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">0<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">6<\/span>)<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Calulate the Output &#8211; Depending on the method of Cosine Regression Selected<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">out<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #42bda8;\">switch<\/span> <span style=\"color: #d1d4dc;\">varient<\/span> <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Tuneable&#8221;<\/span> <span style=\"color: #42bda8;\">=&gt;<\/span> <span style=\"color: #3179f5;\">kernelRegression<\/span>(<span style=\"color: #d1d4dc;\">value<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">lookbackR<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">tuning<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Stepped&#8221;<\/span> &nbsp;<span style=\"color: #42bda8;\">=&gt;<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #3179f5;\">multicosine<\/span>(<span style=\"color: #d1d4dc;\">value<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">lookbackR<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">tuning<\/span>)<\/div>\n<p><\/p>\n<div><span style=\"color: #d1d4dc;\">out2<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #42bda8;\">switch<\/span> <span style=\"color: #d1d4dc;\">varient<\/span> <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Tuneable&#8221;<\/span> <span style=\"color: #42bda8;\">=&gt;<\/span> <span style=\"color: #3179f5;\">kernelRegression<\/span>(<span style=\"color: #d1d4dc;\">value<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">lookbackR<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #5b9cf6;\">math.round<\/span>(<span style=\"color: #d1d4dc;\">tuning<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">5<\/span>))<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Stepped&#8221;<\/span> &nbsp;<span style=\"color: #42bda8;\">=&gt;<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #3179f5;\">multicosine<\/span>(<span style=\"color: #d1d4dc;\">value<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">lookbackR<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #5b9cf6;\">math.round<\/span>(<span style=\"color: #d1d4dc;\">tuning<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">5<\/span>))<\/div>\n<div><span style=\"color: #787b86;\">\/\/ Define Alert Conditions<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">fastTrend_up<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">out<\/span> &nbsp;<span style=\"color: #42bda8;\">&gt;<\/span> <span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp;<span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #42bda8;\">not<\/span> (<span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp;<span style=\"color: #42bda8;\">&gt;<\/span> <span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">2<\/span>])<\/div>\n<div><span style=\"color: #d1d4dc;\">fastTrend_dn<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">out<\/span> &nbsp;<span style=\"color: #42bda8;\">&lt;<\/span> <span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp;<span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #42bda8;\">not<\/span> (<span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp;<span style=\"color: #42bda8;\">&lt;<\/span> <span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">2<\/span>])<\/div>\n<div><span style=\"color: #d1d4dc;\">slowTrend_up<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">out2<\/span> <span style=\"color: #42bda8;\">&gt;<\/span> &nbsp; &nbsp; <span style=\"color: #f57f17;\">0<\/span> &nbsp; <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #42bda8;\">not<\/span> (<span style=\"color: #d1d4dc;\">out2<\/span>[<span style=\"color: #f57f17;\">1<\/span>] <span style=\"color: #42bda8;\">&gt;<\/span> &nbsp; &nbsp; <span style=\"color: #f57f17;\">0<\/span> )<\/div>\n<div><span style=\"color: #d1d4dc;\">slowTrend_dn<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">out2<\/span> <span style=\"color: #42bda8;\">&lt;<\/span> &nbsp; &nbsp; <span style=\"color: #f57f17;\">0<\/span> &nbsp; <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #42bda8;\">not<\/span> (<span style=\"color: #d1d4dc;\">out2<\/span>[<span style=\"color: #f57f17;\">1<\/span>] <span style=\"color: #42bda8;\">&lt;<\/span> &nbsp; &nbsp; <span style=\"color: #f57f17;\">0<\/span> )<\/div>\n<div><span style=\"color: #d1d4dc;\">overbought<\/span> &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">out<\/span> &nbsp;<span style=\"color: #42bda8;\">&gt;<\/span> &nbsp; &nbsp;<span style=\"color: #f57f17;\">50<\/span> &nbsp; <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #42bda8;\">not<\/span> (<span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp;<span style=\"color: #42bda8;\">&gt;<\/span> &nbsp; &nbsp;<span style=\"color: #f57f17;\">50<\/span> )<\/div>\n<div><span style=\"color: #d1d4dc;\">oversold<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">out<\/span> &nbsp;<span style=\"color: #42bda8;\">&lt;<\/span> &nbsp; <span style=\"color: #f57f17;\">-50<\/span> &nbsp; <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #42bda8;\">not<\/span> (<span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp;<span style=\"color: #42bda8;\">&lt;<\/span> &nbsp; <span style=\"color: #f57f17;\">-50<\/span> )<\/div>\n<p><\/p>\n<div><span style=\"color: #d1d4dc;\">fastTrend<\/span> &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">fastTrend_up<\/span> <span style=\"color: #42bda8;\">or<\/span> <span style=\"color: #d1d4dc;\">fastTrend_dn<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">slowTrend<\/span> &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">slowTrend_up<\/span> <span style=\"color: #42bda8;\">or<\/span> <span style=\"color: #d1d4dc;\">slowTrend_dn<\/span><\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div><span style=\"color: #d1d4dc;\">barcol<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #42bda8;\">switch<\/span> <span style=\"color: #d1d4dc;\">ColType<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;None&#8221;<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=&gt;<\/span> <span style=\"color: #f77c80;\">na<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Fast Trend&#8221;<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=&gt;<\/span> <span style=\"color: #d1d4dc;\">out<\/span> &nbsp;<span style=\"color: #42bda8;\">&gt;<\/span> <span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">?<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">UpCol<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">DnCol<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #388e3c;\">&#8220;Slow Trend&#8221;<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=&gt;<\/span> <span style=\"color: #d1d4dc;\">out2<\/span> <span style=\"color: #42bda8;\">&gt;<\/span> <span style=\"color: #f57f17;\">0<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">?<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">UpCol<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">DnCol<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #d1d4dc;\">col<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #42bda8;\">=<\/span> &nbsp;<span style=\"color: #d1d4dc;\">out<\/span> &nbsp;<span style=\"color: #42bda8;\">&gt;<\/span> <span style=\"color: #d1d4dc;\">out<\/span>[<span style=\"color: #f57f17;\">1<\/span>] &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">?<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">UpCol<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">DnCol<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #d1d4dc;\">col2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #42bda8;\">=<\/span> &nbsp;<span style=\"color: #5b9cf6;\">color.new<\/span>((<span style=\"color: #d1d4dc;\">out2<\/span> <span style=\"color: #42bda8;\">&gt;<\/span> <span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">?<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">UpCol<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">DnCol<\/span>)<span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">80<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div><span style=\"color: #d1d4dc;\">mid<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">plot<\/span>( &nbsp;<span style=\"color: #f57f17;\">0<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Midline&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #f77c80;\">color.gray<\/span> <span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.all<\/span> &nbsp; &nbsp; &nbsp; &nbsp; ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div><span style=\"color: #d1d4dc;\">sig<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #d1d4dc;\">out<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #388e3c;\">&#8220;Fast Signal&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">col<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; <span style=\"color: #f57f17;\">3<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.all<\/span> &nbsp; &nbsp; &nbsp; &nbsp; )<span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #d1d4dc;\">out<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #d1d4dc;\">col<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">85<\/span>)<span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">10<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.pane<\/span> &nbsp; &nbsp; &nbsp; &nbsp;)<span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #d1d4dc;\">out<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #d1d4dc;\">col<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">98<\/span>)<span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">25<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.pane<\/span> &nbsp; &nbsp; &nbsp; &nbsp;) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #d1d4dc;\">sig2<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #d1d4dc;\">out2<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Slow Signal&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">col2<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #f57f17;\">3<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.all<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">style<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">plot.style_area<\/span>) <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div><span style=\"color: #d1d4dc;\">l1<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">plot<\/span>( <span style=\"color: #f57f17;\">100<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #f77c80;\">na<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.data_window<\/span> ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #d1d4dc;\">l2<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">plot<\/span>( &nbsp;<span style=\"color: #f57f17;\">50<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #d1d4dc;\">DnCol<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">50<\/span>)<span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.data_window<\/span> ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #d1d4dc;\">l3<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">plot<\/span>( <span style=\"color: #f57f17;\">-50<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #d1d4dc;\">UpCol<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">50<\/span>)<span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.data_window<\/span> ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #d1d4dc;\">l4<\/span> &nbsp; <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #f57f17;\">-100<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #f77c80;\">na<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">display<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">display.data_window<\/span> ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div><span style=\"color: #5b9cf6;\">plotshape<\/span> &nbsp;(<span style=\"color: #d1d4dc;\">out<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #f77c80;\">shape.xcross<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">color<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">fastTrend_dn<\/span> <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #d1d4dc;\">DnCol<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">15<\/span>) <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f77c80;\">na<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">location<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">location.absolute<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">size<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">size.small<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #5b9cf6;\">plotshape<\/span> &nbsp;(<span style=\"color: #d1d4dc;\">out<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #f77c80;\">shape.circle<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">color<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">fastTrend_up<\/span> <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #d1d4dc;\">UpCol<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">15<\/span>) <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #f77c80;\">na<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #d1d4dc;\">location<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">location.absolute<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">size<\/span> &nbsp;<span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">size.small<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div><span style=\"color: #5b9cf6;\">fill<\/span>(<span style=\"color: #d1d4dc;\">l1<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">l2<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">100<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; <span style=\"color: #f57f17;\">50<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #d1d4dc;\">DnCol<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">60<\/span>)<span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #f77c80;\">chart.bg_color<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">30<\/span>)) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div><span style=\"color: #5b9cf6;\">fill<\/span>(<span style=\"color: #d1d4dc;\">l4<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">l3<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">-50<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">-100<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #f77c80;\">chart.bg_color<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">30<\/span>)<span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #5b9cf6;\">color.new<\/span>(<span style=\"color: #d1d4dc;\">UpCol<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">60<\/span>) &nbsp; &nbsp; ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<div><span style=\"color: #5b9cf6;\">barcolor<\/span>(<span style=\"color: #d1d4dc;\">barcol<\/span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<p><\/p>\n<div><span style=\"color: #d1d4dc;\">symbol<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #388e3c;\">&#8220;CKR [QuantraSystems] &gt;&gt;&gt; {{exchange}}:{{ticker}}&#8221;<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Fast Trend Alerts<\/span><\/div>\n<div><span style=\"color: #5b9cf6;\">alertcondition<\/span>(<span style=\"color: #d1d4dc;\">fastTrend_up<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Fast Positive Trend&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #d1d4dc;\">symbol<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #388e3c;\">&#8221; &#8211; Fast Positive Trend!&#8221;<\/span> )<\/div>\n<div><span style=\"color: #5b9cf6;\">alertcondition<\/span>(<span style=\"color: #d1d4dc;\">fastTrend_dn<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Fast Negative Trend&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #d1d4dc;\">symbol<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #388e3c;\">&#8221; &#8211; Fast Negative Trend!&#8221;<\/span> )<\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Slow Trend Alerts &nbsp;<\/span><\/div>\n<div><span style=\"color: #5b9cf6;\">alertcondition<\/span>(<span style=\"color: #d1d4dc;\">slowTrend_up<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Slow Positive Trend&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #d1d4dc;\">symbol<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #388e3c;\">&#8221; &#8211; Slow Positive Trend!&#8221;<\/span> )<\/div>\n<div><span style=\"color: #5b9cf6;\">alertcondition<\/span>(<span style=\"color: #d1d4dc;\">slowTrend_dn<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #388e3c;\">&#8220;Slow Negative Trend&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp;<span style=\"color: #d1d4dc;\">symbol<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #388e3c;\">&#8221; &#8211; Slow Negative Trend!&#8221;<\/span> )<\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Combined Alerts<\/span><\/div>\n<div><span style=\"color: #5b9cf6;\">alertcondition<\/span>(<span style=\"color: #d1d4dc;\">fastTrend<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Fast Trend Shift&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">symbol<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #388e3c;\">&#8221; &#8211; Fast Trend Shift!&#8221;<\/span> &nbsp; &nbsp;)<\/div>\n<div><span style=\"color: #5b9cf6;\">alertcondition<\/span>(<span style=\"color: #d1d4dc;\">slowTrend<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp;<span style=\"color: #388e3c;\">&#8220;Slow Trend Shift&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> &nbsp; &nbsp; <span style=\"color: #d1d4dc;\">symbol<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #388e3c;\">&#8221; &#8211; Slow Trend Shift!&#8221;<\/span> &nbsp; &nbsp;)<\/div>\n<p><\/p>\n<div>&nbsp; &nbsp; <span style=\"color: #787b86;\">\/\/ Define Buy Exit condition<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">uptrend_condition<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">oversold<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">downtrend_condition<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">overbought<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ Strategy entry and exit conditions<\/span><\/div>\n<div><span style=\"color: #42bda8;\">if<\/span> (<span style=\"color: #d1d4dc;\">uptrend_condition<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">strategy.entry<\/span>(<span style=\"color: #388e3c;\">&#8220;Buy&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">strategy.long<\/span>)<\/div>\n<div>&nbsp; &nbsp; <\/div>\n<div><span style=\"color: #42bda8;\">if<\/span> (<span style=\"color: #d1d4dc;\">downtrend_condition<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">strategy.close<\/span>(<span style=\"color: #388e3c;\">&#8220;Buy&#8221;<\/span>)<\/div>\n<p><\/div>\n<p><\/p>\n<p>*Feel free to share your different settings in the comment section<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;This pine script is adapted from Cosine Kernel Regression by QuantraSystems. Credit goes to this brilliant script writer.&nbsp; The Cosine Kernel Regressions indicator (CKR) uses mathematical concepts to offer a<\/p>\n<p><a href=\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/\" class=\"btn btn-skin btn-radius\">Continue Reading<span class=\"screen-reader-text\">New Pine Script: Cosine Kernel Regression<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-pine-script-strategy","tag-pine-script-strategy"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>New Pine Script: Cosine Kernel Regression - kriptos.my<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New Pine Script: Cosine Kernel Regression - kriptos.my\" \/>\n<meta property=\"og:description\" content=\"&nbsp;This pine script is adapted from Cosine Kernel Regression by QuantraSystems. Credit goes to this brilliant script writer.&nbsp; The Cosine Kernel Regressions indicator (CKR) uses mathematical concepts to offer aContinue ReadingNew Pine Script: Cosine Kernel Regression\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/\" \/>\n<meta property=\"og:site_name\" content=\"kriptos.my\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-22T13:57:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-21T15:30:05+00:00\" \/>\n<meta name=\"author\" content=\"kriptos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kriptos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"23 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/\"},\"author\":{\"name\":\"kriptos\",\"@id\":\"https:\/\/kriptos.my\/#\/schema\/person\/ab6ae0f7dc407600d321d44b02da9556\"},\"headline\":\"New Pine Script: Cosine Kernel Regression\",\"datePublished\":\"2024-06-22T13:57:00+00:00\",\"dateModified\":\"2025-06-21T15:30:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/\"},\"wordCount\":4655,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kriptos.my\/#organization\"},\"image\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg\",\"keywords\":[\"Pine Script Strategy\"],\"articleSection\":[\"Pine Script Strategy\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/\",\"url\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/\",\"name\":\"New Pine Script: Cosine Kernel Regression - kriptos.my\",\"isPartOf\":{\"@id\":\"https:\/\/kriptos.my\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg\",\"datePublished\":\"2024-06-22T13:57:00+00:00\",\"dateModified\":\"2025-06-21T15:30:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#primaryimage\",\"url\":\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg\",\"contentUrl\":\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kriptos.my\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New Pine Script: Cosine Kernel Regression\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kriptos.my\/#website\",\"url\":\"https:\/\/kriptos.my\/\",\"name\":\"kriptos.my\",\"description\":\"Trading Bot Enthusiast\",\"publisher\":{\"@id\":\"https:\/\/kriptos.my\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kriptos.my\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kriptos.my\/#organization\",\"name\":\"kriptos.my\",\"url\":\"https:\/\/kriptos.my\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kriptos.my\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kriptos.my\/wp-content\/uploads\/2025\/06\/cropped-kriptosmy-perkataan.png\",\"contentUrl\":\"https:\/\/kriptos.my\/wp-content\/uploads\/2025\/06\/cropped-kriptosmy-perkataan.png\",\"width\":872,\"height\":199,\"caption\":\"kriptos.my\"},\"image\":{\"@id\":\"https:\/\/kriptos.my\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kriptos.my\/#\/schema\/person\/ab6ae0f7dc407600d321d44b02da9556\",\"name\":\"kriptos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kriptos.my\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a20605acecdd9f3d901b43544301ee4d59d4b1755e81596045ff947403d36442?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a20605acecdd9f3d901b43544301ee4d59d4b1755e81596045ff947403d36442?s=96&d=mm&r=g\",\"caption\":\"kriptos\"},\"url\":\"https:\/\/kriptos.my\/index.php\/author\/08464702926718497666\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New Pine Script: Cosine Kernel Regression - kriptos.my","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:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/","og_locale":"en_US","og_type":"article","og_title":"New Pine Script: Cosine Kernel Regression - kriptos.my","og_description":"&nbsp;This pine script is adapted from Cosine Kernel Regression by QuantraSystems. Credit goes to this brilliant script writer.&nbsp; The Cosine Kernel Regressions indicator (CKR) uses mathematical concepts to offer aContinue ReadingNew Pine Script: Cosine Kernel Regression","og_url":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/","og_site_name":"kriptos.my","article_published_time":"2024-06-22T13:57:00+00:00","article_modified_time":"2025-06-21T15:30:05+00:00","author":"kriptos","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kriptos","Est. reading time":"23 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#article","isPartOf":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/"},"author":{"name":"kriptos","@id":"https:\/\/kriptos.my\/#\/schema\/person\/ab6ae0f7dc407600d321d44b02da9556"},"headline":"New Pine Script: Cosine Kernel Regression","datePublished":"2024-06-22T13:57:00+00:00","dateModified":"2025-06-21T15:30:05+00:00","mainEntityOfPage":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/"},"wordCount":4655,"commentCount":0,"publisher":{"@id":"https:\/\/kriptos.my\/#organization"},"image":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#primaryimage"},"thumbnailUrl":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg","keywords":["Pine Script Strategy"],"articleSection":["Pine Script Strategy"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/","url":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/","name":"New Pine Script: Cosine Kernel Regression - kriptos.my","isPartOf":{"@id":"https:\/\/kriptos.my\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#primaryimage"},"image":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#primaryimage"},"thumbnailUrl":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg","datePublished":"2024-06-22T13:57:00+00:00","dateModified":"2025-06-21T15:30:05+00:00","breadcrumb":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#primaryimage","url":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg","contentUrl":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgGXht60Ytpi9ECzlL_bbWfc6HSONcHd8ufuouI8XEXQhplvGizentc5ixYfjybcLPHl4wtKckRYRoM5nWdCoZD0efZsLfXkhij8VocR12KrAgItdhbWHfbIMw_9xfdKnE-TATxgtm7EssFsS-jfNrtzEQO4LSsFWW3NobwP8V8tXpm0_AqMgqXR-oLF1xd\/s320\/Cosine%20kernel%20Reg.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/kriptos.my\/index.php\/2024\/06\/22\/new-pine-script-cosine-kernel-regression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kriptos.my\/"},{"@type":"ListItem","position":2,"name":"New Pine Script: Cosine Kernel Regression"}]},{"@type":"WebSite","@id":"https:\/\/kriptos.my\/#website","url":"https:\/\/kriptos.my\/","name":"kriptos.my","description":"Trading Bot Enthusiast","publisher":{"@id":"https:\/\/kriptos.my\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kriptos.my\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kriptos.my\/#organization","name":"kriptos.my","url":"https:\/\/kriptos.my\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kriptos.my\/#\/schema\/logo\/image\/","url":"https:\/\/kriptos.my\/wp-content\/uploads\/2025\/06\/cropped-kriptosmy-perkataan.png","contentUrl":"https:\/\/kriptos.my\/wp-content\/uploads\/2025\/06\/cropped-kriptosmy-perkataan.png","width":872,"height":199,"caption":"kriptos.my"},"image":{"@id":"https:\/\/kriptos.my\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kriptos.my\/#\/schema\/person\/ab6ae0f7dc407600d321d44b02da9556","name":"kriptos","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kriptos.my\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a20605acecdd9f3d901b43544301ee4d59d4b1755e81596045ff947403d36442?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a20605acecdd9f3d901b43544301ee4d59d4b1755e81596045ff947403d36442?s=96&d=mm&r=g","caption":"kriptos"},"url":"https:\/\/kriptos.my\/index.php\/author\/08464702926718497666\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":0,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"wp:attachment":[{"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}