One of the first rules in money management and risk management in Forex is to always have a stop-loss set for all your trades. Remember that a broker can execute a margin call on your account if a trade moves against you and you don't have sufficient funds to cover the loss. Long story short, missing a stop-loss may result in your account wiped or badly damaged. The MT4 script SetFixedSLandTP (short for Set Fixed Stop-Loss and Take-Profit) allows you to set a stop-loss and an optional take-profit price for all open orders in a selected currency pair.
There may be cases where you need to open an order quickly or you simply forget to set a stop-loss and take-profit for your order. Sometimes, you may also have many orders open based on the same strategy and you may want to set the stop-loss and take-profit for all of them at once. You can use the SetFixedSLandTP script to do it faster than you would be setting SL and TP manually.
You can download the script for educational purposes and test it on a demo account before apply it to any live trades.
You can also use this script's code as an example of an MQL4 program that works with orders and their parameters in MT4.
When you run the script on a chart, you can set some parameters to limit which orders will be affected. You will also have to specify the pips of distance from the open price for the stop-loss and take-profit price.
The parameters are:
Warning! This script will update also SL and TP for positions that already have SL and TP set, overwriting pre-existing parameters. Please also note that this script will work only with orders for the currency pair it is being applied to.
The script is free to download and use.
To install the script, please follow the instructions below:
You can also read a more detailed instruction on how to perform the installation.