Hello, comrades. How can I set the current time as default time to appear in the property window for a variable I created to handle time in the property window, without having to enter the current time in the editor each time I want to invoke the property window? Thank you in advance.
Please see code below:
extern string CurrentTime = "2016.04.17 16:00";
//This default value was entered manually,
//and will be in the past by the time the
// property window is open during run
An idea struck my mind to to do the following:
extern string CurrentTime = TimeToString(TimeCurrent());
If this works, it should give me what I want. However, I have not executed it yet as the market is closed as of now (weekend).
Your suggestions will be highly appreciated.
You might be wondering why I want the current time in the property window. Well, to clarify such wonder, I have another variable called EnterTime, to enter a future time. The idea is to copy the current time from the CurrentTime variable and paste in the EnterTime variable. By so doing, we will only have to edit the minute and/or hour, and not the entire date. Unlike the chart, it is possible to copy values from the property window.
The discussion is about initial assignment, as macpee wants to set the default value presented to the user when the EA/Indicator is attached to a chart and the properties can be set by the user
He is NOT talking about changing the value after the fact!
To add comments, please log in or register