Hi,
Could someone please help me how to fix the Amibroker system crash issue while applying the afl mentioned below.
_SECTION_BEGIN("Range");
per = Param( "Period", 27, 2, 200, 1 );
mult = Param("Range Multiplier",1.618,0.1,2,0.1);
//Average Range
source=Close;
function smoothrng( x, t, m )
{ wper = t * 2 - 1;
Refx=(x - Ref(x,-1));
avrng = EMA(abs(Refx), t);
smoothrng1 = EMA(avrng, wper) * m;
return smoothrng;
};
smrng = smoothrng(source, per, mult);
function rngfilt(x, r)
{ rngfilt1 = x;
rng=Ref(rngfilt1,-1);
xp=x+r;
xn=x-r;
rngfilt1 = IIf(x > rng,IIf( xn < rng,rng, xn, IIf(xp > rng, rng, xp)));
return rngfilt;
};
filt = rngfilt(src, smrng);
---------------------------------
The system crash error message says
Error 47.
Exception occurred during AFL formula execution at address: 423503, code: C0000005
I really don't know what to do could seniors please help me fix this issue.
Thanks,
Allen.
Could someone please help me how to fix the Amibroker system crash issue while applying the afl mentioned below.
_SECTION_BEGIN("Range");
per = Param( "Period", 27, 2, 200, 1 );
mult = Param("Range Multiplier",1.618,0.1,2,0.1);
//Average Range
source=Close;
function smoothrng( x, t, m )
{ wper = t * 2 - 1;
Refx=(x - Ref(x,-1));
avrng = EMA(abs(Refx), t);
smoothrng1 = EMA(avrng, wper) * m;
return smoothrng;
};
smrng = smoothrng(source, per, mult);
function rngfilt(x, r)
{ rngfilt1 = x;
rng=Ref(rngfilt1,-1);
xp=x+r;
xn=x-r;
rngfilt1 = IIf(x > rng,IIf( xn < rng,rng, xn, IIf(xp > rng, rng, xp)));
return rngfilt;
};
filt = rngfilt(src, smrng);
---------------------------------
The system crash error message says
Error 47.
Exception occurred during AFL formula execution at address: 423503, code: C0000005
I really don't know what to do could seniors please help me fix this issue.
Thanks,
Allen.