Universal Partial Close
An age-old question: "How to save earned profit?" You can use Partial Close (PC). PC is recommended to make on resistance/support level.
This EA maintains any amount of orders performing PC for each of them. You can make several PC for each order gradually closing them.
The EA's operational variables are located on the control panel (values in blue and pink cells can be changed):
- Trade is Stopped button is located at the top of the panel. Margin level ("Level") is displayed when it is in operation mode. The EA turns off/on when you push the button.
- Next goes a table of PC types (there are 6 types of PC):
The first table column shows PC number, the second column is a PC type, the third column is a amount of PC of that type, the fourth represents percentage of closing of an order lot.
PC percentage is always calculated from an initial order lot. For instance when you open an order with a lot equal to 80 units and %PC=20%, closing of a lot equal to 16 units will be happening every time.
You can make 9 PC for each PC type, i.e. "Num." <= 9. Num = 0 turns this PC type off.
Types of PC:
- "ТР". PC with Take Profit step (ТР). I.e. first PC will be on TP level, then - on the level of 2*TP, further - on the level of 3*TP etc.
- "SL". PC with Stop Loss step (SL). I.e. first PC will be on SL level, then - on the level of 2*SL, further - on the level of 3*SL etc.
- "Contact -". PC occurs when the price crosses the bottom vertice of the Zig Zag.
- "Close -". PC occurs when the bar closes lower than the bottom vertice of the Zig Zag.
- "Contact +". PC occurs when the price crosses the top vertice of the Zig Zag.
- "Close +". PC occurs when the bar closes upper than the bottom vertice of the Zig Zag.
NB: clauses 3-6 indicate terms for a Buy order, do vice versa for a Sell order.
- PC modes switching button: (PC "+" and "-" profit) or (PC only "+" profit).
- "Dist. PC" (in points) - If the order is closed per PC, the breakeven level will not set until the price exceeds the "Dist.PC"+"WL PC" of the order opening price.
- "WL PC" (in points) - order breakeven level (Without Loss) after PC of the order.
- Trailing stop (TS) modes button: "TS after PC" or "TS independet".
- "TS" (in points) - Trailing stop begins if the price is on the distance of "TS"+"WL TS".
- "Step TS" (in points) - Step of the trailing stop. TS turns off if "TS"=0 or "Step TS"=0.
- "WL TS" - breakeven in case of trailing stop.
Zig Zag line:
- "TF zz" - timeframe of the Zig Zag. Set by entering symbols as in the MetaTrader: M1, M5, M15 etc. (you can use small letters or numbers)
- "Depth zz" - Zig Zag depth. The greater the value, the rarer the Zig Zag will be.
- "up=1" - Buy orders maintenance is allowed. Prohibited when "up=0".
- "dw=1" - Sell orders maintenance is allowed. Prohibited when "dw=0".
Next cell says how many orders are maintained by the EA: "Uses ... orders".
You can enter magic value at the right from the "Magic" cell. If you enter 0, only manual orders will be maintained. If Magic=-1, orders with any magic, i.e. all orders will be maintained.
But you can manually select orders which need to be maintained. To do this you shall place a "Triangle" on the main screen such that it covers all selected orders. The word "Triangle" appears instead the word "Magic" in the Triangle mode. In this case specified magic is not taken into account.
Orders maintained by the EA are emphasized by the PC Label on the screen. This label is located under the order. It can look as follows:
^1Е.34.X2 or ^23.11.23 and indicates amount and type of PCs made for that order.
^ - (arrow) a pointer to the order .
"." - (dot) a separator (for ease of reading of a line).
Two left numbers indicate number of order closing according to TP and SL.
Two middle numbers are for "Contact -" and "Close -" PC types
Two right numbers are for "Contact +" and "Close +".
"X" (cross) - this PC type is off.
"E" ("End") - all PC of this type are done.
- number_waves, Color_waves - number of waves and Zig Zag color
- Slippage - slippage
- sdvig_label, clr_label - shift and color of PC Labels
- Sound - sound onn/off
- panel_dist_x, panel_dist_y - panel shift
- Inf_RUS - Russian/Latin alphabet on the panel