[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confluence(function)



PureBytes Links

Trading Reference Links

When I tried to verify, I got "derivativema" not recognized...... ???

Robert W Cummings wrote:

> Seems some people are having problems with this function.
> This was written for ts4.
>
> Indicator coming next;;;
>
> Robert
>
> {Function: Confluence
>   Returns a value from -9 to +9.
>   -9 to -1:  bearish
>   -0.9 to +0.9:  "yellow"
>   1 to 9:  bullish
>
>  Written by Dale Legan <dlegan@xxxxxxxxx>
> }
>
> Input: price(Numeric),Harmonic(Numeric);
>
> vars: STL(0),ITL(0),LTL(0),HOFF(0),SOFF(0),IOFF(0),LTOFF(0),Phase(1);
> vars: mtl(0),momsig(0),mom(0),HT(0),HTA(0);
> vars:
> ST(0),STA(0),IT(0),ITA(0),SUM(0),ERR(0),ERRSUM(0),ERRSIG(0),TC(0),TCSIG(0);
> vars: ERRNUM(0),MOMNUM(0),TCNUM(0);
> Vars: Havg(0), Savg(0), Iavg(0), Lavg(0);
>
> {Calculate Lengths}
> if (BarNumber = 1) then begin
>   MTL=harmonic/2;
>   STL= IntPortion((harmonic*2)-1);  {11}
>   ITL= IntPortion((STL*2)-1);             {21}
>   LTL= IntPortion((ITL*2)-1);              {41}
>
>   HOFF=intportion(harmonic/2);     {3}
>   SOFF=intportion(STL/2);               {5}
>   IOFF=intportion(ITL/2);                 {10}
>   LTOFF=intportion(LTL/2);             {20}
>   end;
>
> { Averages }
>
> Havg = average(price, Harmonic);
> Savg = average(price, STL);
> Iavg = average(price, ITL);
> Lavg = average(price, LTL);
>
> {Cycle Momentum}
>
> value2 = Savg - Havg[HOFF];
> value3 = Iavg - Savg[SOFF];
> value12 = Lavg - Iavg[IOFF];
>
> momsig = value2 + value3 + value12;  {Momentum Signal Line}
>
> value5= ((summation(price,harmonic-1) +
> derivativema(price,harmonic))/harmonic);
> value6= ((summation(price,STL-1) + derivativema(price,STL))/STL);
> value7= ((summation(price,ITL-1) + derivativema(price,ITL))/ITL);
> value13=((summation(avgprice,LTL-1) + derivativema(price,LTL))/LTL);
>
> value9 = value6 - value5[HOFF];
> value10=value7 - value6[SOFF];
> value14=value13 - value7[IOFF];
> mom = value9 + value10 + value14;

{{{{{ Snip }}}}}