İş tamamlandı
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
İş Gereklilikleri
Include PSAR indicator in EA F8_V5.9_FL.mq4
EA F8_V5.9_FL.mq4
==========================Understanding EA =========================================================================================
The algorithm of the EA:
- The EA checks if there are any orders it had previously opened.
- If there are no open orders, then the EA analyzes the chart, and if all the conditions specified in the settings are met, it opens the first main order.
- After opening the first main order the EA sets the Take Profit and Stop Loss levels (if those modules are enabled).
- If the first main order closes with a loss, then the next order may be opened with an increase in size.
- If the first main order is placed, the Step Up and the Step Down modules are enabled and the price reaches the specified values, then additional orders for these modules are placed. Additional orders for the Step Up and Step Down modules may only be placed in case the EA sees that it has previously opened the first main order or there are unclosed additional orders.
- This Expert Advisor has 2 operation modes:
- a) 1 operation mode is that if the Fast MA is above the Slow MA, then the EA places buy orders, and once the trend changes (the Fast MA is below the Slow MA) all of the opened orders are closed and sell orders are placed.
- b) 2 operation mode is that if the EA has opened buy orders and the trend changes (the Fast MA is below the Slow MA), then the orders remain opened. The EA may place sell orders only when the Fast MA becomes lower than the Slow MA and all of the EA's orders are closed (Take Profit, Stop Loss are reached, or closed "by hand").
- This Expert Advisor has a Trade time module, which, if activated, allows the EA to place the first main order only at the time period specified in this module. This module does not apply to additional orders for Step Up, Step Down and Turn modules. That is, if there are orders previously opened by the EA, and either of the Step Up, Step Down or Turn modules is activated, then additional orders for these modules will be placed regardless of the time.
==================================== Attention ============================================
If iCross = true the system open only one master order when MAs cross. iCross=False is not used.
===============================================================================================================================
Open orders are closed using TP, SL, TS, CloseValue or when signal change.
This is feature working perfectly and no action is required.
=== Add New Parameters ====================================================
use_psar – Boolean – If True system will use 2 MAs and PSAR indicator to open new orders;
psar_step – Double – step parameter used in PSAR;
psar_maximum – Double – maximum used in PSAR;
use_psar_entry – Boolean – If TRUE system open new orders when 2 MAs and PSAR have the same signal.
use_psar_exit – Boolean – when TRUE and the Profit Order - a BUY order - is negative if PSAR changes direction - PSAR indicates BUY and changes to SELL - the order is closed.
This feature is to used only if Profit Order is negative. When Profit Order is positive order will close by TP, SL, TS, CloseValue or when signal change.
Example:
1) A BUY order is open;
2) PSAR indicates BUY;
3) Profit Order is negative;
4) If the PSAR changes from BUY to SELL this order is closed.