{"id":2847,"date":"2022-07-02T07:22:00","date_gmt":"2022-07-02T07:22:00","guid":{"rendered":"https:\/\/www.overcharts.com\/it\/helpcenter\/?post_type=docs&#038;p=2847"},"modified":"2022-08-05T13:23:11","modified_gmt":"2022-08-05T13:23:11","password":"","slug":"overbasic-return","status":"publish","type":"docs","link":"https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-return\/","title":{"rendered":"Overbasic &#8211; Return"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">La parola chiave RETURN restituisce il risultato di una <a href=\"https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-function\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>funzione<\/strong><\/a>. Il tipo risultato (<em>Numeric<\/em>, <em>Boolean<\/em>, <em>String<\/em> ecc.) deve corrispondere al tipo dichiarato nella prima riga della funzione.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>RETURN \u00e8 obbligatoria<\/strong> in ogni funzione Overbasic! Senza RETURN la funzione non restituir\u00e0 alcun risultato.<\/li><li>Oltre a restituire il risultato,<a href=\"#2-toc-title\"> <strong>RETURN termina l&#8217;esecuzione della funzione<\/strong><\/a>.<\/li><\/ul>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Sintassi<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/strong><\/mark> &lt;espressione><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;espressione&gt; DEVE essere dello stesso tipo dichiarato nella prima riga della funzione.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Esempi<\/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\">Function<\/mark><\/strong> DoSomething() <mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong> 10 * 5 <mark style=\"background-color:rgba(0, 0, 0, 0);color:#3fad1d\" class=\"has-inline-color\">'restituisce un valore numeric<\/mark>\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong>\n\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Function<\/mark><\/strong><\/mark><\/strong> DoSomething() <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark><\/mark><\/strong>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Dim<\/mark><\/strong> i <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark><\/strong><\/mark> = 0\n    i = 10 * 5\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/mark><\/strong> i <mark style=\"background-color:rgba(0, 0, 0, 0);color:#3fad1d\" class=\"has-inline-color\">'restituisce un valore numeric<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/strong><\/mark>\n\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Function<\/mark><\/strong><\/mark><\/strong> DoSomething() <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark><\/mark><\/strong>()\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Dim<\/mark><\/strong><\/mark><\/strong> a <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark><\/strong><\/mark>()\n    a(1) = 10 * 5\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/mark><\/strong> a <mark style=\"background-color:rgba(0, 0, 0, 0);color:#3fad1d\" class=\"has-inline-color\">'restituisce un array numeric<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/strong><\/mark>\n\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Function<\/mark><\/strong><\/mark><\/strong> DoSomething() <mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Boolean<\/strong><\/mark>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Dim<\/mark><\/strong><\/mark><\/strong> b <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Boolean<\/strong><\/mark><\/strong><\/mark> = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">False<\/mark><\/strong>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">If<\/mark><\/strong><\/mark><\/strong> (Close > Open) <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Then<\/mark><\/strong>\n        b = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">True<\/mark><\/strong>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndIf<\/mark><\/strong><\/mark><\/strong>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/mark><\/strong> b <mark style=\"background-color:rgba(0, 0, 0, 0);color:#3fad1d\" class=\"has-inline-color\">'restituisce un valore boolean<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/strong><\/mark>\n\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Function<\/mark><\/strong><\/mark><\/strong> DoSomething() <mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>String<\/strong><\/mark>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/mark><\/strong> \"Hello!\" <mark style=\"background-color:rgba(0, 0, 0, 0);color:#3fad1d\" class=\"has-inline-color\">'restituisce un valore string<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/strong><\/mark><\/code><\/pre>\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>RETURN nella funzione Main<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In Overbasic esiste una funzione speciale denominata <strong><em>Main<\/em><\/strong>. La funzione Main \u00e8 la <strong>funzione principale dello script<\/strong> Overbasic. In altre parole, \u00e8 la funzione da dove inizia l&#8217;esecuzione dello script.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Function<\/mark><\/strong><\/mark><\/strong> <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Main<\/mark><\/strong>()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">La funzione Main non ha argomenti e nemmeno un tipo risultato definito. Il risultato dipende dal tipo di script.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Se lo script \u00e8 un <strong>indicatore<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>il risultato \u00e8 SEMPRE di tipo <strong><em>Numeric<\/em><\/strong><\/li><li>RETURN nella funzione MAIN pu\u00f2 restituire fino ad un<strong> massimo di 10 risultati<\/strong> contemporaneamente che corrisponderanno nel grafico dell&#8217;indicatore a 10 curve differenti.<\/li><li>quando RETURN restituisce solo <strong>1 risultato<\/strong> il <strong>nome identificativo NON<\/strong> \u00e8 <strong>obbligatorio<\/strong><\/li><li>quando RETURN restituisce <strong>pi\u00f9 di un risultato<\/strong> il <strong>nome identificativo<\/strong> \u00e8 <strong>obbligatorio<\/strong><\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/strong><\/mark> &lt;espressione1> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong><\/mark><\/strong><\/mark><\/strong><\/mark> &lt;nome1>, &lt;espressione2> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong><\/mark><\/strong><\/mark> &lt;nome2>, ... , &lt;espressione10> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong><\/mark><\/strong><\/mark> &lt;nome10><\/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>Esempi<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Function<\/mark><\/strong><\/mark><\/strong> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Main<\/mark><\/strong><\/strong><\/mark>()   \n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Dim<\/mark><\/strong><\/mark><\/strong> v1 <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark><\/strong><\/mark> = (Close + Open) \/ 2\n\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/mark><\/strong> v1\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/strong><\/mark>\n\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Function<\/mark><\/strong><\/mark><\/strong> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Main<\/mark><\/strong><\/strong><\/mark>()\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Dim<\/mark><\/strong><\/mark><\/strong> v1 <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark><\/strong><\/mark> = Open(-1)\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Dim<\/mark><\/strong><\/mark><\/strong> v2 <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark><\/strong><\/mark> = Close(-1)\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Dim<\/mark><\/strong><\/mark><\/strong> v3 <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Numeric<\/strong><\/mark><\/strong><\/mark> = (Close + Open) \/ 2\n\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/mark><\/strong> v1 <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">As<\/mark><\/strong> PrevOpen, v2 <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">As<\/mark><\/strong> PrevClose, v3 <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">As<\/mark><\/strong> CurrentMiddle\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/strong><\/mark><\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Se lo script \u00e8 un <strong>Trading System<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>il risultato \u00e8 SEMPRE di tipo <strong><em>Boolean<\/em><\/strong><\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\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\"><em>Per maggiori informazioni vedi la documentazione relativa agli indicatori utente e trading system.<\/em><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>La funzione Main viene chiamata automaticamente da Overcharts ogni volta che viene eseguito lo script. Per esempio, nel calcolo di un indicatore, lo script viene eseguito per ogni barra presente nel grafico di riferimento. Se il grafico di riferimento dell&#8217;indicatore contiene 100 barre, lo script verr\u00e0 eseguito 100 volte. L&#8217;esecuzione avverr\u00e0 anche ad ogni aggiornamento dati real time.<\/p><\/blockquote>\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>RETURN esce dalla funzione<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">RETURN, oltre a restituire il risultato della funzione, termina l&#8217;esecuzione della funzione stessa. In altre parole, tutte le istruzioni eventualmente inserite dopo Return NON saranno eseguite.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Function<\/mark><\/strong><\/mark><\/strong> DoSomething() <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Boolean<\/strong><\/mark><\/mark><\/strong>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Dim<\/mark><\/strong><\/mark><\/strong> b <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\"><strong>As<\/strong> <strong>Boolean<\/strong><\/mark><\/strong><\/mark> = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">False<\/mark><\/strong>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">If<\/mark><\/strong> (Close > Open) <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Then<\/mark><\/strong>\n        b = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">True<\/mark><\/strong>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndIf<\/mark><\/strong><\/mark><\/strong>\n    \n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/mark><\/strong><\/mark><\/strong> b <mark style=\"background-color:rgba(0, 0, 0, 0);color:#3fad1d\" class=\"has-inline-color\">'restituisce un valore boolean<\/mark>\n    \n    <mark style=\"background-color:rgba(0, 0, 0, 0);color:#3fad1d\" class=\"has-inline-color\">'Tutte le istruzioni successive a Return NON saranno mai eseguite<\/mark>\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">If<\/mark><\/strong><\/mark><\/strong> (High > High(-1)) <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Then<\/mark><\/strong><\/mark><\/strong>\n        b = <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">True<\/mark><\/strong><\/mark><\/strong>\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)\" class=\"has-inline-color has-primary-color\"><strong><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndFunction<\/mark><\/strong><\/strong><\/mark><\/code><\/pre>\n\n\n\n<div style=\"height:29px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Negli Event:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Gli Event sono procedure particolari chiamate automaticamente dallo script Overbasic al verificarsi di certi eventi. Negli event la parola chiave RETURN non restituisce alcun risultato. Pu\u00f2 tuttavia essere utilizzata per uscire dalla procedura.<\/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\">Event<\/mark><\/strong> OnProcess()\n    ...\n    &lt;istruzioni>\n    ...\n    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">Return<\/mark><\/strong><\/mark><\/strong>\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0088cd\" class=\"has-inline-color\">EndEvent<\/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>La parola chiave RETURN restituisce il risultato di una funzione. Il tipo risultato (Numeric, Boolean, String ecc.) deve corrispondere al tipo dichiarato nella prima riga della funzione. RETURN \u00e8 obbligatoria in ogni funzione Overbasic! Senza RETURN la funzione non restituir\u00e0 alcun risultato. Oltre a restituire il risultato, RETURN termina l&#8217;esecuzione della funzione. Sintassi &lt;espressione&gt; DEVE [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[14],"doc_tag":[],"class_list":["post-2847","docs","type-docs","status-publish","hentry","doc_category-sintassi-parole-chiave"],"year_month":"2026-10","word_count":502,"total_views":"1","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Overcharts Team","author_nicename":"overadmin","author_url":"https:\/\/www.overcharts.com\/it\/helpcenter\/author\/overadmin\/"},"doc_category_info":[{"term_name":"Sintassi &amp; Parole Chiave","term_url":"https:\/\/www.overcharts.com\/it\/helpcenter\/docs-category\/sintassi-parole-chiave\/"}],"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 - Return - Overcharts Help Center<\/title>\r\n<meta name=\"description\" content=\"La parola chiave RETURN restituisce il risultato di una funzione.\" \/>\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\/it\/helpcenter\/docs\/overbasic-return\/\" \/>\r\n<meta property=\"og:locale\" content=\"it_IT\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Overbasic - Return - Overcharts Help Center\" \/>\r\n<meta property=\"og:description\" content=\"La parola chiave RETURN restituisce il risultato di una funzione.\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-return\/\" \/>\r\n<meta property=\"og:site_name\" content=\"Overcharts Help Center\" \/>\r\n<meta property=\"article:modified_time\" content=\"2022-08-05T13:23:11+00:00\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minuti\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/docs\\\/overbasic-return\\\/\",\"url\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/docs\\\/overbasic-return\\\/\",\"name\":\"Overbasic - Return - Overcharts Help Center\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/#website\"},\"datePublished\":\"2022-07-02T07:22:00+00:00\",\"dateModified\":\"2022-08-05T13:23:11+00:00\",\"description\":\"La parola chiave RETURN restituisce il risultato di una funzione.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/docs\\\/overbasic-return\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/docs\\\/overbasic-return\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/docs\\\/overbasic-return\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Overbasic &#8211; Return\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/#website\",\"url\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/\",\"name\":\"Overcharts Help Center\",\"description\":\"Piattaforma di Trading e Analisi Tecnica\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.overcharts.com\\\/it\\\/helpcenter\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Overbasic - Return - Overcharts Help Center","description":"La parola chiave RETURN restituisce il risultato di una funzione.","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\/it\/helpcenter\/docs\/overbasic-return\/","og_locale":"it_IT","og_type":"article","og_title":"Overbasic - Return - Overcharts Help Center","og_description":"La parola chiave RETURN restituisce il risultato di una funzione.","og_url":"https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-return\/","og_site_name":"Overcharts Help Center","article_modified_time":"2022-08-05T13:23:11+00:00","twitter_card":"summary_large_image","twitter_misc":{"Tempo di lettura stimato":"3 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-return\/","url":"https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-return\/","name":"Overbasic - Return - Overcharts Help Center","isPartOf":{"@id":"https:\/\/www.overcharts.com\/it\/helpcenter\/#website"},"datePublished":"2022-07-02T07:22:00+00:00","dateModified":"2022-08-05T13:23:11+00:00","description":"La parola chiave RETURN restituisce il risultato di una funzione.","breadcrumb":{"@id":"https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-return\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-return\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.overcharts.com\/it\/helpcenter\/docs\/overbasic-return\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.overcharts.com\/it\/helpcenter\/"},{"@type":"ListItem","position":2,"name":"Overbasic &#8211; Return"}]},{"@type":"WebSite","@id":"https:\/\/www.overcharts.com\/it\/helpcenter\/#website","url":"https:\/\/www.overcharts.com\/it\/helpcenter\/","name":"Overcharts Help Center","description":"Piattaforma di Trading e Analisi Tecnica","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.overcharts.com\/it\/helpcenter\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"}]}},"_links":{"self":[{"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/docs\/2847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/comments?post=2847"}],"version-history":[{"count":20,"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/docs\/2847\/revisions"}],"predecessor-version":[{"id":2957,"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/docs\/2847\/revisions\/2957"}],"wp:attachment":[{"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/media?parent=2847"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/doc_category?post=2847"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.overcharts.com\/it\/helpcenter\/wp-json\/wp\/v2\/doc_tag?post=2847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}