下单脚本有的平台可运行有的不行,什么原因呢?
本帖最后由 itpingtai 于 2017-11-16 22:30 编辑下单脚本有的平台可运行有的不行,什么原因呢?平台支持EA,智能交易设置选项也打开了,文件名也改成字母了,
但还是有的平台可以执行,有的却不可以?
咋回事呢?有人碰到过不?怎么解决?
//+------------------------------------------------------------------+
//| 开多单设止损止盈脚本.mq4 |
//+------------------------------------------------------------------+
extern double 下单手数=0.1;
extern int 止损点数=100;
extern int 止盈点数=200;
int magic=0;
string comment="";
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
DrawLabel("will1","日内交易有赚就跑",5,15,"宋体",11,Aqua,0);
sell(下单手数,止损点数,止盈点数);
return(0);
}
int sell(double Lots,double sun,double ying)
{
int ticket=OrderSend(Symbol( ) ,OP_SELL,Lots,Bid,500,0,0,comment,magic,0,White);
Sleep(500);
if(ticket>0)
{
if(OrderSelect(ticket, SELECT_BY_TICKET)==true)
{
if((sun!=0)&&(ying!=0))
{
bool a1= OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+sun*MarketInfo(Symbol(),MODE_POINT),OrderOpenPrice()-ying*MarketInfo(Symbol(),MODE_POINT),0,Red);
}
if((sun==0)&&(ying!=0))
{
bool a2= OrderModify(OrderTicket(),OrderOpenPrice(),0,OrderOpenPrice()-ying*MarketInfo(Symbol(),MODE_POINT),0,Red);
}
if((sun!=0)&&(ying==0))
{
bool a3= OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+sun*MarketInfo(Symbol(),MODE_POINT),0,0,Red);
}
}
}
return(ticket);
}
void DrawLabel(string name,string text,int X,int Y,string FontName,int FontSize,color FontColor,int zhongxin)
{
if(ObjectFind(name)!=0)
{
ObjectDelete(name);
ObjectCreate(name,OBJ_LABEL,0,0,0);
ObjectSet(name,OBJPROP_CORNER,zhongxin);
ObjectSet(name,OBJPROP_XDISTANCE,X);
ObjectSet(name,OBJPROP_YDISTANCE,Y);
}
ObjectSetText(name,text,FontSize,FontName,FontColor);
WindowRedraw();
}
平台禁止了使用脚本开单..找客服吧 OrderSend..............错误 出現了!!JJPTR又要捲土重來了嗎? 求指教
怪在有的平台能运行,有的不行
页:
[1]