I have encountered this problem a few times ... Sorry, I don't think I can replicate in a small program.
Amibroker finds an AFL error (correctly) but after proper correction is made, the error remain and can not continue operating.
Code below and error message demonstrate the issue
AB found the vatiable "price" that was not defined. After correcting the problem and changing it to "Mkt_AvgPrice", and saving the code, the error message remains on screen even though the code checks out OK (no errors)
case 1:
DataGroup = "Market";
SetForeign( "SPY" );
Mkt_AvgPrice = ( O + H + L + C ) / 4;
Mkt_AvgPrice_S = T3Filter( Mkt_AvgPrice, 3, 0.5 );
Mkt_slope = Mkt_slope - Ref(Mkt_slope,-1);
if (print) printf( "Market_Select = " + Market_Select + "\n" );
//
Plot( Mkt_AvgPrice_S, "", colorblack, styleThick | styleOwnScale, -0.5, 3 );
Plot( Mkt_slope > -1.0, "", colorred, styleThick | styleOwnScale, -0.5, 3 );
StaticVarSet("Mkt_Smooth",Mkt_AvgPrice_S);
RestorePriceArrays();
break;
type or paste code here
No one's perfect, and sometimes we're so convinced of our correctness that we miss silly little mistakes. I've done it lots of times.
It looks like you have a switch () ... case: ... statement, with multiple cases. Do other cases in the switch also have similar code, and also need to be changed?
In your post above, you provided a screenshot of the error before making a change to the code.
After making the change, is AB still reporting an error at exactly the same point as previously, or to somewhere else? ie. look at "Ln: 1513, Col: 46" in your initial screenshot - is it the same after changing the code?
There are a couple of things you can do to try and locate the problem:
display the "Watch" and "Output" windows in the AFL editor, via "Window, Watch". Have a look at the AB User Manual for instructions on how to use them.
set a breakpoint just above the line/s of code which seems to be causing the problem, and then step through the code, one line at a time, checking each variable.
Also, have a look at the suggestions provided here:
Failing that, your options are:
struggle-on by yourself
hire a professional programmer to look at your code, because "Sorry, I don't think I can replicate in a small program"
provide us with a better post, following the instructions in: