EL error

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

Sep 12 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: 7776
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Sep 12 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: Apr 09 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Sep 12 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: 115
Joined: Nov 02 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

Sep 13 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: 7776
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Sep 13 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: 115
Joined: Nov 02 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

Sep 13 2010

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

User avatar
TJ
Posts: 7776
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Sep 13 2010

I usually add this denominator check:

Code: Select all

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

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

Sep 13 2010

Thanks, it will be useful.