I have a strategy implemented in MQL-4, which one I will migrate to MQL-5, trying to use the corresponding APIs (if possible), I mean, not using the MQL-5 classes.
I'm not a trader and I have read some articles to understand the new concepts, and please correct me if I'm somehow wrong:
What I need for instance is to know how I modify open orders TP and SL, the same way I do in MQL-4. In MQL-4 we navigate through the orders and check if it's necessary to offset the values under certain conditions and criteria.
I hope my question is clear enough.
Looking forward for a return and appreciate your help a lot!
The script is intended for automatic placing of Sell Stop pending orders, Stop Losses and Take Profits on the user specified levels. This script is not that useful as "Virtual pending buy stop", since short positions are opened as Bid price crosses the levels. Thus spread widening is not dangerous. Nevertheless, you need to have this script to prevent unwanted hitting of the Stop Loss levels.
Automation of the process of placing the Sell Stop pending orders, Stop Losses and T
MetaCOT 2 is a set of indicators and specialized utilities for the analysis of the U.S. Commodity Futures Trading Commission reports. Thanks to the reports issued by the Commission, it is possible to analyze the size and direction of the positions of the major market participants, which brings the long-term price prediction accuracy to a new higher-quality level, inaccessible to most traders.
These indicators, related to the fundamental analysis, can also be used as an effective long-term filte
Trade Copier Pro is a powerful tool to copy trade remotely between multiple accounts at different locations over internet. This is an ideal solution for signal provider, who want to share his trade with the others globally on his own rules. One provider can copy trades to multiple receivers and one receiver can get trade from multiple providers as well. The provider can even set the subscription expiry for each receiver, so that receiver will not be able to receive the signal after that
The Expert Advisor implements the classic "triangular arbitrage", which is successfully used by hedge funds.
"Triangular" arbitrage refers to a class of neutral-market strategies, in which the profit or loss of open positions does not depend on the direction of the market movement as a whole.
In order to take profit, the EA exploits a weak spot of market makers - it utilizes the difficulty of balancing cross rates of all currency pairs.
The advantages of the strategy are the following:
The main purpose of the indicator is to detect and mark on a chart the following trade signals described in "New Trading Dimensions":
Bullish and bearish reverse bars with angulation (including squat). Bars in the green and red zones according to the histogram color of Awesome Oscillator and Accelerator Oscillator. Bars in the grey zone, when the Awesome Oscillator and Accelerator Oscillator histograms below these bars have opposite directions. Blue squat bars on chart independent of the
The script allows users to easily close positions if their profit/loss reaches or exceeds a value specified in pips.
Please set slippage value first. Sometimes some positions do not close due to high volatility of the market. Please set larger slippage or restart the script.
Ichimoku Kinko Hyo is a purpose-built trend trading charting system that has been successfully used in nearly every tradable market. It is unique in many ways, but its primary strength is its use of multiple data points to give the trader a deeper, more comprehensive view into price action. This deeper view, and the fact that Ichimoku is a very visual system, enables the trader to quickly discern and filter "at a glance" the low-probability trading setups from those of higher proba
The fractal analysis of the markets is used in the indicator operation algorithm. According to the fractals theory, after the breakthrough of the fractal level confirmed by the closing price located below or above the fractal, the trend wave in the direction of the breakthrough starts to develop. Until the fractal has been passed in the opposite direction, the trend is considered to be acting even if the price is flat or moves backwards. If a bullish fractal has been previously broken through on
Fast Copy MT5 allows to copy trades between different MetaTrader 5 (netting)(hedge) and MetaTrader 4 accounts in any direction and amount, quickly and easily (without loading the system).
Any type of copying is available
MT5 —> MT5 MT5 —> MT4 MT4 —> MT5 MT4 —> MT4
* For any interaction with the MT4, it is necessary to additionally install Fast Copy MT4
One tool for sending and receiving transactions: [master] > [slave] operation mode can be selected in
MACD All MAs-14 is a MACD indicator that allows choosing usual parameters of the standard MACD (constructed from EMA) as well as the type of the moving average to be applied: up to 14 different types.
You can select 9 standard MAs available in MetaTrader 5 - SMA, EMA, SMMA, LWMA, DEMA, TEMA, Frama, VIDYA, AMA, TRIX, and 4 non-standard - LRMA, HMA, JMA, AFIRMA.
Method MA - select the type of moving average to be displayed in the current graph. Period slow MA - the number
Safe Automatic is a safe MetaТrader 5 trading robot working autonomously on a VPS server. The good results are achieved on EURUSD.
The EA applies modified versions of a trend-following strategy, half-pyramiding, scalping, Elliott Wave method and speculating trading with a deposit protection. The EA switches the strategies automatically. The program also takes the news calendar into account: the robot does not enter the market in a 10-minute interval before and after a news rel
Does not support hedging orders on a single symbol on MT5
MultiMTCopier MT5Source - new and improved multi-terminal positions copier for your real / demo account, works faster, requires less, flexible in managing and upgrading, new information support. This expert is designed for terminal MetaTrader5 from which the position will be copied.
The EA will copy all positions without delays Additionally integrated notification in situations requiring user attention Buttons for re
Auto Trade Copier is designed to copy trades between multi MetaTrader 5 accounts/terminals with 100% accuracy.
With this tool, you can act as either a provider (source) or a receiver (destination). All trading actions will be copied from the provider to the receiver with no delay.
Note: Demo version for testing can be downloaded at: https://www.mql5.com/en/market/product/5006.
Followings are highlight features:
Switch between Provider or Receiver role within one tool.One provider can copy tr
The script creates account summary report in a separate window.
The report can be created for all deals and on deals for selected financial instruments.
It is possible to specify a time interval of calculation and save report to htm-file.
The script creates account summary report in a separate window.
The report can be created for all deals and for deals of the selected financial instruments.
It is possible to specify a time interval of calculation and save report to htm-file.
Easy Order is an Expert Advisor allowing you to enter any type of trade with one click based on your RISK preferences.
You can choose to enter a trade and automatically calculate your lot size based on how much of your account you want to risk. Risk is calculated based on your Stop Loss placement. You can use a fixed lot size if you don't want to use risk based calculation of lot size. Your previous setting of risk based or fixed lot size remains saved for your next use of this Expert Advi
Virtual TrailingStop is an Expert Advisor that manages trailing stop without sending its information to the broker server.
EnableVirtualTrailingStop: enable or disable whole function VirtualTrailingStop: the pip use for determine how far the Virtual Trailing Stop will placed calculated from current price StartFromBreakEven: true/false. If true, Virtual Trailing Stop will placed after breakeven BreakEvenPoint: point profit from order open price where the Virtual T
The indicator displays the current market information about the recent trades (their direction and volume).
BackColor - general background color of the indicator; AboveAskBackColor - background color of the line with information about the last trade in case it was performed at the price above Ask; AboveAskFontColor - color of the text entered in the line with information about the last trade in case it was performed at the price above Ask; AtAskBackColor - background color of the
Auto Trade Driver is an automatic powerful tool (run as Expert Advisor) that helps you to manage risk and control orders and maximize your profit in multi-protect/trailing-stop rules.
This tool is very useful for both scalpers and trend followers. It not only calculates the trade risk exactly, but also protects and maximizes your profits in real-time.
With this tool, the only thing you have to do is to enter trade by your own strategy, then it will auto-drive your position with exit strategy y
The indicator determines the inside bar and marks its High/Low. It is plotted based on the closed candles (does not redraw). The identified inside bar can be displayed on the smaller periods. You may set a higher period (to search for the inside bar) and analyze on a smaller one. Also you can see the levels for Mother bar.
Period to find Inside Bar — the period to search for the inside bar. If a specific period is set, the search will be performed in that period. Al
The most profitable trend traders are the ones who know how to recognize not only the market trend, but also the trading opportunities that arise once a trend has been established. The Pz Trend Trading indicator has been designed to profit has much as possible from trends taking place in the maket.
Established trends offer dozens of trading opportunities, but most trend trading indicators neglect them completely, and leave the trader completely uninformed about what the market is doing during a
DeltaVolumeDistribution indicator can be considered as the fusion of the DeltaVolume and TradeSizeDistribution indicators.
This indicator, inspired by the MarketDelta-family charts, computes the net difference between trades occurring at bid and at ask, while trades occurring between bid and ask quotes are not computed. The indicator plots the resulting DeltaVolume as a unique distribution plot.
With the DeltaVolumeDistribution indicator you will actually be able to see the order flow entering
Does not support hedging orders on a single symbol on MT5
MultiMTCopier MT5Receiver - new and improved multi-terminal positions copier for your real/demo account, works faster, requires less, flexible in managing and upgrading, new information support. This Expert Advisor is designed for the MetaTrader 5 terminal, trades will be copied into this terminal.
The EA will copy all positions without delays Additionally integrated notification in situations requiring user attention
Market Profile defines a number of day types that can help the trader to determine market behaviour. A key feature is the Value Area, representing the range of price action where 70% of trading took place. Understanding the Value Area can give traders valuable insight into market direction and establish the higher odds trade. It is an excellent addition to any system you may be using.
Blahtech Limited presents their Market Profile indicator for the MetaTrader community. Inspired by Jim Dalton’s
This indicator allows you to enjoy the two most popular products for analyzing request volumes and market deals at a favorable price:
Actual Depth of Market Chart Actual Tick Footprint Volume ChartThis product combines the power of both indicators and is provided as a single file.
The functionality of Actual COMBO Depth of Market AND Tick Volume Chart is fully identical to the original indicators. You will enjoy the power of these two products combined into the single super-indicator!
We present you an effective software solution for arbitrage between brokers.
The Arbitrage on the market became widespread due to decentralization. There are many liquidity providers, whose quotes differ for various reasons. By tracking the dynamics of changes in the quotes of different brokers, it is possible to determine the delayed and leading brokers, thereby predicting the future prices of the delayed broker for a short time. Knowing these prices and using efficient built-in software filte
COSMOS4U Volume indicator facilitates your trade decisions. It gives confirmation of the running movement and market trends. It highlights current and past accumulation and distribution volumes, comparing them to moving average volume and the highest volume. In addition, it identifies and marks nuances as well as convergence and divergence patterns of bears and bulls in order to provide the market trend and price ranges.
The supported features are as follows:
Fast Volume Moving Average Slow
Exp COPYLOT CLIENT for MT5 is a copier for the МetaТrader 5 platform. It copies forex trades from any accounts. Including those from terminals МТ5 and МТ4.
Install the Expert Advisor in the terminal where you want to copy trades. Specify any text label name as pathRead, for example, "COPY". This should match the master terminal (to bind the two terminals). To copy trades, you need to install the free Master copier in the terminal from where you want to copy the trades: COPYLOT
The indicator displays economic news on the currency chart (the appropriate data must be downloaded from the Internet - please see the download instructions on the screenshots provided). The list of currencies (countries) is customizable. By default it shows all currencies. The main parameters come with a built-in description. In addition, there are parameters for advanced users. News items are divided into 3 categories by degree of importance. There is a great flexibility in display parameter s
Pipfinite creates unique, high quality and affordable trading tools.
Our tools may or may not work for you, so we strongly suggest to try the Demo Version for MT4 first. Please test the indicator prior to purchasing to determine if it works for you.
We want your good reviews, so hurry up and test it for free...we hope you will find it useful.
Breakout Analyzer with Volume Critical
Strategy: Enter confirmed reversal setups Watch Video: (Click Here)Breakout Analyzer with Strength
The script is intended for automatic placing of Buy Stop pending orders, Stop Losses and Take Profits on the user specified levels.
Avoiding unwanted entering a long position in case of false hitting the level as a result of widening of the spread by a dealing center. Avoiding unwanted triggering of a Stop Loss in case a quote pierces a significant level (fractal) without further confirmation with the close price. Setting a necessary virtual order and entering the market in
Did you see the article -
I think it could clarify most of your questions.
1) Orders can be not only pending, but market as well. But market orders are executed fast as a rule (at least if a requested lot is not so large that the order can not be filled for a long time), so you can find them in the history.
2) Position summs up lot sizes of all deals on a symbol. Deal is created when an order is filled (completely or partially). Timeframe does not have any relation to position behaviour, and this is true (and always was true) for MT4 as well.
3) Deal is a result of executing an order.
You should modify SL/TP on position using OrderSend function with TRADE_ACTION_SLTP operation type. The only confusion here is that the function should be probably named "SendRequest", because it is for execution of trade operations in general, not only related to orders.
Thanks for your reply and help!
I had already taken a look at the article above, but my understanding about it was not correct, according to your clearer explanations. Let me explain what I've just understood, and again I kindly ask for your corrections.
- I use OrderSend() for pending orders and market orders. 1) As soon as market orders are executed, they become part of the position on a certain symbol. 2) If one of the market orders reaches the conditions to be closed, it becomes a deal. 3) The pending orders will just be executed when the conditions are reached, and then their current behaviour will naturally follow the steps 1) and 2)
Doubt: About modifying an Order by using TRADE_ACTION_SLTP on the request, its description seen in https://www.mql5.com/en/docs/constants/tradingconstants/enum_trade_request_actions is "Modify Stop Loss and Take Profit values of an opened position". Is it for an open position, not a certain order?Thanks again!Fabrizio.
1) As soon as market orders are executed, they become part of the position on a certain symbol.
2) If one of the market orders reaches the conditions to be closed, it becomes a deal. 3) The pending orders will just be executed when the conditions are reached, and then their current behaviour will naturally follow the steps 1) and 2) Doubt: About modifying an Order by using TRADE_ACTION_SLTP on the request, its description seen in https://www.mql5.com/en/docs/constants/tradingconstants/enum_trade_request_actions is "Modify Stop Loss and Take Profit values of an opened position". Is it for an open position, not a certain order?
1) You may say so. In fact executed orders go to the history. For every order, its entire lot size or partial size is filled by one or more deals, and the deals affects resulting position.
2) Market order is just an "order" in most common sense of this english word - a command to execute some trade action, so the command can not be closed. If you have an open trade - it is shown as a position, and if you want to close it, you should issue another command ("order") to do that. Execution of this next order will create new deal, and it in turn change the position. If you mean SL/TP attributes of an order, then if you specify them, they will be transfered to the resulting position and will play a role of conditions for closing this position. Technically SL/TP are similar to special pending orders (for example, limit for TP) and executed in the same way.
You originally asked about modification of "open orders TP and SL". "Open orders" are positions in MT5, so I answered about modification of SL/TP for a position, but you can of course modify SL/TP for pending orders as well - use TRADE_ACTION_MODIFY.
Here is another somewhat related article - https://www.mql5.com/en/articles/35 - may be you can find usefull examples there.
It seems the article above explains the Position concept differently, if we compare it to the explanation described in https://www.mql5.com/en/articles/211: "Positions
are the contracts, bought or sold
on a financial instrument. A long position (Long) is formed as a
result of buys in anticipation of a price increase, a short position
(Short) is the
result of the sale of asset, in the anticipation of future price
For each account, for every financial instrument, there can be
position. For each symbol, at any given time, there can be only
position - long or short.".
So how can we loop through the open orders if there can be only one open position? My understanding is that the position is the sum up of all open orders profit/loss. If I have 3 open orders of Buy and 2 open orders of Sell, can I assure that I have 3 positions of Buy and 2 positions of Sell?
Thanks again and regards,Fabrizio.
"Open" orders in MT5 are only pending orders. You have to forget MT4 for a while if you want to understand how MT5 is working.
You can send 2 kind of request (order) to the server :
Hope that helps.
Hi, angevoyageur and marketeer!
Thanks a lot for your help!
So, if an order is in execution, I mean, it's "working" in the market, waiting to have one of its conditions reached to be "closed", it will be moved to History. And there I can modify it, for example, adjusting its SL or TP during its working, to adjust them to the current market circumstances. Is that so?
You don't get it yet I think.
There is no such things as "an order is in execution, I mean, it's "working" in the market". If it's on the market, it's a position, not an order.
You can of course change the SL/TP of a position.
Hi, angevoaygeur and marketeer!
Thanks for your patience and help!
It's been really tricky to understand the differences between MT4 and MT5, but I do not give up and, more important, do not hesitate about asking, as I am a completely newbie on it.
After all your explanations, it's now "hands-on time". I will begin migrating my MT4 EAs into MT5 and, as soon as new doubts appear, I will come back and ask again.
Thanks a lot!Fabrizio.