@ahm.montaser this happens because when you drop your indicator twice the resulting formula will also have two copies of the functions you wrote; this is not allowed (function names in a formula should be unique).
One way to address this is to move the functions to a separate include file and then use the #include_once to "include" them only once in the resulting formula that is "built" with the drag&drop actions.
Moreover, before saving your custom indicator, do not include the _SECTION_BEGIN / END as explained in this guide article, in the section titled: Special functions: SECTION_BEGIN, _SECTION_END, _SECTION_NAME, _DEFAULT_NAME, _PARAM_VALUES explained
They will automatically be added by Amibroker when you drag the indicator (based on the filename you assigned to your indicator, plus, if needed, a progressive number) so you can set independent parameters for each indicator instance.
I never said it is forbidden; you can surely do it for indicators that you plan to apply only once to a chart, but if you add a named _SECTION_BEGIN() (and the relative end) to your indicator before saving it, when you drop them multiple times on a chart, the resulting formula will have "duplicate" _SECTION_BEGIN() names and you'll NOT get the possibility, using the "Parameters..." window, to change the user-defined parameters individually for each instance of the indicator.
Check for example the various moving averages default formulas: none of them is included in a _SECTION_BEGIN / END.
As indicated in the guide:
When dropping indicator AmiBroker automatically checks for already existing section names and auto-numbers similarly named sections to avoid conflicts. Section name also appears in the Parameter dialog.
I do not know if there is another way to get the same result, but this is what is suggested in the official guide.