VirtualTradePad mt4 Extra
VirtualTradePad is a control panel for managing basic orders in МetaТrader 4, such as buy, sell, buystop, buylimit, sellstop, selllimit, close, delete, modify, trailing stop.
VirtualTradePad won 2nd prize in the "Best Graphic Panel in the MQL5 Language" Contest.
You are holding a unique plugin for the MetaTrader 4 terminal - virtual control panel VirtualTradePad.
Full version Extra
The demo version of the panel can be downloaded here: https://www.mql5.com/en/market/product/2893.
You can also try this panel for the МetaТrader 5 terminal.
- Works on any account type and broker.
- Does not require specific skills.
- Simple and intuitive interface.
- Only the most important functions.
- Quick response to any command.
- Trade using the keyboard or buttons on the chart
- Positions tab is for working with positions. It includes: opening BUY and SELL, closing, reversing, locking, changing stop loss and take profit, modification, activation of trailing stop, closing only profitable positions, closing only unprofitable positions.
- Orders tab provides the work with pending orders. It includes: placing, deleting, building an order grid, working with the distance. Also, working with the magic button, which allows placing pending orders on the chart and snapping stop loss and take profit values at your levels and lines.
- Signals tab shows signal from 10 standard indicators and 8 timeframes. It also shows the cumulative percentage of signals in the BUY and SELL directions. It is also possible to open positions automatically when the cumulative signal is exceeded.
- INFO tab displays the current specification of the selected symbol, the current stop loss and take profit targets, as well as the profit for the current day, past day, week, month.
- CLP tab manages the function for closing by total profit or loss. It allows setting desired profit and loss values in points, dollars and percent, closing the BUY/SELL directions separately, enabling virtual stop loss and take profit, and checking each position separately. This tab also provides the option to trail the obtained profit.
- When a position is successfully opened, you will hear a sound similar to the same action in the terminal;
- If there is an error, you will hear the error sound;
- You cannot place a stop order at a level less than allowed on the trade server or 0;
- On the BUY and SELL buttons, the change of the Ask and Bid prices is displayed with arrows;
- The information panel displays the currency pair, the open position volume and the total profit for the currency;
- There is an option in the input parameters: show/hide tips on mouse over a button, you can also select the language of the tips English / Russian;
- The Close button stops the application;
- The Maximize/Minimize button collapse/expand the pane on the chart;
- The pane can be moved on the chart. To do it, click the upper part of the pane near the Close and Minimize buttons, and then move the pane to a desired position.
Important parameters (the list of all parameters for VirtualTradepad)
- Sounds - enable/disable sound alerts when opening/closing/modifying positions/orders;
- HintShow - enable/disable popup tooltips;
- English - enable/disable tooltips in English. If false, tooltips will be in Russian;
- MagicNumber - magic number for positions and orders. 0 - no magic number;
- UseAllMagicFromAllAccount - manage all positions for the given currency pair;
- CommentOrders - comment to be added to the comment of the position or order when opening;
- KeyBoardTrade - use keyboard for one-click trading;
- Buy_KEY - open a BUY position with the D key;
- Sell_KEY - open a SELL position with the A key;
- Close_KEY - close positions with the X key;
- LossCLOSE_KEY - lose only unprofitable positions, not defined;
- ProfitCLOSE_KEY - lose only profitable positions, not defined;
- Reverse_KEY - reverse positions with the Q key;
- Lock_KEY - lock positions with the E key;
- DynamicLotStopLoss - enable dynamic calculation of the lot based on the specified stop loss as a percentage of free margin;
- DynamicLotAuto - enable dynamic calculation of the lot as a percentage of free margin and other factors;
- CoefLotForGridOrders - multiplier for the next lot in the grid of pending orders when used on the Orders tab;
- AddLotForGridOrders - additional lot per each pending order in the grid when used on the Orders tab;
- Show_Future_BE_TP_SL - display the breakeven/profit/loss levels on the current chart;
- Signals_Alert_After_Percent - generate a pop-up alert when the cumulative signal on the Signals tab exceeds the specified percentage;
- AutoTrade_by_Signals - automatically close the position when the cumulative signal level exceeds Signals_Alert_After_Percent percents.
- Added the ability to display the information about open positions on the chart.
--- Including the position direction, lot, current profit, stop loss/take profit (indicating the targets in points and in the deposit currency)
--- ShowInfoPosition - display information on the chart;
--- ShowInfoPositionSize - font size for the text displayed on the chart;
- Added support for font scaling in Windows (font size settings are not available);
- When working with MagicTarget and changing the lot size on the panel, the data on stop loss/take profit on the chart will also be redrawn;
- Updated the algorithm for displaying the current prices on the Positions tab;
- Added support for multiple magic numbers. Updated the MagicNumber parameter: the first number denotes the magic number for opening positions and management. It is also possible to set multiple magic numbers to be managed;
--- MagicNumber=777 UseAllMagicFromAllAccount=true: the EA monitors all positions on the current symbol and on the entire account;
--- MagicNumber=777 UseAllMagicFromAllAccount=false: the EA monitors positions with the magic number 777 on the current symbol and on the entire account;
--- MagicNumber=777,888 UseAllMagicFromAllAccount=false: the EA monitors positions with the magic numbers 777 and 888 (opens positions with the magic number 777) on the current symbol and on the entire account;
--- MagicNumber=777,888,999 UseAllMagicFromAllAccount=false: the EA monitors positions with the magic numbers 777, 888 and 999(opens positions with the magic number 777) on the current symbol and on the entire account;
- When a new object appears on the chart, the panel is refreshed to avoid overlapping of objects on the panel;
- Added support for operation in the strategy tester, but with the limitations of the terminal:
--- It is not possible to enter a value in the EDIT box;
--- The CLP tab does not work;
A new parameter has been added: CPL_AUTOOFF_AfterClose allows disabling the "Close if profit or loss" button after closing all positions.
The button is only disabled when ALL! positions are closed.
It takes into account the magic number specified in the EA, as well as the symbol for closing.
If closing only 1 currency is selected and the CPL_AUTOOFF_AfterClose is enabled, the EA waits for all positions of this currency pair
to be closed, and only after that the button can be closed!
Bugfix: Fixed the issue with the TP Target calculation in the Info tab while simultaneously using positions with Take Profit and without Take Profit.
BugFix: Fixed dragging of trade levels (Stop Loss, Take Profit) when hovering over the panel and back.
Changes: Changed the coordinates of the profit value shown in the Info tab
The KoefLotForGridOrders parameter has been renamed to CoefLotForGridOrders
Parameter CPL_CloseTerminalAfterClose - enable closing the terminal.
CPL_CloseTerminalAfterClose = true.
Terminal is closed only when ALL! positions are closed.
It takes into account the magic number specified in the EA, as well as the symbol for closing.
If closing only 1 currency is selected. If the CPL_CloseTerminalAfterClose parameter is enabled, the EA waits for all positions on the given currency pair to be closed, and cab close the terminal only after that!
Added the Show_Future_BE_TP_SL parameter to CLP - show the lines of the future position closure by total profit or loss..
Attention: it works only on the current symbol and with the 'SEPARATE Orders' mode disabled.
The lines are displayed separately for Buy and Sell positions, or by a common line.
If a line is not shown, then the positions form a lock that cannot be closed by the total profit or loss.
Note: line and price data may be inaccurate for floating spread.
Remember! SELL is closed by ASK, while BUY is closed by BID
Updated the prohibition on dragging the trade levels when using the panel. If the cursor is on the panel, the EA disables the ability to drag the trade levels.
When using the REVERSE button to reverse the positions, the predefined stop loss and take profit are set to open positions.
When using the LOCK button for locking positions, all open positions are modified with stop loss and take profit = 0. That is, when locking positions, all the stop loss and take profit levels are zeroed.
Profit trailing can now be enabled only after setting the parameters for closing by profit.
Added the profit trailing values on the CLP panel near the input box for the distance of Trailing Profit. The value appears when the trailing level is fixed by the EA and shows the fixed level for closure.
Added block of alerts for profit and loss in the deposit currency.
If you want to limit the losses on the current client magic number, you can do that in the new block.
For example: you need the EA to send you emails and display on-screen alerts when the total loss of open and closed trades within LimitFor becomes less than -100 USD:
Set the parameters to the following:
After receiving the daily loss of -100 USD in history for the given magic number, the EA displays an on-screen alert and sends an email.
Attention: this block does not close trades! It simply displays alerts!
At the next LimitFor, this parameter is reset to 0.
You can select LimitFor= DAY;WEEK;MONTH;ALLTIME;
You can also enable sending email and push notifications when reaching the limits of NotificationMailSend
To the CLP panel for closing by profit or loss, added a block of notifications when closing positions by profit or loss. 3 notification methods are available:
CPL_AlerT - alert message
CPL_Mail - email message
CPL_Push - push notification
How to set up mobile device or email to messages from the Expert Advisor:
Added hot keys for managing the panel
KeyBoardTrade - enable/disable the management using hot keys.
Buy_KEY=BUTTON_D; - default button for opening BUY orders
Sell_KEY=BUTTON_A; - default button for opening SELL orders
Close_KEY=BUTTON_X; - default button for closing all positions
LossCLOSE_KEY=NONE; - default button for closing all unprofitable positions
ProfitCLOSE_KEY=NONE; - default button for closing all profitable positions
Reverse_KEY=BUTTON_Q; - default button for reversing all positions
Lock_KEY=BUTTON_E; - default button for locking all positions
You can use the numpad keys or the standard keyboard keys.
Attention: for the keys to work, it is necessary to activate the window with the panel.
For the CLP tab
the MagicOrderToClose parameter has been replaced by 2 parameters:
MagicNumber - unique magic number of positions to close.
true = apply the function of closing by total profit or loss to all magic numbers.
false = set the unique magic number for closing positions in the MagicNumber parameter.
CoefLotForGridOrders - multiplier for the next lot in the grid.
For example: CoefLotForGridOrders =2, Grid = 5, then the lots will be opened as follows: 0.1, 0.2, 0.4, 0.8, 0.16
AddLotForGridOrders - additional lot per each element of the grid.
For example: AddLotForGridOrders =0.1, Grid = 5, then the lots will be opened as follows: 0.1, 0.2, 0.3, 0.4, 0.5
- Added new control buttons to the Positions panel:
LOCK - lock the current positions on the given symbol and magic with 1 cumulative opposite position.
LOSS - close all unprofitable positions
PROFIT - close all profitable positions
MovingInWLUSE (true - false) LevelWLoss(in points) LevelProfit (in points)
These parameters adjust the possibility to modify deals moving the Stop Loss to breakeven at the earliest opportunity.
You would like to set Stop Loss in the break even, when the deal will score +10 points of profit:
MovingInWLUSE = true; LevelWLoss=0 ; LevelProfit =10;
You want to set Stop Loss in +5 points, when the deal will score +20 points of profit:
MovingInWLUSE = true; LevelWLoss=5 ; LevelProfit =20;
Note that the difference between LevelProfit - LevelWLoss must always be greater than or equal to the minimum stop on the server.
Added AutoTrade_by_Signals parameter to the signals block. This parameter enables the automatic placing of a position in the signal direction, if the signal in that direction exceeded Signals_Alert_After_Percent.
Lot, Stop Loss, and Take Profit are set based on the data entered in the first Positions tab
Attention: the Expert Advisor automatically opens a position on the direction of the signal, without closing the previous one.
- Added parameter
UseAllMagicFromAllAccount - true by default, allows the VTP to manage and process all trades with any magic number on the current symbol.
For example: when using the Close button - all trades on the account of the current currency pair are closed. The CLP tab will also work with all trades.
If false - the panel works only with its own trades with the specified MagicNumber
General changes and improvements:
-Depending on the account currency, added the corresponding icon.
-Improved the function for displaying the trade levels when hovering the panel.
(when hovering the panel, the trade levels of the terminal are disabled, so that the stop levels are not caught when pressing buttons).
-Fixed and improved the function for calculating commission and swap for INFO,CLP.
-Changed the tooltip for lots when enabling the DynamicLotStopLoss || DynamicLotAuto options.
-Added new parameter Show_Future_Line - show the lines and description of the future trade.
This function displays the stop loss / take profit lines of the future trade on the chart, statement in points, price and current profit/loss.
It also displays the position opening line with indication of the lot. If you set the lot to be calculated based on stop loss/deposit in the settings, the EA will display the calculated lot.
-TrailingStop now calculates and considers the commission when trailing the position.
-Fixed display of the cumulative position type in the Info tab.
-Added the value of tick for 1 lot and for cumulative lot of the opened positions to the TickValue line.
-Added the Commission line for displaying the current commission of the open deals.
-Added parameter Use_Lots_in_CLP_Points for working with the CLP tab - true - the EA will also consider the lot of those positions during calculation of profit points. This option can be useful in trading on a hedging account with different lots.
opened 2 SELL positions on EURUSD
SELL 0.01 with profit of 20 and 0.2 USD
SELL 0.02 with loss of -12 points -0.24 USD
-If Use_Lots_in_CLP_Points = false the EA will calculate the "net" points.
In this case, the Profit will be: -0.04 USD or 8 points.
As we can see, the position gained profit in points, but it is a loss in USD.
-If Use_Lots_in_CLP_Points = true the EA will calculate points with consideration of lots.
In this case, the profit will be: -0.04 USD or -4 points.
If calculation of profit is in points and the "Include lots in profit calculation" is enabled,
the EA will find the minimum lot of the provided positions and calculate the Points on that basis.
Minimum position 0.01, 1 "net" point = 1 point,
If a position is opened with a lot of 0.02, then 1 net point = 2 points with consideration of the lot.
If a position is opened with a lot of 0.05, then 1 net point = 5 points with consideration of the lot.
-Added checking of the input values for closing profit or loss:
If the specified profit is lower than the current - system generates a warning and disabled the closure mode.
If the specified loss is greater than the current - system generates a warning and disabled the closure mode.
If set to 0 and user attempts to enable closure - system generates an error.
-Added the AutoCorrect_LevelCLP parameter:
Only negative values can now be entered to the loss field. If user enters +10, the system automatically converts it to -10.
Only positive values can now be entered to the profit field. If user enters -10, the system automatically converts it to +10.
Only a positive value can be entered in the CLP_TralOptions, otherwise the EA generates an error.
-Revised and improved the MAGIC TARGET button.
-When enabled and line is moved, the type of the future position and lot of the future position is displayed.
-When pressing Place, the EA checks the correctness of level placement, and if the levels are specified incorrectly, yjr EA cancels the order placement and points at the incorrect data.
-Added parameter MAGIC_FONTSIZE = size of text on the chart.
-Added check for the "Distance" field, if Distance ==0, the EA cancels the order placement.
-When using the MAGIC TARGET, the Grid and Distance fields can now be modified.
Added parameter CLP_DeleteStopOrders for the CLP block. When deals are closed by profit or loss, deletes all pending orders.
Added the MagicNumber parameter when opening positions and orders. The Magic number is involved in: opening/closing positions, placing/deleting pending orders, virtual stop loss/take profit, trailing stop of positions. All other blocks works without the magic number.
Without rounding - place stop orders without rounding
To 1 digit - rounding to 1 digit. For example, if Stoploss= 1.23456, the trade will be opened with a stop loss of 1.23450
To 2 digits - rounding to 2 digits. For example, if Stoploss= 1.23456, the trade will be opened with a stop loss of 1.23400
All variables and data changes made in the panel are now saved when the terminal is restarted.
If you turn off the terminal and turn it on again - all the parameters will be re-loaded from the global variables.
Added the TrailingProfit function to the CLP tab:
Trailing Stop at Closing.
A new function for trailing profits has been implemented on user demand. In this case, the profit is fixed with some correction. As soon as the profit reaches the specified value, the Expert Advisor saves the current profit level and starts trailing the profit.
If you made settings for closing at the profit of 10 dollars:
Profit $ - positive closing.
Profit $ - value of positive closing.
TrailingProfit- distance from Profit $, which, when reached, triggers trailing of profit.
If Profit $ is set to 10 and TrailingProfit is set to 5 the Trailing Stop will be set at 5 dollars. The Trailing Stop will come into play when the Expert Advisor passes the 10 dollar line and start moving following the profit. The Journal will show entries about the current profit status.
When the total profit falls below the last fixed level, TrailingProfit, the Expert Advisor will perform forced closing of all position.
The function works for all closure types: Every symbol, Current symbol, Separate BUY and SELL direction, Each order separately.
Virtual stop loss and take profit mode.
E.g. if you set closure at a loss of -5 $ and a profit of 100 points: each trade will be closed separately either by a loss-loss of -5 $ or by a take-profit of 100 points.
Added BUY SELL trend signals (in percentage) on the Signals tab.
Added the ability to hide individual indicators and timeframes for calculating percentages from the Signals tab:
Signals_M1 = true;
Signals_M5 = true;
Signals_M15 = true;
Signals_M30 = true;
Signals_H1 = true;
Signals_H4 = true;
Signals_D1 = true;
Signals_W1 = true;
Signals_BARS = true;
Signals_MA = true;
Signals_MACD = true;
Signals_Stoch = true;
Signals_RSI = true;
Signals_CCI = true;
Signals_WPR = true;
Signals_BB = true;
Signals_ICH = true;
Signals_ALI = true;
Added the ability to display the alert on the screen when using the Tab Signals (Note: Tab Signals thus should be active).
If Signals_Alert_After_Percent = 50, then if the selected timeframe and BUY or SELL indicators are higher than 50%, VIRTUALTRADEPAD shows Alert.
example: Step TrailingStop = 1 then every 1 point position will be modified.
example: Step_TrailingStop = 25, then every 25 points position will be modified.
Added checkbox "Separate BUYSELL" to panel CLP, which allows to calculate and close positions on the overall profit or loss separately for BUY and SELL.
Revised the system of signals for the Signals panel.
This tab shows the trend for the TF and indicator. Previously, signals were indicated after their activation. Now, the current trend is displayed.
If the priceline is higher than the current price - sets BuyStop
If the priceline is lower than the current price - sets SellStop
New color options:
color MAGIC_ORDER - color of the price line for MAGICTARGET;
color MAGIC_STOPLOSS - Stop Loss line color for MAGICTARGET;
color MAGIC_TAKEPROFIT - Take Profit line color for MAGICTARGET;
FontSizeTextPrice - Font size for the column Price
Digitss - Display value of the price for a 4-digit or 5 digit broker
CommentOrders - Comment orders at the opening panel
I am glad to present you a new function for trading via my panel in one click — MAGIC TARGET.
MAGIC TARGET is a functional button, a control element of the Orders tab. It is designed for the fast setting of a pending or a market order in the МТ4 and МТ5 platforms.
MAGIC TARGET button automatically defines a placed order type quickly and reliably.
Added parameters for setting a lot by an auto lot from a deposit and a stop loss
extern bool DynamicLotStopLoss=false; // Autolot from StopLoss
extern bool DynamicLotAuto=false; // Autolot from Deposit
Added step parameters for increasing and decreasing the settings (stop loss, take profit, lots, distance)
extern double Step_Lots=0.01;
input int Step_StopLoss=1;
input int Step_TakeProfit=1;
input int Step_Distance=1;
A new option called VirtualSLTPUse has appeared in the settings. When enabled, all stop losses and take profits on the panel become virtual. Virtual stop loss and take profit operation is also enabled by ticking the appropriate option. You should also set stop loss and take profit value. After that, stop lines appear on the chart for the appropriate position. The level is calculated from a position Open price.
- FontSizeEDIT - font size for input fields (lot, take profit, stop loss).
- FontSizeText - size of text labels.
- FontSizeArrow - size of arrows in Signals tab.