Job finished
Specification
Basic Description
EA works with series of positions which are opened with a net of limit orders with predefined Take Profits.
Series of positions is considered as closed when the last opened position was closed by Take Profit.
When there is at least one opened position, there also should be a net of pending limit orders in same direction which are renewed from time to time when opened positions are closed by Take Profits.
When the last opened position is closed by Take Profit, new cycle begins with choosing of direction and placing pending orders.
--------------------------------------
Opening of new positions
Choosing a direction for new positions
Choosing a direction for opening of new positions is a first step of algorithm. When all positions are closed, EA checks MACD indicator.
If MACD is above 0, then SELL limit orders are placed above current price.
If MACD is below 0, then BUY limit orders are placed below current price.
Until at least one position is opened, every single candle (time period) EA checks MACD and is probably replacing net of orders in one or second direction.
Once net of orders is placed it remains unchanged until MACD shows another direction for placing orders.
---------------------------------------------------------------------------
Logic for placing net of limit orders
Right after closing of all previous positions or after turning on the EA from the very beginning the net of limit orders is placed.
The first limit order (which is closest to current price) is placed on the "FIRST_ORDER_DISTANCE" distance from the current price.
All other limit orders are placed on a same distance from each other ("RANGE" Parameter) with predefined Take Profits ("TAKE_PROFIT" Parameter).
In total "ORDER_AMOUNT" (parameter) of limit orders is placed in the market.
-------------------
Lot size of orders
Volumes (in lots) in net of limit orders is divided in 3 groups with:
"LOT_1", "LOT_2", "LOT_3" parameters
First group from LOT_1_AMOUNT(amount of limit orders, parameter) are placed with LOT_1 volume size.
Following group from LOT_2_AMOUNT are placed with Lot_2 volume size
All other are placed with Lot_3 volume size.
----------------------------------
Behavior of EA after closing of position with a Take Profit (when there are some other positions are opened)
If position was closed with a Take Profit, new Limit order is placed at open price which just closed order had and with same volume and in same direction. (Full copy of previous limit order)
----------------------------------
Behavior of EA when several positions are opened
EA doesn't use stop loss but it adjusts take profits of positions that were opened first to make them closer to current price.
After closing position with a Take profit, the Take profit of the first opened order is moved closer to current price on a value of pips that is equal to (PROXIMITY x TAKE_PROFIT). But not on a closer distance than (TAKE_PROFIT x FINAL_CLOSE_PARAM).
When a Take profit of the oldest position is adjusted on a max alowed distance, then EA starts moving Take Profit of next oldest opened position closer to current price on a same value (PROXIMITY x TAKE_PROFIT).
In that case take profits of all opened positions will be placed not farther than (TAKE_PROFIT x FINAL_CLOSE_PARAM) to a current price.