
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
Of course, the question is posted on the forum because it doesn't use a custom library. Use the library #include <Trade\PositionInfo.mqh>
Remember, the problem is that, when executing this function, the BUY price is obtained even when what is there is a SELL
The library is in the attachments
Let's see the code of the EA (Created adhoc for the forum to try to reproduce the bug with the CPositionInfo library): The code is in the attachments
And let's see the result of Comment even when it looks like what's on the chart is a SELL trade. (The comment shows the price for BUY, not for SELL)
Center Price Buys: 1.23096
Center Price Sells: 0.0
I think it is unnecessary to respond to the accusations that have been made here. It seems to me that the forum is to collaborate, not to discuss.
Of course, the question is posted on the forum because it doesn't use a custom library. Use the library #include <Trade\PositionInfo.mqh>
Remember, the problem is that, when executing this function, the BUY price is obtained even when what is there is a SELL
The library is in the attachments
Let's see the code of the EA (Created adhoc for the forum to try to reproduce the bug with the CPositionInfo library): The code is in the attachments
And let's see the result of Comment even when it looks like what's on the chart is a SELL trade. (The comment shows the price for BUY, not for SELL)
Center Price Buys: 1.23096
Center Price Sells: 0.0
I think it is unnecessary to respond to the accusations that have been made here. It seems to me that the forum is to collaborate, not to discuss.
Thanks , that helps a lot
Hey
How do you know that they've made an update to this class recently?
I assume they have since the bug that returned wrong tickets 15 days ago . That was critical too . But it is an assumption as there are no announcements.
Sorry if I came off as a bit tough/harsh,
But you weren't very cooperative, and I've suspected that maybe there is a potentially serious bug,
And also you caught me in a bad day in general.
My apologise for this.
I will not be able to check this until tomorrow (as I am away from my computer),
But I'm pretty certain that I've found the problem in your code (well, 2 problems actually).
Your name choice of the CPositionInfo instance is what made this one slip from my eyes,
But now, after giving a closer look to the code you've provided today, I had noticed it.
Firstly-
The function that returns the position type is PositionType(),
Since you've named the CPositionInfo instance 'Position', at a glance it is easily missed, as it still reads as Position Type,
However, in your code you are calling Type() and not PositionType(),
So code should be changed from-
To-
Second-
PositionType() return is of type ENUM_POSITION_TYPE and not ENUM_ORDER_TYPE,
So below should also be changed from this-
To this-
So it seems that CPositionInfo is no longer a suspect for this bug.
Sorry if I came off as a bit tough/harsh,
But you weren't very cooperative, and I've suspected that maybe there is a potentially serious bug,
And also you caught me in a bad day in general.
My apologise for this.
I will not be able to check this until tomorrow (as I am away from my computer),
But I'm pretty certain that I've found the problem in your code (well, 2 problems actually).
Your name choice of the CPositionInfo instance is what made this one slip from my eyes,
But now, after giving a closer look to the code you've provided today, I had noticed it.
Firstly-
The function that returns the position type is PositionType(),
Since you've named the CPositionInfo instance 'Position', at a glance it is easily missed, as it still reads as Position Type,
However, in your code you are calling Type() and not PositionType(),
So code should be changed from-
To-
Second-
PositionType() return is of type ENUM_POSITION_TYPE and not ENUM_ORDER_TYPE,
So below should also be changed from this-
To this-
So it seems that CPositionInfo is no longer a suspect for this bug.
Sorry if I came off as a bit tough/harsh,
But you weren't very cooperative, and I've suspected that maybe there is a potentially serious bug,
And also you caught me in a bad day in general.
My apologise for this.
I will not be able to check this until tomorrow (as I am away from my computer),
But I'm pretty certain that I've found the problem in your code (well, 2 problems actually).
Your name choice of the CPositionInfo instance is what made this one slip from my eyes,
But now, after giving a closer look to the code you've provided today, I had noticed it.
Firstly-
The function that returns the position type is PositionType(),
Since you've named the CPositionInfo instance 'Position', at a glance it is easily missed, as it still reads as Position Type,
However, in your code you are calling Type() and not PositionType(),
So code should be changed from-
To-
Second-
PositionType() return is of type ENUM_POSITION_TYPE and not ENUM_ORDER_TYPE,
So below should also be changed from this-
To this-
So it seems that CPositionInfo is no longer a suspect for this bug.
wow , good catch