Hi,
I´d like to protect my strategies and set an expiration date.
If today´s date is less then 10 days from the expiration date, I want a messagebox to warn the user.
Moreover, if today´s date is greater then the expiry date, I want a messagebox to inform the user that he can no longer use the strategy and the strategy should not be executed.
This is my code, but it does not work:
CODE:
Please log in to see this code.
What am I doing wrong here?
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color:
Thank you Eugene for your help.
Re-thinking this one...I would like to insert the possibilty to enter a password if expiry date is reached so that the user can run the script in urgent cases. So, if the password is correct the script should run anyway.
How to do this?
Size:
Color:
I leave the actual password check procedure up to you, here's just an example how to enhance that code w/o altering its structure:
CODE:
Please log in to see this code.
Size:
Color:
Hmm. When clicking yes on the dialog it aborts anyway.
Size:
Color:
I changed the date to today's.
Size:
Color:
Sorry, I was a bit unclear. I thought your example will run the strategy anyway in case the dialog is responded with "yes"?
When I press yes the code should be run, although the strategy expired. Responding with yes would then be replaced with entering a correct password.
Size:
Color:
Thanks, what you found is an error, please see the fixed code above.
Size:
Color:
Good work, thank you.
Size:
Color:
When I use above code in a strategy that executes on a large dataset I get the messagebox for all symbols in the dataset. What do I need to change to make it run only once, notice that it expired, and abort it for all other symbols, too?
Size:
Color:
Size:
Color: