<span class="token comment" spellcheck="true">//PRC_QEMA | indicator</span>
<span class="token comment" spellcheck="true">//23.01.2017</span>
<span class="token comment" spellcheck="true">//Nicolas @ www.prorealcode.com</span>
<span class="token comment" spellcheck="true">//Sharing ProRealTime knowledge</span>
<span class="token comment" spellcheck="true">//--- parameters</span>
<span class="token comment" spellcheck="true">// period = 14</span>
<span class="token comment" spellcheck="true">// method = MOVING AVERAGE TYPE</span>
<span class="token comment" spellcheck="true">// ---</span>
Price<span class="token operator">=</span>customclose
MA1<span class="token operator">=</span><span class="token indicators">Average</span><span class="token punctuation">[</span>period<span class="token punctuation">,</span>method<span class="token punctuation">]</span><span class="token punctuation">(</span>Price<span class="token punctuation">)</span>
MA2<span class="token operator">=</span><span class="token indicators">Average</span><span class="token punctuation">[</span>period<span class="token punctuation">,</span>method<span class="token punctuation">]</span><span class="token punctuation">(</span>MA1<span class="token punctuation">)</span>
MA3<span class="token operator">=</span><span class="token indicators">Average</span><span class="token punctuation">[</span>period<span class="token punctuation">,</span>method<span class="token punctuation">]</span><span class="token punctuation">(</span>MA2<span class="token punctuation">)</span>
MA4<span class="token operator">=</span><span class="token indicators">Average</span><span class="token punctuation">[</span>period<span class="token punctuation">,</span>method<span class="token punctuation">]</span><span class="token punctuation">(</span>MA3<span class="token punctuation">)</span>
MA5<span class="token operator">=</span><span class="token indicators">Average</span><span class="token punctuation">[</span>period<span class="token punctuation">,</span>method<span class="token punctuation">]</span><span class="token punctuation">(</span>MA4<span class="token punctuation">)</span>
QEMA<span class="token operator">=</span><span class="token number">5</span><span class="token operator">*</span>MA1<span class="token number">-10</span><span class="token operator">*</span>MA2<span class="token operator">+</span><span class="token number">10</span><span class="token operator">*</span>MA3<span class="token number">-5</span><span class="token operator">*</span>MA4<span class="token operator">+</span>MA5
<span class="token keyword">RETURN</span> QEMA <span class="token keyword">as</span> <span class="token string">"Quadruple Exponential Moving Average indicator"</span>