Good afternoon, colleagues. I can't find an error in the code. The .Magic() method of theCPositionInfo class gives the correct value, if the trade is opened directly in the code through the Trade.mqh class.
If I open a deal through Trade.mqh, but called in another class, then the.Magic() method gives 0 in the Expert Advisor code. Why is it so?
Good afternoon, colleagues. I can't find an error in the code. The .Magic() method of theCPositionInfo class gives the correct value, if the trade is opened directly in the code through the Trade.mqh class.
If I open a deal through Trade.mqh, but called in another class, then the.Magic() method gives 0 in the Expert Advisor code. Why is it so?
I am attaching the code.
I do not open the code)
So, the second variant does not use Magic, look carefully at the code
Good afternoon, colleagues. I can't find an error in the code. The .Magic() method of theCPositionInfo class gives the correct value, if the trade is opened directly in the code through the Trade.mqh class.
If I open a deal through Trade.mqh, but called in another class, then the.Magic() method gives 0 in the Expert Advisor code. Why is it so?
I am attaching the code.
I haven't even looked at the archive.
The algorithm is always the following: You create 'm_trade' - object of CTrade class. If you want it to trade by its Magic - you must do
m_trade.SetExpertMagicNumber(InpMagic);
- That is, you must set this Magic for the object of CTrade class.
You have to check in the debugger. I can't say for sure.
Got it, thanks.
Friends,please advise how to prescribe a code in the advisor to trade only in one direction Buy or Sell
F7 - general - shopping only
F7 - general - purchases only
no such thing in mt5
Friends,please advise how to prescribe a code in the advisor to trade only in one direction Buy or Sell
That's the way it is;
That's the way it is;
Thank you
Good afternoon, colleagues. I can't find an error in the code. The .Magic() method of theCPositionInfo class gives the correct value, if the trade is opened directly in the code through the Trade.mqh class.
If I open a deal through Trade.mqh, but called in another class, then the.Magic() method gives 0 in the Expert Advisor code. Why is it so?
I am attaching the code.
Good afternoon, colleagues. I can't find an error in the code. The .Magic() method of theCPositionInfo class gives the correct value, if the trade is opened directly in the code through the Trade.mqh class.
If I open a deal through Trade.mqh, but called in another class, then the.Magic() method gives 0 in the Expert Advisor code. Why is it so?
I am attaching the code.
I do not open the code)
So, the second variant does not use Magic, look carefully at the code
Good afternoon, colleagues. I can't find an error in the code. The .Magic() method of theCPositionInfo class gives the correct value, if the trade is opened directly in the code through the Trade.mqh class.
If I open a deal through Trade.mqh, but called in another class, then the.Magic() method gives 0 in the Expert Advisor code. Why is it so?
I am attaching the code.
I haven't even looked at the archive.
The algorithm is always the following: You create 'm_trade' - object of CTrade class. If you want it to trade by its Magic - you must do
- That is, you must set this Magic for the object of CTrade class.
there's no such thing in mt5.
I'm doing it the old-fashioned way, I can't get out of it...