The Expert Advisor compares open prices of the zero and third bar.
Author of the idea is Oleksandr, author of the MQL5 code is barabashkakvn.
Condition to open a Buy position:
- If the opening price of a zero bar is higher than the opening price of the third bar.
Condition to open a Sell position:
- If the opening price of a zero bar is less than or equal the opening price of the third bar.

Position is closed by StopLoss or at the beginning of the next bar:
Since the EA works at the moment of emergence of a new bar, it is equipped with several protection steps — so as to avoid missing a whole bar due to possible position opening errors.
For example, if we cannot update the current prices, we should then reset the timer (static variable):
Also we check the result of the trading operation:
Translated from Russian by MetaQuotes Ltd.
Original code: /ru/code/17274
NRTR GATOR
Derived from the NRTR indicator, provided with a new visual display.
AIS1
The EA works based on the analysis of Open, High and Low.