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
Here's the expert himself - cleaned up the unnecessary stuff - there was a lot of bashing :)
How do I close an order?
I opened it like this:
mrequest.action = TRADE_ACTION_DEAL; // immediate execution
mrequest.price = NormalizeDouble(Ask,_Digits); // last Ask price
mrequest.sl = NormalizeDouble(Ask - 10000*_Point,_Digits); // Stop Loss
mrequest.tp = 0; // Take Profit
mrequest.symbol = _Symbol; // symbol
mrequest.volume = Lots; // number of lots to trade
mrequest.magic = 1; // Magic Number
mrequest.type = ORDER_TYPE_BUY; // buy order
mrequest.type_filling = ORDER_FILLING_FOK; // order type - all or nothing
mrequest.deviation=100; // slippage from the current price
OrderSend(mrequest,mresult);
The issue is that we have more than one open order, and we need to close a selective order...
The question is that there is not one order open, but several, and we need to close selectively...
1. Insert the code correctly.
2. If several orders are opened in one direction, the result is one aggregate position.
3. To close an open position you should place oppositely directed orders, the aggregate volume of which is equal to the volume of the position to be closed.
4. If it is necessary to close only a part of a position, then it is necessary to expose oppositely directed orders with corresponding aggregate volume.
1. Insert the code correctly.
2. If several orders are opened in the same direction, the result is one aggregate position.
3. To close an open position you should place oppositely directed orders, the aggregate volume of which equals the volume of the position to be closed.
4. If only part of a position needs to be closed, then opposite orders should be placed with the corresponding aggregate volume.
OK. Thanks. Only now another problem - the closing order does not always close the positions...
Yedelkin,Reshetov,
Hello,
What is the easiest method to extract data from one indicator for several pairs?
Thanks in advance.Is this what you mean?
You mean this?
Hi,
Of course not.
If there's more than one turkey, you have to do it a hundred times for each one, as many pairs eat.
One handler to use all the pairs.
So you want to have one handle, but the iATR indicator works with different characters?
From the description of the iATR indicator, you can see that it is designed to work with only one symbol. Therefore, to work with 4 characters, you need to run 4 copies of the iATR indicator. In its turn, the indicator handle is necessary to access the values of the specific indicator copy, and if you are running 4 indicator copies, you will have to store the appropriate handles somewhere.
If the question of using only one handle is principal, we will have to rewrite theiATR indicator sothat it works with several symbols at once, has the corresponding number of arrays of values, etc.Then it will be possible to use one handle
and use it to address to this or that indicator buffer from myATR.
You can also write it down like this (schematically):