欢迎来到天天文库
浏览记录
ID:47732327
大小:27.50 KB
页数:3页
时间:2019-10-11
《MT4脚本EA-移动止损》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、//+------------------------------------------------------------+//#TrailingStop.mq4
2、//+-----------------------------------------------------------+#propertycopyright“waihui”#propertyLink“waihui8686@qq.com”externintTrailingStop=300;externintMinPorfit=-500Intstart(){//PlaySound(“Tic
3、k.wav”);Inttotal=OrdersTotal();for(intcnt=0;cnt0){If(Bid-OrderOpenPr
4、ice()>Point*MinPorfit){If(OrderStopLoss()0){If((OrderOpenPrice()-Ask))Point*MinPorfit)){If((OrderStopLoss()>Ask+Pointt*
5、TrailingStop))
6、
7、(OrderStopLoss()==0)){OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);}}}//+-----------------------------------------------------------+//#TrailingStop.mq4
8、//+-----------------------------------------------------------+#pr
9、opertycopyright"waihui"#propertylink"waihui8686@qq.com"externintTrailingStop=300;externintMinPorfit=-500;intstart(){//PlaySound("Tick.wav");inttotal=OrdersTotal();for(intcnt=0;cnt10、P_SELL&&OrderSymbol()==Symbol())//检查标志{if(OrderType()==OP_BUY)//多头打开{if(TrailingStop>0){if((Bid-OrderOpenPrice())>(Point*MinPorfit)){if((OrderStopLoss())<(Bid-Point*TrailingStop)){OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);}}}}else11、//转向空头头寸{if(TrailingStop>0){if((OrderOpenPrice()-Ask)>(Point*MinPorfit)){if((OrderStopLoss()>(Ask+Point*TrailingStop))12、13、(OrderStopLoss()==0)){OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);}}}}}}}//forreturn(0);}
10、P_SELL&&OrderSymbol()==Symbol())//检查标志{if(OrderType()==OP_BUY)//多头打开{if(TrailingStop>0){if((Bid-OrderOpenPrice())>(Point*MinPorfit)){if((OrderStopLoss())<(Bid-Point*TrailingStop)){OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);}}}}else
11、//转向空头头寸{if(TrailingStop>0){if((OrderOpenPrice()-Ask)>(Point*MinPorfit)){if((OrderStopLoss()>(Ask+Point*TrailingStop))
12、
13、(OrderStopLoss()==0)){OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);}}}}}}}//forreturn(0);}
此文档下载收益归作者所有