MT4脚本EA-移动止损

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
}
}
}
}
}
}
} //for
return(0);
}
if(OrderSymbol()==Symbol())
{
if (OrderType()<=OP_SELL && OrderSymbol()==Symbol()) //检查标志
{
if(OrderType()==OP_BUY) //多头打开
{
if(TrailingStop>0)
{
if((Bid-OrderOpenPrice())>(Point*MinPorfit))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0, Red);
}
}
}
//+-----------------------------------------------------------+
extern int MinPorfit=-500;
int start()
{
//PlaySound("Tick.wav");
int total = OrdersTotal();
for(int cnt=0;cnt<total; cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
//+------------------------------------------------------------+
// #TrailingStop.mq4|
//+-----------------------------------------------------------+
#property copyright “waihui”
{
If(TrailingStop()>0)
{
If(Bid-OrderOpenPrice()>Point*MinPorfit)
{
If(OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
}
}
}
}
else //go to short position
{
If(TrailingStop>0)
{
If((OrderOpenPrice()-Ask))Point*MinPorfit))
{
If((OrderStopLoss()>Ask+Pointt*TrailingStop)) ||
(OrderStopLoss()==0))
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
If(OrderSymbol()==Symbol)
{
If (OrderType()<=OP_SELL && OrderSymbol()==Symbol() //check for symbol
{
If(OrderType()==OP_BUY() //long position is opened
// #TrailingStop.mq4|
//+-----------------------------------------------------------+
#property copyright "waihui"
#property link "waihui8686@qq.com"
extern int TrailingStop=300;
#property Link “waihui8686@qq.com”
extern int TrailingStop=300;
extern int MinPorfit=-500
Int start()
{Biblioteka Baidu
//PlaySound(“Tick.wav”);
Int total=OrdersTotal();
for(int cnt=0;cnt<total; cnt++)
{
if((OrderStopLoss())<(Bid-Point*TrailingStop))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
}
}
}
}
else //转向空头头寸
{
if(TrailingStop>0)
{
if((OrderOpenPrice()-Ask)>(Point*MinPorfit))
{
if((OrderStopLoss()>(Ask+Point*TrailingStop)) ||
(OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
相关文档
最新文档