Several functions for working with the holidays:
datetime LastMondayStart( datetime dt);
returns the last Sunday 22:00 before dt.
datetime NextFridayEnd( datetime dt);
returns the nearest Friday 23:00 time after dt.
int SundayMidnightCount( datetime start, datetime end);returns the number of holidays between two dates.
int HoursCandleCount( datetime start, datetime end);returns the number of trading hours between two dates. In other words, it is the amount of hourly candles between 'start' and 'end'.
datetime AddTradingSeconds( datetime start, int seconds);
adds trading time to the date.
Example: the position needs to be closed 5 trading hours after opening. If the position was opened on Friday at 21:00, then it should be closed on Monday at 2:00. The initial time is calculated like this:
AddTradingSeconds( OrderOpenTime(), 5*60*60 );
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/7080
The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.Average Directional Movement Index (ADX)
The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.