Hello,
I had anyone else experienced staticvarset generating error an error condition
with the use of the zig function ?
I have been trying to work around this issue - but am finding that in order to
reduce array manipulation - i would like to set static variables - but this
does not seem to work with call of the zig function anywhere in the code.
I have attached the sample code and a description of the irregularity with
amibroker. This has been prevalent in 5.20 and is still an issue with 5.30.
Have i overlooked anything ?
Thanks and regards
James
p/s: this was tested on the sample data (^DJI Daily) that comes with the
default amibroker install.
x = Cum(1);
//-----------------------------------------------------------------------------
// In this example "svar" holds the last value of x when var3[i] == 1.
// Note: this changes with the displayed data.
// When the "Causeserror" array is not commented out - amibroker no longer
// references the last displayed value.
//-----------------------------------------------------------------------------
//Causeserror = Zig(High, 0.1); // <= remove "//" and the functionality changes,
Var1 = MA(L, 5);
Var2 = MA(H, 15);
Var3 = Cross(Var1, Var2);
Plot (Var3 *1000, "va3", colorRed);
for (i=0; i<BarCount; i++)
{
if (Var3[i] == 1)
{
StaticVarSet("svar", x[i]); // Last "x" value when var3[i] == 1
}}
Plot(StaticVarGet("svar"), "svar", colorBlue);