All calls to CopyTime() take a datetime array argument not a MqlDateTime structure (and certainly not an array of them!). If you want the result in an MqlDateTime struct, CopyTime() into the datetime array and then convert each element; see TimeToStruct()
mohammad7521 :
Example: if the current day of the week is Friday, just exit the procedure:
MqlDateTime STime; TimeToStruct(TimeCurrent(),STime); if(STime.day_of_week==5) return;
Scott:
Thanks!
All calls to CopyTime() take a datetime array argument not a MqlDateTime structure (and certainly not an array of them!). If you want the result in an MqlDateTime struct, CopyTime() into the datetime array and then convert each element; see TimeToStruct()
Vladimir Karputov:
Example: if the current day of the week is Friday, just exit the procedure:
Thanks Very Much!

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
Hi!
I am trying to backtest an strategy and i don't want to enter any position on fridays.
I try using this code to get the day of the week of the candle,but get the following error.
MqlDateTime herenow[];
CopyTime(_Symbol,_Period,0,0,herenow);
'CopyTime' - no one of the overloads can be applied to the function call