EL error

Questions about MultiCharts and user contributed studies.
NiC72
Posts: 111
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

EL error

Postby NiC72 » 12 Sep 2010

The indicator is very small but I can not work .. Any suggestions?

/NiC

Code: Select all

Input: Period(Numeric);
AMA_Q = IFF(CurrentBar <= Period, Close, AMA_Q[1] + Power(((AbsValue(Close - Close[Period]) /
Summation(AbsValue(Close - Close[1]),period) * .6022) + .0645),2) * (Close - AMA_Q[1]))

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: EL error

Postby TJ » 12 Sep 2010

The indicator is very small but I can not work .. Any suggestions?

/NiC

Code: Select all

Input: Period(Numeric);
AMA_Q = IFF(CurrentBar <= Period, Close, AMA_Q[1] + Power(((AbsValue(Close - Close[Period]) /
Summation(AbsValue(Close - Close[1]),period) * .6022) + .0645),2) * (Close - AMA_Q[1]))

this is a function.

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: EL error

Postby sptrader » 12 Sep 2010

The indicator is very small but I can not work .. Any suggestions?

/NiC

Code: Select all

Input: Period(Numeric);
AMA_Q = IFF(CurrentBar <= Period, Close, AMA_Q[1] + Power(((AbsValue(Close - Close[Period]) /
Summation(AbsValue(Close - Close[1]),period) * .6022) + .0645),2) * (Close - AMA_Q[1]))

**********
Once you save the function above - you can plot the function on a chart with this indicator -

Input:Len(10);
Plot1(ama_q(len),"ama_q");

NiC72
Posts: 111
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

Re: EL error

Postby NiC72 » 13 Sep 2010

My fault, I apologize.
I have it like a function. But it becomes wrong when I call the function.
Get some "invalid floating point"

/ NiC

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: EL error

Postby TJ » 13 Sep 2010

1. make sure your denominator does not equal to zero. (don't be lazy, add a conditional check.)

2. make sure you compile your function with storage as series.

NiC72
Posts: 111
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

Re: EL error

Postby NiC72 » 13 Sep 2010

Thanks TJ,
You were right (as usual). I did a check and it worked.
My minutes data is bad :-/

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: EL error

Postby TJ » 13 Sep 2010

I usually add this denominator check:

Code: Select all

if denominator <> 0 then
value1 = numerator / denominator
else
value1 = 0;

NiC72
Posts: 111
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

Re: EL error

Postby NiC72 » 13 Sep 2010

Thanks, it will be useful.


Return to “MultiCharts”