Thanks for your answer I added this definition and it seems to work even if the compiler gives me this warning.
The indicator seems to work but I can run into some error?
bool inTimeInterval(datetime t, int TOD_From_Hour, int TOD_From_Min, int TOD_To_Hour, int TOD_To_Min) { string TOD = TimeToString(t, TIME_MINUTES); string TOD_From = StringFormat("%02d", TOD_From_Hour)+":"+StringFormat("%02d", TOD_From_Min); string TOD_To = StringFormat("%02d", TOD_To_Hour)+":"+StringFormat("%02d", TOD_To_Min); return((StringCompare(TOD, TOD_From) >= 0 && StringCompare(TOD, TOD_To) <= 0) || (StringCompare(TOD_From, TOD_To) > 0 && ((StringCompare(TOD, TOD_From) >= 0 && StringCompare(TOD, "23:59") <= 0) || (StringCompare(TOD, "00:00") >= 0 && StringCompare(TOD, TOD_To) <= 0)))); }
declaration of 'TOD_From_Hour' hides global declaration
Thanks for your answer I added this definition and it seems to work even if the compiler gives me this warning.
The indicator seems to work but I can run into some error?
That is because you declared global variables with same names as the parameter variables for that function. It will still work, but it is best to change the names of either global or the parameter variables so that they don't clash.
int TOD_From_Hour = 08; //time of the day int TOD_From_Min = 00; //time of the day int TOD_To_Hour = 20; //time of the day int TOD_To_Min = 00; //time of the day
bool inTimeInterval(datetime t, int TOD_From_Hour, int TOD_From_Min, int TOD_To_Hour, int TOD_To_Min)
Hello every one I have this problem
'CheckEntry' - function not defined
Then the answer is the same as the one given above. Read the thread again!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Where am I doing wrong?