Idea by: Scriptor
MQL5 code author: barabashkakvn
How It Works
This Expert Advisor utilizes the iMA (Moving Average) indicator to analyze price movements. It compares the opening price of the most recent bar (bar #0) with the Moving Average values of the current and previous bars (MA #0 and MA #1). If there's already an active position that aligns with a new signal, that signal will be disregarded. The Expert Advisor operates on every tick, so it’s always ready to act.
Understanding the Signals
BUY Signal: A BUY position is triggered when the open price of bar #0 is below MA #0, AND the ASK price is below MA #0, AND MA #1 is below MA #0.
SELL Signal: A SELL position is generated when the open price of bar #0 is above MA #0, AND the BID price is above MA #0, AND MA #1 is above MA #0.
Positions are closed when an opposite signal is generated; for example, a SELL position closes upon receiving a BUY signal.

Comments 0