{"id":110,"date":"2013-04-30T07:51:00","date_gmt":"2013-04-30T07:51:00","guid":{"rendered":"http:\/\/zerodha.com\/z-connect\/?p=277"},"modified":"2024-02-02T15:56:26","modified_gmt":"2024-02-02T10:26:26","slug":"managing-your-script","status":"publish","type":"post","link":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script","title":{"rendered":"Managing your Script"},"content":{"rendered":"<p>Traders,<\/p>\n<p>We are taking all your queries on writing your script\/strategy on algoZ in the blog, &#8220;Code your Technical Analysis Strategy&#8221;. I have gotten a few queries like, &#8220;Once you have written a script, what next?&#8221; Though it is explained in the user manual, let me show you below how to take the strategy live, how to run\/stop it, how to have a preset stop loss, and more&#8230;<\/p>\n<p>In the simple example, we had used a really basic strategy which was on a 14-candle EMA. So, basically, the strategy is &#8220;buy&#8221; if the price of the stock goes over the 14 EMA and &#8220;sell&#8221; if it goes under. The problem with a strategy like this is that if you are looking at a 1-minute\/5-minute\/hourly candle, this crossover will happen quite frequently giving a lot of trades. In the simple example, we had gotten 823 trades over a 22-day period\u00a0in the backtesting report which is pretty high by any standards.<\/p>\n<p>To explain how to manage your script, I will use another example, the one that has been asked in the tutorial blog by one of you.<\/p>\n<p>Strategy: The same 14 EMA crossover as mentioned in the example above, but we use RSI as a filter. Typically, RSI below 30 means that it is getting oversold and if above 70 it is getting overbought. So what we want to do is buy\/sell on 14 EMA crossover but buy if RSI is below 45 and\u00a0sell if RSI is above 55.<\/p>\n<p>Here&#8217;s the script:<\/p>\n<p>Buy Expression: Close&gt;EMA(Close,14) AND RSI(Close,14)&lt;45<\/p>\n<p>Sell Expression: Close&lt;EMA(Close,14) AND RSI(Close,14)&gt;55<\/p>\n<p>Buy exit : 0<\/p>\n<p>Sell exit: 0<\/p>\n<p>Contract: Nifty Futures.<\/p>\n<p>The script window will look like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"795\" height=\"338\" class=\"alignnone size-full wp-image-1639\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b483dddb7d.png\" srcset=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b483dddb7d.png 795w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b483dddb7d-300x127.png 300w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/><\/p>\n<p><strong>Backtest Window<\/strong>: You will see that by having the RSI condition, the total number of trades in the 22-day period has dropped from 823 to 19, but the net profit on backtesting shows only 43 points. See the pic below. Also, if you notice in the backtest report the largest loss making trade was 200 points and this could have been controlled at 50 points by having a SL which would have improved the profitability of this strategy.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1370\" height=\"746\" class=\"alignnone size-full wp-image-1654\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b5161942c6.png\" srcset=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b5161942c6.png 1370w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b5161942c6-300x163.png 300w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b5161942c6-1024x557.png 1024w\" sizes=\"auto, (max-width: 1370px) 100vw, 1370px\" \/><\/p>\n<p><strong>Taking it live\/Alert Preference<\/strong>: As shown in the first example, when you click on the Live button you get a new window &#8220;Alert preference&#8221;, which is the menu to preset the Quantity\/SL\/Type of the order you want to execute when the strategy gives you a signal.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1047\" height=\"572\" class=\"alignnone size-full wp-image-1676\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b5e75b4a70.png\" srcset=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b5e75b4a70.png 1047w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b5e75b4a70-300x163.png 300w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b5e75b4a70-1024x559.png 1024w\" sizes=\"auto, (max-width: 1047px) 100vw, 1047px\" \/><\/p>\n<p>Managing your script once you have taken it live:<\/p>\n<p>In the pic above, once you have clicked on submit, the strategy goes live. To see all the live scripts\/strategies that you are running on your account you can go to the link shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1157\" height=\"647\" class=\"alignnone size-full wp-image-1679\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b606d14ef9.png\" srcset=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b606d14ef9.png 1157w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b606d14ef9-300x167.png 300w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b606d14ef9-1024x572.png 1024w\" sizes=\"auto, (max-width: 1157px) 100vw, 1157px\" \/><\/p>\n<p>Once you click on Pulse Running Scripts you will get the window as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1259\" height=\"681\" class=\"alignnone size-full wp-image-1688\" alt=\"\" src=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b63f265b15.png\" srcset=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b63f265b15.png 1259w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b63f265b15-300x162.png 300w, https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/11\/img_527b63f265b15-1024x553.png 1024w\" sizes=\"auto, (max-width: 1259px) 100vw, 1259px\" \/><\/p>\n<p>Once you have taken a strategy live, all you have to do now is wait for the buy\/sell alerts to pop up. If you click &#8220;Act on Alert&#8221; an order is placed based on your alert preference as shown above.<\/p>\n<p>Happy Coding,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Traders, We are taking all your queries on writing your script\/strategy on algoZ in the blog, &#8220;Code your Technical Analysis Strategy&#8221;. I have gotten a few queries like, &#8220;Once you have written a script, what next?&#8221; Though it is explained in the user manual, let me show you below how to take the strategy live, [&hellip;]<\/p>\n","protected":false},"author":176551,"featured_media":2055,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[531],"tags":[186],"class_list":["post-110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general","tag-algoz"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.5 (Yoast SEO v26.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Managing your Script &#8211; Z-Connect by Zerodha<\/title>\n<meta name=\"description\" content=\"Traders, We are taking all your queries on writing your script\/strategy on algoZ in the blog, &quot;Code your Technical Analysis Strategy&quot;. I have gotten a few\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Managing your Script\" \/>\n<meta property=\"og:description\" content=\"Traders, We are taking all your queries on writing your script\/strategy on algoZ in the blog, &quot;Code your Technical Analysis Strategy&quot;. I have gotten a few\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script\" \/>\n<meta property=\"og:site_name\" content=\"Z-Connect by Zerodha\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/zerodha.social\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/zerodha.social\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-30T07:51:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-02T10:26:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png\" \/>\n\t<meta property=\"og:image:width\" content=\"708\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Team Zerodha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@zerodhaonline\" \/>\n<meta name=\"twitter:site\" content=\"@zerodhaonline\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Team Zerodha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script\",\"url\":\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script\",\"name\":\"Managing your Script &#8211; Z-Connect by Zerodha\",\"isPartOf\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#primaryimage\"},\"image\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#primaryimage\"},\"thumbnailUrl\":\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png\",\"datePublished\":\"2013-04-30T07:51:00+00:00\",\"dateModified\":\"2024-02-02T10:26:26+00:00\",\"author\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/ab459269e8365cddd9d34c1885428210\"},\"description\":\"Traders, We are taking all your queries on writing your script\/strategy on algoZ in the blog, \\\"Code your Technical Analysis Strategy\\\". I have gotten a few\",\"breadcrumb\":{\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#primaryimage\",\"url\":\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png\",\"contentUrl\":\"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png\",\"width\":708,\"height\":350},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zerodha.com\/z-connect\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\/\/zerodha.com\/z-connect\/category\/general\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Managing your Script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/#website\",\"url\":\"https:\/\/zerodha.com\/z-connect\/\",\"name\":\"Zerodha product and business updates\",\"description\":\"Z-Connect is Zerodha&#039;s official blog. Get the latest updates, product announcements news, and insights all in one place.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zerodha.com\/z-connect\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/ab459269e8365cddd9d34c1885428210\",\"name\":\"Team Zerodha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/48197431b96187c109ad9cec95277dad5d96c853020ea2b0f26c675792bd17a5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/48197431b96187c109ad9cec95277dad5d96c853020ea2b0f26c675792bd17a5?s=96&d=mm&r=g\",\"caption\":\"Team Zerodha\"},\"description\":\"Simple and secure, no nonsense investing and trading.\",\"sameAs\":[\"https:\/\/facebook.com\/zerodha.social\",\"https:\/\/x.com\/zerodhaonline\"],\"url\":\"https:\/\/zerodha.com\/z-connect\/author\/team-zerodha\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Managing your Script &#8211; Z-Connect by Zerodha","description":"Traders, We are taking all your queries on writing your script\/strategy on algoZ in the blog, \"Code your Technical Analysis Strategy\". I have gotten a few","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script","og_locale":"en_US","og_type":"article","og_title":"Managing your Script","og_description":"Traders, We are taking all your queries on writing your script\/strategy on algoZ in the blog, \"Code your Technical Analysis Strategy\". I have gotten a few","og_url":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script","og_site_name":"Z-Connect by Zerodha","article_publisher":"https:\/\/www.facebook.com\/zerodha.social","article_author":"https:\/\/facebook.com\/zerodha.social","article_published_time":"2013-04-30T07:51:00+00:00","article_modified_time":"2024-02-02T10:26:26+00:00","og_image":[{"width":708,"height":350,"url":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png","type":"image\/png"}],"author":"Team Zerodha","twitter_card":"summary_large_image","twitter_creator":"@zerodhaonline","twitter_site":"@zerodhaonline","twitter_misc":{"Written by":"Team Zerodha","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script","url":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script","name":"Managing your Script &#8211; Z-Connect by Zerodha","isPartOf":{"@id":"https:\/\/zerodha.com\/z-connect\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#primaryimage"},"image":{"@id":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#primaryimage"},"thumbnailUrl":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png","datePublished":"2013-04-30T07:51:00+00:00","dateModified":"2024-02-02T10:26:26+00:00","author":{"@id":"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/ab459269e8365cddd9d34c1885428210"},"description":"Traders, We are taking all your queries on writing your script\/strategy on algoZ in the blog, \"Code your Technical Analysis Strategy\". I have gotten a few","breadcrumb":{"@id":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zerodha.com\/z-connect\/general\/managing-your-script"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#primaryimage","url":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png","contentUrl":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png","width":708,"height":350},{"@type":"BreadcrumbList","@id":"https:\/\/zerodha.com\/z-connect\/general\/managing-your-script#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zerodha.com\/z-connect\/"},{"@type":"ListItem","position":2,"name":"General","item":"https:\/\/zerodha.com\/z-connect\/category\/general"},{"@type":"ListItem","position":3,"name":"Managing your Script"}]},{"@type":"WebSite","@id":"https:\/\/zerodha.com\/z-connect\/#website","url":"https:\/\/zerodha.com\/z-connect\/","name":"Zerodha product and business updates","description":"Z-Connect is Zerodha&#039;s official blog. Get the latest updates, product announcements news, and insights all in one place.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zerodha.com\/z-connect\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/ab459269e8365cddd9d34c1885428210","name":"Team Zerodha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zerodha.com\/z-connect\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/48197431b96187c109ad9cec95277dad5d96c853020ea2b0f26c675792bd17a5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/48197431b96187c109ad9cec95277dad5d96c853020ea2b0f26c675792bd17a5?s=96&d=mm&r=g","caption":"Team Zerodha"},"description":"Simple and secure, no nonsense investing and trading.","sameAs":["https:\/\/facebook.com\/zerodha.social","https:\/\/x.com\/zerodhaonline"],"url":"https:\/\/zerodha.com\/z-connect\/author\/team-zerodha"}]}},"jetpack_featured_media_url":"https:\/\/zerodha.com\/z-connect\/wp-content\/uploads\/2013\/04\/script.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/users\/176551"}],"replies":[{"embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":6,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":2057,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/posts\/110\/revisions\/2057"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/media\/2055"}],"wp:attachment":[{"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zerodha.com\/z-connect\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}