Aeron J J N Expert Advisor - VertexFX

 
The Aeron J J N Expert Advisor is an innovative VertexFX client side script that places breakout orders based on the market patterns. 

This Expert Advisor employs the Average True Range (ATR) indicator along with bullish and bearish Doji patterns to place BUY-STOP (bullish breakout) and SELL-STOP (bearish breakout) orders. 

The concept behind this Expert Advisor is to identify key bullish and bearish reversals and place pending orders expecting a breakout in the direction of the reversal. For example if a bullish reversal occurs on the current candle, it searches the lowest price of the most recent bearish candle. It then places a SELL-STOP order at a distance of Average True Range below this lowest price. The assumption is that bullish reversal will condition, and it will cross below the lowest price of the previous bearish candle. 

Condition for  BEARISH REVERSAL CONTINUATION – 
If the current candle is bearish and the previous candle is bullish then the Expert Advisor evaluates SELL-STOP trade conditions. The difference between the previous candle Close and Open must be at least DOJI_D I F F 1. If this condition is met, it then searches from the current candle to the oldest candle to find a bullish candle whose body is greater than D O J I_D I  F F 2. If a bullish candle with the matching condition is met, it places a SELL-STOP order at the distance of ATR (8 period) below the Low of the matching bearish candle. The duration of this SELL-STOP pending order is equal to RESET_TIME minutes.

Conditions for BULLISH REVERSAL CONTINUATION – 
If the current candle is bullish and the previous candle is bearish then the Expert Advisor evaluates BUY-STOP trade conditions. The difference between the previous candle Open and Close must be at least DOJI_D I F F 1. If this condition is met, it then searches from the current candle to the oldest candle to find a bearish candle whose body is greater than DOJI _D I F F 2. If a bearish candle with the matching condition is met, it places a BUY-STOP order at a distance of ATR (8 period) above the High of the matching bullish candle. The duration of this BUY-STOP pending order is equal to RESET_TIME minutes.

If the pending order is not executed within RESET_TIME minutes then it is deleted and the Expert Advisor evaluates new trade entry conditions.
It is possible for both BUY-STOP and SELL-STOP pending orders to co-exist. Each of these are tracked individually. If a pending order is triggered, then a new pending order of that type is not placed till the pending order is closed. For example, if a BUY-STOP order is triggered into a LONG position, new BUY-STOP conditions are not evaluated until the open LONG position is closed.
The Expert Advisor protects each open position using a protective trailing stop mechanism.
Files: