AFL Error 61

#1
Hi,

I installed the version 6.10 and an AFL that was working correctly, now has an Error 61:

_N( Title = StrFormat( Colortitle + Name_ + " - " + ColorTF + "{{INTERVAL}}"
+ Colortitle + " - " + DayName + " {{DATE}} Op: %g, Hi: %g, Lo: %g, Close: %g (%.2f%%), Vol: %g " + titlestrL +
" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ), V, Nz(StoplevelL)*100, Nz(TrailLevelL)*100, Nz(longtrailarray) ) );


File: 'Formulas\Custom\@Buy.afl', Ln: 681, Col: 121
Error 61.
The number of format specifier(s) (%) does not match the number of arguments passed.
Use 'Edit Formula' to correct error"


I checked the code and google, found the help from Amibroker, but I was not able to fix this code. Can someone help me?

Thanks,

Jacare
 

trash

Well-Known Member
#2
1. Learn how to use code tags to avoid further errors.

2. That error message is already pretty clear. Also read error 61 description in the help carefully.
"... number of arguments passed to the function does not match the number of % specifiers in the formatting string..."
There is even a pictured example showing precisely what is meant. So either you reduce number of arguments of your StrFormat function to the ones making sense (see % specifiers) or you add % specifiers matching those number of arguments.
 

KelvinHand

Well-Known Member
#3
Hi,

I installed the version 6.10 and an AFL that was working correctly, now has an Error 61:

_N( Title = StrFormat( Colortitle + Name_ + " - " + ColorTF + "{{INTERVAL}}"
+ Colortitle + " - " + DayName + " {{DATE}} Op: %g, Hi: %g, Lo: %g, Close: %g (%.2f%%), Vol: %g " + titlestrL +
" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ), V, Nz(StoplevelL)*100, Nz(TrailLevelL)*100, Nz(longtrailarray) ) );


File: 'Formulas\Custom\@Buy.afl', Ln: 681, Col: 121
Error 61.
The number of format specifier(s) (%) does not match the number of arguments passed.
Use 'Edit Formula' to correct error"


I checked the code and google, found the help from Amibroker, but I was not able to fix this code. Can someone help me?

Thanks,

Jacare

Remove all the arguments with Nz() should solve.
 

Similar threads