How can I set Hours and Minutes as input parameters and use it in my function.
When dealing with time, a lot of people use strings; they can not be optimized. Using (int) seconds or (double) hours and fraction can be inputs.
input string opentime = "12:00"; ... { datetime time = TimeLocal(); string hoursAndMinutes = TimeToString(time,TIME_MINUTES); if (hoursAndMinutes == opentime) //do what you want here } ...
simply define time as a string... Just you need to make sure entries are double digit format.(hh & mm)
When dealing with time, a lot of people use strings; they can not be optimized. Using (int) seconds or (double) hours and fraction can be inputs.
Strings are nice in settings. I use strings in the settings, and in OnInit I convert them to an integer format, which allows me to maintain high performance.
//Global paramters//
input parameter opentime = "12:00" (??)
if ((StringSubstr(hoursAndMinutes, 0, 5) == "07:00")
How can I replace 07:00 with an input parameter?
{//Buy Trade logic}//
Thank you very much!