The only thing “that occurs” is a deinit/init cycle. EAs are not reloaded.
@William Roeder
Thank you for your response.
I understand that avoiding the deinit/oninit cycle is inevitable, but I want to prevent the frequent occurrence of the web authentication process that follows.
I would like to implement a method where the indicator recognizes the recent time frame change and avoids web authentication by setting an encrypted numerical value in a global variable or creating a file in an inconspicuous location using WinAPI.
However, to prevent users from tampering with the values or files and to avoid their pre-creation, I thought about implementing a method to generate a different cryptographic value each time and decrypt it. Is there a means to achieve this?
Whether using a hash value in the variable name of a Global variable or using an encrypted numerical value in its content, it would be ideal if the encryption could only be generated and decrypted by the indicator.
Additionally, ensuring that variable names and values are different each time would allow for determining whether to perform web authentication.
Thank you for your support. I appreciate your assistance with this matter.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I am creating an indicator that uses HTTP requests in the Oninit() function to perform web authentication. This indicator, which is planned for sale, requires a reasonably strict authentication process.
The issue I am facing is that "Oninit() is triggered again when the time frame is changed, leading to repeated web authentication." I would like to avoid this repeated web authentication.
The desired behavior is to perform authentication only once when the terminal is restarted or when the indicator is applied to the chart for the first time.
Then, the web authentication should only occur again in two scenarios: when the date changes or when the terminal is restarted.
It's worth noting that I am using the Post function from the restmql_x64.dll obtained from GitHub, rather than the built-in WebRequest().
Here is the code for restmql_x64.dll in C#:
Due to the nature of the indicator, where time frames are frequently changed, usability is significantly compromised.
I have considered two possible solutions, but both seem to have vulnerabilities, making it easy to bypass authentication:
Avoid web authentication in Oninit() and perform it in OnTimer() after a delay (e.g., 5 minutes). → This may be bypassed by reapplying the indicator within the 5-minute.
Use global variables in the terminal and skip authentication when there is a time frame change. → This can be easily bypassed if users prepare the necessary global variables in advance.
If you have any solutions or need additional information for a more accurate response, please let me know.
Thank you for your assistance.