This is NOT what I observe. On my end it RESPONDS to changes immediately right after copy-pasting your first code.
On a side note - you don't need to specify styleNoTitle in Plot, because Title assignment will overwrite everything. This flag only makes sense when you are not using Title variable.
What might have happened is that you moved ParamToogle between sections. You need to remember that parameters are PER-SECTION. I.e. the parameter "_switch" in section "A" is TOTALLY different than parameter "_switch" in section "B". They are independent and different. Sections work like namespaces.
_SECTION_BEGIN("A");
Param("my_param", 1, 1, 100 );
_SECTION_END();
_SECTION_BEGIN("A");
Param("my_param", 1, 1, 100 ); // THIS IS IDEPENDENT param!
_SECTION_END();
If you move parameters between sections they are treated as NEW ones (in new section) and any NEW parameter gets DEFAULT value (as specified in Param() calls).
to understand SECTIONS. Also keep in mind that _SECTION_BEGIN/END calls are meant to be added automatically by AmiBroker during drag-drop operations and should NOT be written by hand (unless you understand how they work).
Hello Tomasz,
Thank you for your reply! So as I understand the code has to be assigned to some section anyway?
I changed the code that does not work anyway and switch_ appears in section Price though it is outside it (this is the only code of chart window nothing else):
No, if there are no _SECTIONS, then parameter lives in "global" namespace (without section name).
When you manipulate code MANUALLY moving Params out and inside of sections -
you have to press "RESET ALL" button in Parameters window
As I wrote, _SECTIONS are meant to be added automatically by drag-drop operation, not via manual manipulation.
Users in their own formulas should NOT add _SECTIONS at all, unless they read the docs carefully and understand how things work. I wrote: everything is described in great detail in manual. SLOW READING is all that is required. If you manually play with sections you HAVE TO PRESS "RESET ALL" button in Parameters window as it informs AmiBroker to re-read all params from formula instead of relying on cached content.
So please do read the manual. It is not fun to repeat everything over and over again when everything is explained in manual.
Hello Tomaz, thank you for your reply!
Can you look ant my video please?
I really understand that users like me ask you same thing for a million times and you have to reply same, but I think something is not ok with ParamToggle depending where it is situated in script.
Yes! The solution was to press Apply Indicator! After that everything started working in my 6.18 beta as well!
Looks like ApplyIndicator button sets remaining unassigned sections inside script and after that they work fine!
Thanks!