![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
After changing the language in Metaeditor, did you reboot it?
Let's check.
I have written this code to check the position:
But for some reason in the comment the values appear with 4 decimal places. Instead of _Digits put 5 still 4 characters, put 3 - 3 characters.
I have written this code to check the position:
But for some reason in the comment the values appear with 4 decimal places. Instead of _Digits put 5 still 4 characters, put 3 - 3 characters.
You probably need the DoubleToString() function.
I have written this code to check the position:
But for some reason in the comment the values appear with 4 decimal places. Instead of _Digits put 5 still 4 characters, put 3 - 3 characters
A deposit is accompanied by a record
DEAL_ENTRY_STATE
Sign of status entry
This is the direction to look in.
I'm confused about myposition.Type(). Did the following thing to check:
The result of testing with the visualization is as follows:
1) there is no position: classtype=no position, functype=no position // as expected
2) there is a sell position: classtype=BUY, functype=SELL // classtype has incorrectly determined the position direction
3) there is a buy position: classtype=BUY, functype=BUY // as it should be
I tried putting if (myposition.Select(_Symbol)) instead of if (PositionSelect(_Symbol)), the result is the same. Maybe myposition.Type() should be written differently for it to correctly determine the direction of sell?
I'm confused about myposition.Type(). Did the following thing to check:
When testing with visualization, the result is as follows:
1) there is no position: classtype=no position, functype=no position // as required
2) there is a sell position: classtype=BUY, functype=SELL // classtype has erroneously determined the position direction
3) there is a buy position: classtype=BUY, functype=BUY // as it should be
I tried putting if (myposition.Select(_Symbol)) instead of if (PositionSelect(_Symbol)), the result is the same. Maybe myposition.Type() should be written differently for correct determination of the sell direction?
If you look closely at the CPositionInfo class "with X-ray", you may notice that the Type() method doesn't return the position type (unlike the PositionType() method).
If you look closely at the CPositionInfo "X-rayed" class, you will notice that the Type() method does not return a position type (unlike the PositionType() method).