dadocoso :
A position is NOT an ORDER! The COrderInfo class works with PENDING orders, and the CPositionInfo class works with POSITIONS.
Do not confuse PENDING ORDER and POSITION.
Add:
Example - Calculate Positions and Pending Orders
![How to start with MQL5 How to start with MQL5](https://c.mql5.com/36/46/how-to-start-with-mql5__6.jpg)
How to start with MQL5
- 2020.12.19
- www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
![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
Hey guys . I am learning to code and i decided to code a small EA that places two pending orders (buy stop and sell stop) at yesterday's high and low . I menaged to code the part that places two pending orders. Instead I have difficulties understanding why the second part , that is simply supposed to canel the oder order if one is triggered, is not working . From what I understand the ORDER_TYPE of an order changes when a DEAL is made... what am I getting wrong ?
I am using the standard libraries
Thanks
David