Universal Partial Close Demo
An age-old question: "How to save earned profit?" You can use Partial Close (PC). PC is recommended to make on resistance/support levels.
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 an 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.
% PC are always equal to 1 in the demo version
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 is closed 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 is closed 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" - same for Sell
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