bugs09:
Hi,
I am placing buystop\sellstop order and want to modify their sp\tl. For this i want to check whether my pending are order are filled or not so that i can specify tp\sl value. How can i check pending order execution ?
i am using following lines of code but it is not really working ...
Thanks
What moment did you start coding ??
How many trades did you place ???
Are there situations you have several trades open ??
If so then why not check other trades ??
bool order = OrderSelect(0,SELECT_BY_POS); int orderTk = OrderTicket(); if(OrderType() == OP_BUYSTOP && OrderOpenPrice()!=0) { //modify order }
- If the OrderSelect fails everything after is bogus. What are Function return values ? How do I use them ? - MQL4 forum
- You can't open a pending order with a zero price. OrderOpenPrice() will ALWAYS be non-zero.
- If the order has opened, it is no longer a pending order. OrderType will change from OP_BUYSTOP to OP_BUY.
- Why aren't you using a OrderSelect loop to find ALL open orders and filter with your pair and magic number so your code is compatible with every other EA and manual trading?
deVries:
No,i have just one trade either buystop or sellstop at a time.
What moment did you start coding ??
How many trades did you place ???
Are there situations you have several trades open ??
If so then why not check other trades ??
WHRoeder:
- If the OrderSelect fails everything after is bogus. What are Function return values ? How do I use them ? - MQL4 forum
- You can't open a pending order with a zero price. OrderOpenPrice() will ALWAYS be non-zero.
- If the order has opened, it is no longer a pending order. OrderType will change from OP_BUYSTOP to OP_BUY.
- Why aren't you using a OrderSelect loop to find ALL open orders and filter with your pair and magic number so your code is compatible with every other EA and manual trading?
Thanks i got my answer.
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
Hi,
I am placing buystop\sellstop order and want to modify their sp\tl. For this i want to check whether my pending are order are filled or not so that i can specify tp\sl value. How can i check pending order execution ?
i am using following lines of code but it is not really working ...
Thanks