So pull the required functionality from the class and write it to yourself.
Thank you. My question is much easier - I opened an order via OrderSend(request,result) and want to immediately operate with its parameters - for example, print them out. Like this:
//============================================================//--- declare and initialize the trade request and result of trade requestMqlTradeRequest request={0};
MqlTradeResult result={0};
//--- parameters of request
request.action = TRADE_ACTION_DEAL; // type of trade operation
request.symbol = Pair1; // symbol
request.volume = lots; // volume of lot
request.type = oper; // order type
request.price = priceOpen; // price for opening
request.deviation= Slippage; // allowed deviation from the price
request.magic = magic;
//=================================== if(OrderSend(request,result))
Print ("retcode = " + retcode + "; ");
Print ("deal = " + deal + "; ");
Print ("order = " + order + "; ");
Print ("volume = " + volume + "; ");
Print ("price = " + price + "; ")
Some of the parameters, such as retcode, order and volume are printed, but deal and price are not. Especially price is of interest. All results are in MqlTradeResult. I print them all the same way but some of them are printed while others are not. The question - why certain parameters are printed while others are not?
I understand thatArrayCopy only copies one-dimensional arrays?
No, ArrayCopy copies any arrays that are allowed in mql5\4. But they should be identical to be copied. The second dimension of the first array has 50, and the second array has only 20. It is the same for the third dimension.
Algotrader18: Thank you. My question is much easier - I opened an order via OrderSend(request,result) and want to immediately operate with its parameters - for example, print them out. Like this: Some of the parameters like retcode, order and volume are printed, but deal and price are not. Especially price is of interest. All results are available in MqlTradeResult. I print them equally, but some of them are printed while others are not. The question - why certain parameters are printed while others are not?
//============================================================//--- declare and initialize the trade request and result of trade requestMqlTradeRequest request={0};
MqlTradeResult result={0};
//--- parameters of request
request.action = TRADE_ACTION_DEAL; // type of trade operation
request.symbol = Pair1; // symbol
request.volume = lots; // volume of lot
request.type = oper; // order type
request.price = priceOpen; // price for opening
request.deviation= Slippage; // allowed deviation from the price
request.magic = magic;
//=================================== if(!OrderSend(request,result))
return;
Print ("retcode = " + result. retcode + "; ");
Print ("deal = " + result. deal + "; ");
Print ("order = " + result. order + "; ");
Print ("volume = " + result. volume + "; ");
Print ("price = " + result. price + "; ");
If thebasic structure check (pointer check) is successful, true is returned - this does not indicate successful execution of the trade operation. To get a more detailed description of the result of the function, we should analyze the fields of the result structure .
If the basic check is passed, only then we print it. All on one tick. That's why I wrote
Try to search, fxsaber once worked on this problem. I don't know what he did, I'm not interested. It's easier for me to get all these parameters in OnTradeTransaction
So pull the required functionality from the class and write it to yourself.
Especially price is of interest. All results are in MqlTradeResult. I print them all the same way but some of them are printed while others are not. The question - why certain parameters are printed while others are not?
How do I merge arrays?
I understand thatArrayCopy only copies one-dimensional arrays?
How do I merge arrays?
I understand thatArrayCopy only copies one-dimensional arrays?
Thank you. My question is much easier - I opened an order via OrderSend(request,result) and want to immediately operate with its parameters - for example, print them out. Like this: Some of the parameters like retcode, order and volume are printed, but deal and price are not.
Especially price is of interest. All results are available in MqlTradeResult. I print them equally, but some of them are printed while others are not. The question - why certain parameters are printed while others are not?
That's how it was originally
Forum on Trading, Automated Trading Systems and Strategy Tests
Questions from beginners MQL5 MT5 MetaTrader 5
Algotrader18, 2018.10.25 07:39
Afternoon!
I open a position and want to print the content of MqlTradeResult like this:
result.retcode, order and volume are printed but deal and price are always zeros.
Please, could you tell me what I am doing wrong?
Why got lost in the next code.... Question...
I think the return is unacceptable. It will be printed on the next tick.
And I think that return is unacceptable. After all, it will be printed on the next tick.
Learning OrderSend
Returned value
If thebasic structure check (pointer check) is successful, true is returned - this does not indicate successful execution of the trade operation. To get a more detailed description of the result of the function, we should analyze the fields of the result structure .
Exploring OrderSend
If it passes the basic check, only then print it out. All on the same tick. That's why I wrote it.This was originally the case.
why was it lost in the next code... question...
But in my opinion, this one is unacceptable. It will be printed on the next tick.
I tried various variants including this one:
I did not copy everything into the question by mistake...
I've tried different options, including this one:
and copied into the question by mistake...
Hi all!
There is nothing similar. MT5 is multithreaded.