The great and terrible MT4 forever (or how to strategise a transition) - page 27
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Forum on trading, automated trading systems and testing trading strategies
OrderModify() in MQL5?
Edward Munroe, 2021.05.27 00:51
Ask a simple question, get a simple answer!? Why has almost everything in mql5 got to be so messy?Good question.
Traditionally a simple task before the weekend.
An open position is 1 lot. After running the script we need to make the position become 0.9 lots.
It is clear that the script can be launched at any moment. That is why there are many situations that may occur.
As usually, I have tried to solve the problem in the classical way.
This script shows a position at 0.8 lots. We need 0.9.
Running this script gives a position of 0.8 lots. I need 0.9.
Tested a couple of times on 2 servers, I only got 0.9
The logic of the tests is clear - we are trying to get rid of asynchronous execution on one tick, the general scheme of this process (how to synchronize on one tick) is important to know
Traditionally a simple task before the weekend.
Holy crap! And I have 0.8 (on MQDemo -0.9). How many more of these rakes are there going to be?
Checked a couple of times on 2 servers, I have only 0.9
Forum on trading, automated trading systems and trading strategy testing
The great and terrible MT4 forever (or how to build a smart migration strategy)
fxsaber, 2021.05.05 08:23
ForexTimeFXTM-Demo01
Solved.
This is probably the most difficult task of all the easily formulated tasks in this thread at the moment.
A very strong test of mastery of the MQL5 trading part.
open a buy order with zero SL and TP, then set an SL and TP of 30 pips (if memory serves me correctly, this is called Market Execution account type - SL and TP cannot be set at once)
For MT4 this code works:
open a buy order with zero SL and TP, then set an SL and TP of 30 pips (if memory serves me correctly, this is called Market Execution account type - SL and TP cannot be set at once)
For MT4 this code works:
About two or three years ago the recognition of the execution type was introduced at terminal level. Now even with Market Execution you can set SL and TP and the terminal itself will split the order into two trade orders.
Open a Buy order with zero SL and TP, then place a 30 pips SL and TP (if memory serves me correctly, this is called Market Execution account type - SL and TP cannot be placed simultaneously)
A common task.