Download MetaTrader 5

What's mean"Error opening BUY order : 133"?

To add comments, please log in or register
tiger3
20
tiger3  
11:38:21 try_1min EURUSD,M1: Error opening BUY order : 133
11:38:53 try_1min EURUSD,M1: Error opening SELL order : 133
11:40:07 try_1min EURUSD,M1: Error opening BUY order : 133
11:40:31 try_1min EURUSD,M1: Error opening BUY order : 133
11:43:40 try_1min EURUSD,M1: Error opening SELL order : 133
11:47:16 try_1min EURUSD,M1: Error opening BUY order : 133
11:47:20 try_1min EURUSD,M1: Error opening BUY order : 133
What's mean"Error opening BUY order : 133"? Thanks.
cockeyedcowboy
524
cockeyedcowboy  
tiger3



ERR_TRADE_DISABLED 133 Trade is disabled.
tiger3
20
tiger3  
double TakeProfit = 80;
double TrailingStop = 50;
int ExtPeriod=8;
double ExtBuffer;
double preExtBuffer;
int Lots=1;
double level_low=23,level_high=77;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int cnt, ticket, total;
if(Bars<100)
{
Print("bars less than 100");
return(0);
}
if(TakeProfit<10)
{
Print("TakeProfit less than 10");
return(0); // check TakeProfit
}
// to simplify the coding and speed up access
// data are put into internal variables

ExtBuffer=100+iWPR(NULL,0,ExtPeriod,0);
preExtBuffer=100+iWPR(NULL,0,ExtPeriod,1);

total=OrdersTotal();

if(total<1)
{
// no opened orders identified
if(AccountFreeMargin()<(1000*Lots))
{
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
// check for long position (BUY) possibility

if(preExtBuffer<level_low && ExtBuffer>=level_low) // buy condition
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-TrailingStop*Point,Ask+TakeProfit*Point, "macd sample",16384,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
return(0);
}
// check for short position (SELL) possibility
if(preExtBuffer<level_high && ExtBuffer>=level_high) // sell condition

{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+Point*TrailingStop,Bid-TakeProfit*Point, "macd sample",16384,0,Aqua);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
return(0);
}
return(0);
}
// it is important to enter the market correctly,
// but it is more important to exit it correctly...
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && // check for opened position
OrderSymbol()==Symbol()) // check for symbol
{
if(OrderType()==OP_BUY) // long position is opened
{
// should it be closed?
if(preExtBuffer<level_high && ExtBuffer>=level_high) //buy close
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Red); // close position
return(0); // exit
}
// check for trailing stop
if(TrailingStop>0)
{
if(Bid-OrderOpenPrice()>Point*TrailingStop)
{
if(OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(), 0,Yellow);
return(0);
}
}
}
}
else // go to short position
{
// should it be closed?
if(preExtBuffer>level_low && ExtBuffer<=level_low) //sell close
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Aqua); // close position
return(0); // exit
}
// check for trailing stop
if(TrailingStop>0)
{
if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
{
if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(), 0,Blue);
return(0);
}
}
}
}
}
}
return(0);
}
// the end. Please check for me. Thanks
tiger3
20
tiger3  
00:03:22 '303313': trading by experts is prohibited
00:03:22 '303313': trading by experts is prohibited
00:03:37 '303313': trading by experts is prohibited
00:03:37 '303313': trading by experts is prohibited
00:08:17 '303313': trading by experts is prohibited
Slava
Moderator
7424
Slava  
tiger3, your broker forbid trading operations by expert advisor
tiger3
20
tiger3  
thanks
To add comments, please log in or register