You have to call OrderSelect() before you can call any of the order query functions like OrderType().
Craig:
You have to call OrderSelect() before you can call any of the order query functions like OrderType().
You have to call OrderSelect() before you can call any of the order query functions like OrderType().
Thanks Craig, works like a charm :)

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
The program is as follows:
if (OrdersTotal()==1)
{
if (OrderType()==OP_BUY) Comment("Buy");
if (OrderType()==OP_SELL) Comment("Sell");
}
else
{
Comment("No Order");
}
If there are no open orders it comments correctly, No Order.
The problem is if there is an open order the comment is "Buy" regardless of whether it is a buy or sell order. Why is that?
Please tell me what I'm doing wrong here.
Thanks,
Rayner