Hi guys,
I have seen a behaviour when clicking in "Sent to Analysis Window" that I didn't expect.
Let me use this formula as an example:
fh = fopen( "c:\\Nueva carpeta\\pruebas.txt", "a" );
if (fh)
{
qs = StrFormat( "%s\n", Name() );
fputs( qs, fh );
fclose( fh );
}
Buy = 0;
If I click on it, my formula is sent to the Analysis Window as expected, but I have seen it is also executed once for the symbol I have selected out from AA Window. I mean, it seems to ignore filters I have (I have done some tests and always takes the selected symbol).
In my case, with that formula, I see "pruebas.txt" file is created when clicking in "Sent to Analysis Window", not only when running SCAN. (it was when I saw an unexpected symbol in the file when I began to deep into to see what was happening). If I click five times on it (just as an example, I know it's absolutely unnecessary to do that), I have five times the selected symbol in the file (even if this symbol is not selected by the filter in AA Window) without having run any SCAN in AA window.
To avoid this behaviour, I have just added "if (Status("action") == 4)" to the formula and it seems it works as I expect. Another solution is to avoid the "Send to Analysis Window" button and using "Pick a file" in the AA window.
I have look for more info in the manual about " Send to Analysis Window" to see if I should make some change in settings to avoid that behaviour but I have found nothing about it. Searching in the forum I don't see something about it either (but sorry if it is here), so I would like to know if I should add a similar solution (using "Status()" to all my codes to avoid unexpected (for me) code executions or it is a better or easier way to do that.
Thanks,