Is there a way to print values of array before plotting

I am having some issue with the code and wanted to check if the code is working by printing the output. Is it possible in AFL? I tried WriteVar and printf both are not working. Assuming the output comes in the log window.

Your premature beginner's claim is incorrect!
Both WriteVal and printf function do work perfectly fine and do what they are supposed to do.

Just do not assume but please do read carefully what is written in help guide.
printf does not print to log window but to ...

The printf function formats and prints a series of characters and values to the output window, which can be either commentary or interpretation window.

Interpretation window:
https://www.amibroker.com/guide/h_interpret.html

Commentary:
https://www.amibroker.com/guide/w_comment.html


And WriteVal does not write to but converts and returns:
http://www.amibroker.com/guide/afl/writeval.html
which is indentical to NumToStr function
http://www.amibroker.com/guide/afl/numtostr.html


If you want to output to internal log window or to external (3rd party) programs such as DebugView then you would have to use _TRACE or _TRACEF functions.

Read here too: How do I debug my formula? for further output options.

1 Like