CloseAllOrders - script for MetaTrader 5

CloseAllOrders - script for MetaTrader 5

The script deletes all pending orders on all symbols at a time. Script input parameters: //+----------------------------------------------+ //| SCRIPT INPUT PARAMETERS                     | //+----------------------------------------------+ input uint RTOTAL=4;        // Number of attempts in case of
CloseOrdersBySymbolByType - script for MetaTrader 5

CloseOrdersBySymbolByType - script for MetaTrader 5

The script deletes all orders of the type specified in settings, on the current symbol. Script input parameters: //+----------------------------------------------+ //| SCRIPT INPUT PARAMETERS                     | //+----------------------------------------------+ input ENUM_ORDER_TYPE_  OrderType_=ORDER_TYPE_BUY_LIMIT_; // Order type
Modify SL TP - script for MetaTrader 5

Modify SL TP - script for MetaTrader 5

This script is used to modify the Stop Loss and Take Profit of current symbol position. The new Stop Loss and Take Profit are based on the market price. If the inputs are 0, there will be no modification.
CloseAllPositions - script for MetaTrader 5

CloseAllPositions - script for MetaTrader 5

The script closes all open positions on the current account.
ClosePositionsBySymbol - script for MetaTrader 5

ClosePositionsBySymbol - script for MetaTrader 5

The script closes all positions of the current symbol.
HistorySelectByPosition - script for MetaTrader 5

HistorySelectByPosition - script for MetaTrader 5

An example of using HistorySelectByPosition (based on the HistoryDealGetTicket use example). Position identifier is set as the input parameter. Next, the script attempts to create a list of orders and deals with the specified identifier.  Script operation example: 0: deal #116488443 at 2017.02.07 12:55:56 Enter, buy 0.03 EURUSD (order #132873637, position ID 132873637) 1: deal #116488540 at 2017.02.07 12:56:38 Close by, sell 0.01 EURUSD
MT5 to MT4 Set File Converter - script for MetaTrader 5

MT5 to MT4 Set File Converter - script for MetaTrader 5

This script converts multiple .set files from MT5 format to MT4 format. This is a necessary step for optimizing and running cross-compatible EAs. MetaTrader 5 is able to load .set files created in MT4, however, the format it saves set files in is not compatible with MetaTrader 4. This script acts as a useful tool to make .set files backwards compatible, so you can take advantage of MT5s better strategy tester then run a cross-compatible EA on
BufferInspector - script for MetaTrader 5

BufferInspector - script for MetaTrader 5

This script allows you to see all buffers, even those which are hidden and are used for calculations. The output uses the following format: INDICATOR_NAME [BUFFER_INDEX] [POSITION_INDEX] = VALUE Note: ‌both indexes start at 0.
Reconstruction of positions - script for MetaTrader 5

Reconstruction of positions - script for MetaTrader 5

Reconstruction of positions — an example of working with a trading history on Hedge accounts. An example of the final output: position #0 DEAL_ENTRY_IN, type DEAL_TYPE_BUY, price 1.04552, Deal EURUSD, volume 0.03, DEAL_POSITION_ID #119707903, profit 0.00 DEAL_ENTRY_OUT_BY, type DEAL_TYPE_SELL, price 1.04562, Deal EURUSD, volume 0.02, DEAL_POSITION_ID #119707903, profit 0.20 DEAL_ENTRY_OUT_BY, type DEAL_TYPE_SELL, price 1.04534, Deal EURUSD,
StopAndTake MT5 - script for MetaTrader 5

StopAndTake MT5 - script for MetaTrader 5

When run on the price chart, the script modifies stop loss or take profit of all open orders for the current instrument. Example: If multiple buy positions are opened on the GBPUSD pair, dragging the script to the chart below the current price causes the stop loss levels of all open positions to be modified, and dragging it above the current price causes the take profit levels to be modified.