The author of the idea: Yuri, the mq5 code author: barabashkakvn.
The Expert Advisor calculates the nearest upper and lower "round" price depending on Step of the "round" number (to see how the calculation of the "round" price is performed, comment out the line in OnDeinit:
//+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- how Math() function works: return;
An example will be printed in the Experts tab when you unload the EA from the chart). The EA checks the position of the price and the iAMA (Adaptive Moving Average, AMA) indicator to place an initial pending order.
Lifetime is set for each pending order: Life time of the pending order (in hours) is added to the last known server time.
Separate trailing methods are applied for BUY and SELL positions. They are configured in Trailing Stop BUY and Trailing Stop SELL.
Testing on EURUSD, H1:

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/20132
MathCeilRoundFloor
Example of functions MathCeil, MathRound and MathFloor.
Fractured Fractals
The Expert Advisor uses the Fractals indicator signals to place pending orders and trail the Stop Loss level of positions.
Fractal_TL
An indicator for automatic drawing of trendlines based on fractals of a given timeframe.
Ichimoku
An Expert Advisor based on the iIchimoku (Ichimoku Kinko Hyo) indicator. Separate Stop Loss, Take Profit and Trailing Stop for BUY and SELL positions. The EA operation time is configurable. A check is performed on the current bar: only one position can be opened.