OrdersTotal returns 0
#include <Trade\Trade.mqh>
CTrade trade;
int gi_flag=1;
void OnTick()
{
if(gi_flag==1)
{
trade.PositionOpen(_Symbol,ORDER_TYPE_SELL,1, SymbolInfoDouble(_Symbol,ORDER_TYPE_SELL==ORDER_TYPE_SELL ? SYMBOL_BID:SYMBOL_ASK),0,0);
gi_flag=0;
}
PrintFormat(DoubleToString(OrdersTotal(),1));
}
Although I understand it should return 1, or am I reading it wrong?
Running the tester on EURUSD, everything works, both orders are sent. If we uncomment the line, GBPUSD order is not opened and there is an error in the log:
2010.06.02 10:34:26 Core 1 failed instant sell 1.00 GBPUSD at 0.00000 [Invalid stops]
2010.06.02 10:34:26 Core 1 No prices for symbol GBPUSD
I tried SymbolInfoTick, same thing.
Do you know the SymbolInfoTick or SymbolInfoDouble?