isaacarsenal:
Is it possible for the user to run multiple instances of a script simultaneously?
On the same chart? No. On different charts? Yes.
isaacarsenal:
if so, how i can prevent it?
Have your script do the following sequence of events:
Step 1. Look for the existence of a specific globalvariable
if(GlobalVariableCheck("ScriptXYZCurrentlyInUse")==true) return; // Check the global flag to see if a script instance is already in useStep 2. Create the global variable
else GlobalVariableSet("ScriptXYZCurrentlyInUse",1); // Set the global flag to denote that the script instance is in useThen do your script routines...
Step 3: At any potential exit point in your script, including the very end, delete the global variable:
GlobalVariableDel("ScriptXYZCurrentlyInUse"); // Delete the flag to denote the script is no longer running somewhere in the terminal
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Is it possible for the user to run multiple instances of a script simultaneously?
if so, how i can prevent it?