工作已完成
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
I have a MT4 EA which I would like to convert to MT5.
I am interested in a ( Martingle + Hedging + Grid strategy ) cBot.
Strategy description :
Open a " Buy or Sell or both " position as per User defined parameter.
***Buy Cycle***
Buy order placed at current price with "INITIAL TAKE PROFIT 15pips " and " CYCLE STOPLOSS 25pips" .
Pending orders at "GRID LEVEL 20pips " - buy limit or sell stop placed as per User defined parameter.
If " LIMIT" = 0 , pending SELL-STOP order is placed at "GRID LEVEL" at double the initial lots with "CYCLE STOP LOSS" and " CYCLE TAKE PROFIT 25pips". This would be per order so that the cycle closes in profit.
Example :
Buy order placed at 2.0000 , TP - 2.0015 , SL- 1.9975.
So pending SELL STOP order will be at 1.9980 ( 2.0000 - 20 pips grid size), SL - 2.0005 , TP - 1.9950.
If " LIMIT" = 2 , need to place Pending 2 BUY LIMIT orders + 1 SELL STOP Order with double lot size to previous order and with "CYCLE STOP LOSS" and " CYCLE TAKE PROFIT".
Example :
Buy order placed at 2.0000 , TP - 2.0015 , SL- 1.9975.
Pending Buy limts placed at 1.9980 (0.02 lots) and 1.9960 ( 0.04 lots ). SELL stop order to be placed at 1.9940 ( 0.08 lots - following the grid ). "CYCLE STOP LOSS" and " CYLCE TAKE PROFIT " settings will appy for these pending orders.
If the SELL STOP order is placed , then pendiing orders will be placed as per addtional parameter "REV_LIMIT". This will control the orders on the SELL side of Buy Cycle.
Example :
SELL order placed at 1.9940, TP - 1.9910, SL- 1.9975.
Pending Sell limts placed at 1.9960 (0.02 lots )and 1.9980 ( 0.04 lots ). BUY stop order to be placed at 2.0000 (0.08 lots - following the grid ). "CYCLE STOP LOSS" and " CYLCE TAKE PROFIT " settings will appy for these pending orders.
I need the open order to be closed after the pending order is filled. This saves somes pips before Stoploss is hit. It also helps to avoid the gaps when there is a big movement.
All pending orders should automatically close after "INITIAL TAKE PROFIT " or "CYCLE TAKE PROFIT " is achieved.
" LIMIT" OR "REV_LIMIT" whichever value is higher will also determine the Maximum lot size for a Cycle. Suppose SELL CYCLE has open order with 0.02 lots, then first order of BUY CYCLE shall start with 0.02 lots.
Fresh New BUY or SELL Cycle should not start if open order size exeeds Maximum lot size.
In above example , Maximum LOT size shall be 0.08.
***Sell Cycle***
Similar logic to Buy Cycle in opposite direction.
==
In addition to above, I would like to have option to start a Buy / Sell Cycle with opposite tradetype.
HULK mode
Example:
Sell Cycle has open buy order placed at 2.0000 ( 0.02 lots ) and pending Sell-stop order at 1.9980 ( 0.04 lots ).
Need BUY CYCLE to start with sell order if current price minus 1.9980 is greater than "INITIAL TAKE PROFIT pips " . This will allow to close this order in profit before Sell Cyle stop order @1.9980 is reached.
When no BUY or SELL Cycle is open, next cycle should start with intial lot size.
Also need to have option to restrict new BUY and SELL cycle from starting after one whole cycle is completed. ( Dhoom mode ).
Thank You.
Siddharth.