
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
Anyway, here is the function and its call
'volume' - some operator expected htghtgfhthf.mq5 104 15
'Lot' - expression has no effect htghtgfhthf.mq5 104 22
It's the structure itself that's being scolded. Variable dowble. Lot equals lot. I don't get it!
At least a semicolon is missing:
TRADE_RETCODE_INVALID_STOPS
Incorrect stops in request
Good afternoon! Suppose I close part of a position by opening a reverse position. What stop loss and profit should I set? Probably it will be the one I set, and not the one I had? No, it cannot be, I will open a reverse trade to reduce the position and the profit and loss are the same as in the previous one. All in all, I got myself confused. I want to know more about it.
...
In order to understand this question in MQL5, we must first understand a simple (but fundamental) phrase:
A trade order is an order to change the state of a trade position
Thus, if we need to close a position, its type will not change, which means we will copy the stop and profit from the position into a new order and send it.
If the position should be reversed, we rearrange the fields.
In fact, a stop is a CCA (a pending order which is bound to the existence of the position and automatically has the same size and inverse type as the position) and a volume change order is a separate non-stop application to execute a transaction right now.
The complexity of understanding comes from the fact that these different position modification actions are carried out by one request.
But you can send a volume change request and a stop change request separately. In some dealings (e.g. market execution) it does not work the other way around.
In general, take a good look at the standard library, there are a lot of things implemented there.
Hm, I don't get it. If we send only a volume change request, in such a request SL==TP==0.0, right? But when such a bid is executed, the SL/TP levels of the position should be reset. So you mean the mandatory connection of <'volume change order'+'stop change order'>?
I'm talking about...
MQL5 Reference / Standard constants, enumerations and structures / Trade constants / Types of trade operations
TRADE_ACTION_DEAL and TRADE_ACTION_SLTP specifically , how you connect them is up to you, but it is possible.
TRADE_ACTION_DEAL and TRADE_ACTION_SLTP specifically , how you link them is up to you, but it is possible .
OK, I'll clarify the question: If we send only a "volume change request", then it is assumed that SL==TP==0.0 in such a request, right?
firstly. You have called MqlTradeRequest in a strange and non "Russian" way, with some context that gives me the impression that the order is different from the position.
Secondly, when you answer yourself the question - what is an application, then this question about SL==TP will immediately disappear.
For the third time, why don't you try it in the terminal? Is it really necessary to discuss every sneeze of misunderstanding in the knowledge base on the forum?
then the question of SL==TP will go away. go to documentation, to practice in the terminal, to the tester, to scripting.
and only then come and ask
with shown for a specific discussion of the problem - the results of what you did and where you got the contradiction.
sergeev:
OK, let me clarify the question: If one only sends a "volume change request", then it is assumed that in such a request SL==TP==0.0, correct?
First of all. You called MqlTradeRequest strangely and not "in Russian".
Unfortunately, you have stopped following the topic in the evening. If someonecalled MqlTradeRequestin a strangeand non -Russian way, it certainly wasn't me. Please pay attention to the inverted commas and the reference to the author of the quoted statement. I am merely communicating with the author within the terminology he suggested. Personally, it doesn't annoy me at all.
Secondly - when you answer yourself the question - what is an application
Yes, it's the same thing.
go to the documentation, to the practice in the terminal, to the tester, to the scripting tryouts.
You once again failed to notice that the question is addressed not to you, but to the specific author. And using his (the author's) terminology. To get an answer to such a question, you do not need to turn on the method of scientific poke. It is enough to hear the answer of the author, who asserts quite definite things. Is it really that hard to understand?
Fourthly, the topic is "For Beginners". Is it really so hard to answer a question quite definitively in this thread, without references to your favourite method? Could you have noticed who exactly raised the main question, and after which post my questions were voiced.