I´ve requested this already too a while back and since there has been no implementation so far, I´ve added my own one. Here is how you need to modify the portfolio expert MQL4 code:
In the inputs section (right under the "static input int Base_Magic_Number") of the MQL4 code you add:
extern string TradingBreakFrom = "23:59";
extern string TradingBreakUntil = "00:01";
So it should now look like:
static input double Entry_Amount = 0.01; // Entry lots
static input int Base_Magic_Number = 100; // Base Magic Number
extern string TradingBreakFrom = "23:59";
extern string TradingBreakUntil = "00:01";
Then go ahead and find the "void OnTick()" function. This function is modified like this:
void OnTick()
{
if(IsForceSessionClose())
{
CloseAllPositions();
return;
}
if(Time[0]>barTime && checkTradingBreak(TradingBreakFrom, TradingBreakUntil) == false)
{
barTime=Time[0];
OnBar();
}
}
And at the very end of the MQL4 file, you simply paste these 2 functions:
bool checkTradingBreak(string TimeFrom, string TimeTo)
{
bool RevertRange = false;
if (TimeStringToDateTime(TimeTo) < TimeStringToDateTime(TimeFrom))
RevertRange = true;
if (RevertRange == false && (TimeCurrent() < TimeStringToDateTime(TimeFrom) || TimeCurrent() > TimeStringToDateTime(TimeTo)))
{
return(false);
}
else if (RevertRange == true && (TimeCurrent() > TimeStringToDateTime(TimeTo) && TimeCurrent() < TimeStringToDateTime(TimeFrom)))
{
return(false);
}
return(true);
}
datetime TimeStringToDateTime(string time) {
string date = TimeToStr(TimeCurrent(),TIME_DATE);//"yyyy.mm.dd"
return (StrToTime(date + " " + time));
}
Now you can compile the MQL4 code and afterward you can simply set the rollover trading break of your broker in the expert properties (in my case I´ve set 23:59 - 00:01).
Good luck :-)