{"id":1989,"date":"2022-07-08T09:50:00","date_gmt":"2022-07-08T09:50:00","guid":{"rendered":"https:\/\/www.overcharts.com\/en\/helpcenter\/?post_type=docs&#038;p=1989"},"modified":"2023-07-14T09:06:45","modified_gmt":"2023-07-14T09:06:45","password":"","slug":"overbasic-option","status":"publish","type":"docs","link":"https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/","title":{"rendered":"Overbasic &#8211; Option"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The OPTION keyword is used to define a special numeric property that can be optimized during the trading-system backtesting. Options can in fact be used ONLY in trading systems.<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#fff36b\">Options can be used ONLY in trading systems<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An option is a numeric property with a specific validity range. The difference with the other PROPERTYs is that it can be optimized during the trading system backtesting (performed by Tester application). In other words, backtesting will automatically test all the values that an Option can assume (from minimum to maximum by adding the step value to each new test), trying to identify the Option value that produces best results in the trading system.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Syntax<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Option<\/mark><\/strong> &lt;option name&gt; (&lt;minimum value&gt;, &lt;maximum value&gt;, &lt;step&gt;, &#91;\"&lt;description&gt;\"])<\/code><\/pre>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#fff36b\">Options can be defined exclusively in the <strong>Common Module<\/strong> of trading systems<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An Option is defined by <strong>OPTION<\/strong> keyword and the following attributes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Option Name<\/strong>: defines Option name. The name will identify the Option internally and externally to the script.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Minimum Value<\/strong>: Option minimum value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Maximum Value<\/strong>: Option maximum value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step<\/strong>: defines the increase in value of the Option during the backtesting. For example, if minimum value is 2, maximum value is 14 and step is 4, during the backtesting the Option will assume the values: 2, 6, 10, 14. The fundamental rule is that (Maximum Value &#8211; Minimum Value) must be a multiple of Step. In the example, 14 &#8211; 2 = 12, and 12 is a multiple of 4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Description<\/strong>: (optional) Option short description which will be shown for example in the trading system configuration property grid.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Usage<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An Option is used internally and externally to the script like any property. So externally you will have to set it in the trading system configuration window, inside the script you will use it as any &#8220;read only&#8221; variable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s consider a trading system that generates buy\/sell signals depending on up\/down crossing of two moving averages built on different periods. The significant parameters of this trading system are the periods on which to calculate the moving averages. To find the best value of the two periods we will therefore use two Options and test the trading system with the Tester application, which will assign all possible combinations of values to the two Options, finding the ones that produced best results.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Common Module<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Option<\/mark><\/strong> MM1(5, 30, 1, \"Period of Moving Average 1\")\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Option<\/mark><\/strong> MM2(5, 50, 1, \"Period of Moving Average 2\")<\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Long Entry<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>Function<\/strong> <strong>Main<\/strong><\/mark>()\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">If<\/mark><\/strong> (my.Analysistool.Crossabove(Mov(Close, MM1), Mov(Close, MM2)) = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">True<\/mark><\/strong>) <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Then<\/mark><\/strong>\n        <mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>Return<\/strong> <strong>True<\/strong><\/mark>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndIf<\/mark><\/strong>\n    <mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>Return<\/strong> <strong>False<\/strong><\/mark>\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Short Entry<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>Function<\/strong> <strong>Main<\/strong><\/mark>()\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">If<\/mark><\/strong> (my.Analysistool.Crossbelow(Mov(Close, MM1), Mov(Close, MM2)) = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">True<\/mark><\/strong>) <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Then<\/mark><\/strong>\n        <mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>Return<\/strong> <strong>True<\/strong><\/mark>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndIf<\/mark><\/strong>\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>    Return<\/strong> <strong>False<\/strong><\/mark>\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/code><\/pre>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The OPTION keyword is used to define a special numeric property that can be optimized during the trading-system backtesting. Options can in fact be used ONLY in trading systems. Options can be used ONLY in trading systems An option is a numeric property with a specific validity range. The difference with the other PROPERTYs is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[16],"doc_tag":[],"class_list":["post-1989","docs","type-docs","status-publish","hentry","doc_category-syntax-keywords"],"year_month":"2026-10","word_count":439,"total_views":"2","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Overcharts Team","author_nicename":"overadmin","author_url":"https:\/\/www.overcharts.com\/en\/helpcenter\/author\/overadmin\/"},"doc_category_info":[{"term_name":"Syntax &amp; Keywords","term_url":"https:\/\/www.overcharts.com\/en\/helpcenter\/docs-category\/syntax-keywords\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>Overbasic - Option - Overcharts Help Center<\/title>\r\n<meta name=\"description\" content=\"The OPTION keyword is used to define a special numeric property that can be optimized during the trading-system backtesting.\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Overbasic - Option - Overcharts Help Center\" \/>\r\n<meta property=\"og:description\" content=\"The OPTION keyword is used to define a special numeric property that can be optimized during the trading-system backtesting.\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/\" \/>\r\n<meta property=\"og:site_name\" content=\"Overcharts Help Center\" \/>\r\n<meta property=\"article:modified_time\" content=\"2023-07-14T09:06:45+00:00\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/docs\\\/overbasic-option\\\/\",\"url\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/docs\\\/overbasic-option\\\/\",\"name\":\"Overbasic - Option - Overcharts Help Center\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/#website\"},\"datePublished\":\"2022-07-08T09:50:00+00:00\",\"dateModified\":\"2023-07-14T09:06:45+00:00\",\"description\":\"The OPTION keyword is used to define a special numeric property that can be optimized during the trading-system backtesting.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/docs\\\/overbasic-option\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/docs\\\/overbasic-option\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/docs\\\/overbasic-option\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Overbasic &#8211; Option\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/#website\",\"url\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/\",\"name\":\"Overcharts Help Center\",\"description\":\"Trading Software &amp; Technical Analysis\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.overcharts.com\\\/en\\\/helpcenter\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Overbasic - Option - Overcharts Help Center","description":"The OPTION keyword is used to define a special numeric property that can be optimized during the trading-system backtesting.","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:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/","og_locale":"en_US","og_type":"article","og_title":"Overbasic - Option - Overcharts Help Center","og_description":"The OPTION keyword is used to define a special numeric property that can be optimized during the trading-system backtesting.","og_url":"https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/","og_site_name":"Overcharts Help Center","article_modified_time":"2023-07-14T09:06:45+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/","url":"https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/","name":"Overbasic - Option - Overcharts Help Center","isPartOf":{"@id":"https:\/\/www.overcharts.com\/en\/helpcenter\/#website"},"datePublished":"2022-07-08T09:50:00+00:00","dateModified":"2023-07-14T09:06:45+00:00","description":"The OPTION keyword is used to define a special numeric property that can be optimized during the trading-system backtesting.","breadcrumb":{"@id":"https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.overcharts.com\/en\/helpcenter\/docs\/overbasic-option\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.overcharts.com\/en\/helpcenter\/"},{"@type":"ListItem","position":2,"name":"Overbasic &#8211; Option"}]},{"@type":"WebSite","@id":"https:\/\/www.overcharts.com\/en\/helpcenter\/#website","url":"https:\/\/www.overcharts.com\/en\/helpcenter\/","name":"Overcharts Help Center","description":"Trading Software &amp; Technical Analysis","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.overcharts.com\/en\/helpcenter\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/docs\/1989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/comments?post=1989"}],"version-history":[{"count":19,"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/docs\/1989\/revisions"}],"predecessor-version":[{"id":2754,"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/docs\/1989\/revisions\/2754"}],"wp:attachment":[{"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/media?parent=1989"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/doc_category?post=1989"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.overcharts.com\/en\/helpcenter\/wp-json\/wp\/v2\/doc_tag?post=1989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}