İş tamamlandı
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
İş Gereklilikleri
See attachment for Indicator to use
See google doc for full logic to implement:
https://docs.google.com/document/d/1xp-hqA7X10bSUaSXZ-YxhBbzsNcCNjVeBW7berEboog/edit?usp=sharing
Main Logic
The goal of this EA is to use the Heiken Ashi indicator as a buy/sell signal to open Long/short pending orders. When the indicator gives us a Buy or Sell signal, use x pips as a buffer before really opening the trade. We do that to to avoid false positive. We want flexibility that is why there are options to disable buy or sell and trade only during specific hours of the day.
Key Features
-
Only 1 trade at a time by EA. When one trade is opened the other closes automatically.
-
Must support multiple EA running at the same time with easy Order association using editable param:MainEAIdentifier.
-
Run EA on new candle of the current TimeFrame Only. ex.: On a 5min TimeFrame the EA main function should run every 5 min only.
-
Always consider previous candle when considering Sell/Buy signals
Indicator : Heiken Ashi on current TimeFrame (indicator included as attachment)
Buy signal: T(1) OpenPrice < T(1) ClosePrice AND T(2) OpenPrice > T(2) ClosePrice
Sell signal: T(1) OpenPrice > T(1) ClosePrice AND T(2) OpenPrice < T(2) ClosePrice
Order entry:: Always place pending orders Short/Long at same ASK/BID price so that both always triggers at the same time. Use param:MainLotSize for the order sizes
Close order: Close on signal reversal always only 1 active trade at a time
Buy Logic:
-
IF param:MainLong = ON THEN:
-
IF Indicator gives a BUY signal AND IF there is no active Long Order THEN:
-
IF there is already a Long pending order that has an entry point higher then the current entry price THEN update the existing pending order with lower price. (Update the price when it is lower)
-
ELSE Place a pending Buy Order with price of previous candle HighPrice + param:MainLongPipBuffer.
-
IF there is already a Short pending order, delete it
-
IF there is already a Short active order, Modify that order to close on the same price as the Long pending order that was placed. The goal is for the 2 orders to execute at the same time Close Short/Open Long.
Sell Logic: opposite of Buy Signal.