Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Unisciti alla nostra fan page
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
![Sistemi Esperti](https://c.mql5.com/i/code/expert.png)
Virtual SL TP Pending with SL Trailing for Symbol Chart - sistema esperto per MetaTrader 4
- Visualizzazioni:
- 4793
- Valutazioni:
- Pubblicato:
- 2024.04.10 05:09
- Aggiornato:
- 2024.04.11 12:10
-
Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance
T"Virtual_SL_TP_Pending_with_SL_Trailing.mq4." It's designed to manage trades by setting virtual stop loss and take profit levels, along with a virtual pending order with an optional trailing stop loss feature.
Here's a breakdown of the script:
- Copyright and Link: Specifies the copyright information and a link to the creator's website.
- Version: Indicates the version of the script.
- Description: Provides information about the script, including the creator's email address, intellectual property details, and a warning about using the software at your own risk.
- Input Parameters: External variables that allow users to customize the behavior of the EA, including:
- StopLossPoints : Initial Stop Loss in points.
- TakeProfitPoints : Initial Take Profit in points.
- SpreadThreshold : Spread threshold for virtual stop loss/take profit in points.
- TrailingStopPoints : Trailing stop in points for the virtual pending order.
- EnableTrailing : Option to enable or disable trailing stop.
- Global Variables: Variables used throughout the script to store initial spread, virtual stop loss, virtual take profit, and pending order price.
- Initialization Function ( OnInit ): Initializes the EA when it's attached to a chart. It calculates the initial virtual stop loss, take profit, and pending order price based on the input parameters.
- Tick Function ( OnTick ): Called on every tick of the price. It checks if the spread has increased beyond the threshold and adjusts the virtual stop loss, take profit, and pending order price accordingly. It also monitors if the price hits the virtual stop loss or take profit and closes the position. Additionally, if trailing stop is enabled and the price reaches the pending order price, it places a virtual pending order with a trailing stop loss.
- Close Position Function ( ClosePosition ): Closes the position when the price hits the virtual stop loss or take profit.
- Place Pending Order Function ( PlacePendingOrder ): Places a virtual pending order with a trailing stop loss if trailing stop is enabled.
This EA provides a flexible way to manage trades using virtual levels and a trailing stop feature, allowing traders to automate their trade management process in MetaTrader 4.
![Close Basket Pairs v1](https://c.mql5.com/i/code/expert.png)
This MQL4 EA is designed to close positions for a basket of currency pairs based on certain profit and loss thresholds.
![Reverse Trades For All Symbols Script](https://c.mql5.com/i/code/script.png)
Reverses all open trades after Closure for all symbols .
![Classic and Virtual Trailing](https://c.mql5.com/i/code/expert.png)
Classic & Virtual Trailing for MT4
![MQL4 Implementation of onTrade Event Handler](https://c.mql5.com/i/code/expert.png)
This is a simple code to mimic onTradeTransaction Event handler defined in MQL5