Rejoignez notre page de fans
- Vues:
- 5946
- Note:
- Publié:
- 2023.04.26 08:15
- Mise à jour:
- 2023.04.26 10:03
-
Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance
Place the file into Services Terminal Folder.
The picture above shows an example of setting up a new sell order with the corresponding comment - 1800 points.
The picture above shows an example of setting up a graphical object of a horizontal line - 450 points.
The picture above shows an example of the result of creating a horizontal line.
To use Real SL Trailing - when you open a trade order in the comment indicate the real stop loss distance in points.
To use Virtual SL Trailing - create horizontal line on same symbol chart then rename it to the name you used before launching the program and in the description of the object indicate the virtual stop loss distance in points.
!!! Be careful !!!
When placing an object on chart use correct SL distance depending on trade direction.
To disable virtual trailing just delete created horizontal line.
To disable real trailing you have to stop this program.
This code is designed to manage only one open position per symbol.
To manage a large number of open positions for a single symbol, you need to edit the code.
![CheckTrades](https://c.mql5.com/i/code/expert.png)
This code initializes the necessary objects and input parameters, and defines a CheckTrades() function that calculates the risk and profit amounts based on the account balance and user input. It then iterates through open orders and checks if the current profit or loss meets the user-defined thresholds, and closes the position if necessary
![Risk Calculator](https://c.mql5.com/i/code/script.png)
Calculates the risk in the account currency for a given trading volume of the selected symbol at different time periods.
![Expert Advisor for Opening Multiple Buy and Sell Orders Based on User Input](https://c.mql5.com/i/code/expert.png)
This MT5 Expert Advisor opens multiple buy and sell orders based on user input, featuring a simple interface with Buy and Sell buttons. The EA calculates lot size, checks the spread against slippage, and places orders accordingly. It is essential to test this EA in a demo account before using it in live trading.
![Dynamic Trailing Stop Loss and Profit Target Management](https://c.mql5.com/i/code/expert.png)
This code snippet implements a dynamic risk management strategy for existing trades. It focuses on closing trades based on profit or loss thresholds and employs a trailing stop loss to lock in profits as the trade moves favorably. The strategy helps manage risk and enhance profitability in a streamlined manner.