稳健的外表MetaTrader 4EA

稳健的外表MetaTrader 4EA基本介绍

  请一定要修改代码删除/* */符号及*/后面部分再运行,由于本系统平仓功能有问题实际测试不能正常平仓,本人非专业程序员能力有限无法解决是借壳发布的希望专业人士修改特来分享(见笑)本策略简单就是价格上破下破入场重点在资金管理。

  If you still don't know, copy the following code directly.

  还是不清楚就直接复制下面代码吧

  //+------------------------------------------------------------------+ //| myea.mq4 | //|Copyright peace | //|1006672928@qq.com | //+------------------------------------------------------------------+ //#property copyright "peace" //#property link"1006672928@qq.com" //#property version "1.00" //#property strict #include #include extern intMAGICMA= 1688; extern double Lots = 0.1; extern double multiplerate = 2.0; extern double maxlots = 2; extern intorderquantity = 6; extern double guaranteedbottomincome=5; extern bool SndMl= false; datetime SellTime,BuyTime; //--------------------------------------------------------------------------- double currentlyorderlots() { double lots=0.0; if(OrdersTotal()>0) { for(int i=0;i0) { for(int i=0;i0) { int i=OrdersTotal()-1; { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) { if(OrderSymbol()==Symbol()) { if(OrderMagicNumber()==MAGICMA) { if(currentlyprofit()>=0) { lotsok=Lots; } else { lotsok=DoubleToStr(NormalizeDouble(OrderLots()*multiplerate,1),1); if(lotsok>maxlots) { lotsok=maxlots; } //break; } //break; } } } } } else { return(Lots); } return(lotsok); } //+------------------------------------------------------------------+ //| //+------------------------------------------------------------------+ void CheckForOpen() { intres; string sHeaderLetter; string sBodyLetter; //---- if(Close[0]High[1]&&BuyTime!=Time[0]&&(BuyOrders(Symbol())Lots&¤tlyprofit()>=guaranteedbottomincome) {rtvl=breakorderstotalclose();} //---- for(int i=0;i=0){rtvl=OrderClose(OrderTicket(),OrderLots(),Bid,3,Lime);} if ( SndMl == True && rtvl != False ) { sHeaderLetter = "Operation CLOSE BUY at" + Symbol()+""; sBodyLetter = "Close order Buy at"+ Symbol() + " for " + DoubleToStr(Bid,4)+ ", and finish this Trade"; sndMessage(sHeaderLetter, sBodyLetter); } break; } if(OrderType()==OP_SELL) { if(Close[0]>High[1]&¤tlyprofit()>=0){rtvl=OrderClose(OrderTicket(),OrderLots(),Ask,3,Lime);} if ( SndMl == True && rtvl != False ) { sHeaderLetter = "Operation CLOSE SELL at" + Symbol()+""; sBodyLetter = "Close order Sell at"+ Symbol() + " for " + DoubleToStr(Ask,4)+ ", and finish this Trade"; sndMessage(sHeaderLetter, sBodyLetter); } break; } } //---- } //------------------ 部分平仓 ------------------- //==================================================================== bool breakorderstotalclose() { bool rtvl; for (int i=OrdersTotal();i>=0; i--) { if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true) { if(OrderMagicNumber()!=MAGICMA || OrderSymbol()!=Symbol()) continue; if(OrderType()==OP_BUY&&OrderMagicNumber()==MAGICMA) {rtvl=OrderClose(OrderTicket(),OrderLots(),Bid,3,Lime);} if(OrderType()==OP_SELL&&OrderMagicNumber()==MAGICMA) {rtvl=OrderClose(OrderTicket(),OrderLots(),Ask,3,Lime);} } } return(rtvl); } //-------------------------------------------------------------------- // //-------------------------------------------------------------------- void sndMessage(string HeaderLetter, string BodyLetter) { int RetVal; SendMail( HeaderLetter, BodyLetter ); RetVal = GetLastError(); if (RetVal!= ERR_NO_MQLERROR) Print ("平仓失败: ", ErrorDescription(RetVal)); } //+------------------------------------------------------------------+ //| //+------------------------------------------------------------------+ void start() { Comment("","n", "交易品种 : "+ChartSymbol(0),"n", "","n", "图表周期 : ", _Period,"分钟", "n", "","n", "当前订单总量 : ", currentlyorderlots()," 手", "n", "","n", "当前多单总量 : ", BuyOrders(Symbol()),"手", "n", "","n", "当前空单总量 : ", SellOrders(Symbol())," 手", "n", "","n", "当前订单总数 : ", CalculateCurrentOrders(Symbol())," 张", "n", "","n", "当前订单总盈亏 : ", currentlyprofit()," $", "n", "","n", "下个订单交易量 :", getlots()," 手","n", "","n" ); //---- check for history and trading if(Bars<25 || IsTradeAllowed()==false) return; //---- if(CalculateCurrentOrders(Symbol())>0){CheckForClose();} if(CalculateCurrentOrders(Symbol())

稳健的外表MetaTrader 4EA特点总结

  在'EA交易'部分提供多种应用程序进行自动分析和交易。它拥有基于不同交易计算方法的多种应用程序并提供不同程度的自动化。您可以找到能够完全自动分析和交易处理的简单EA和复杂的自动交易。

  这些应用程序可以在MetaTrader 4中下载和运行。建议在策略测试器中测试和优化EA交易。来自程序库的EA交易可以从MetaTrader 4平台和MetaEditor开发环境进行访问。

稳健的外表MetaTrader 4EA安装方法

第一步:打开MT5交易软件,点击左上方的【文件】——【打开数据文件夹】。

第二步:依次点击文件夹【MQL4/MQL5】——【Indicators】,把下载的【稳健的外表MetaTrader 4EA】放入【Indicators】文件夹中。

第三步:重新启动MT4/MT5,然后在【导航】中点击【指标】,您将在下拉列表中找到刚刚放入的技术指标。

第四步:鼠标右键点击这个技术指标,并选择【添加到图表】将该指标添加至对应的产品图表中。

第五步:在技术指标参数设置框内,对技术指标的参数和周期等进行修改,最后点击【确定】。

  • 类型:

    MT4EA

  • 格式:

    .zip

  • 大小:

    KB

  • 系统:

  • 运行:

  • 语言:

    mql5

  • 更新:

    2021-01-06

小编提示:注册会员就送10积分!购买积分,请联系客服QQ

分享

热门标签

推荐MT4EA

更多

    Copyright © 2018-2028 / All Rights Reserved

交易软件版权归原作者享有,如无意之中侵犯了您的版权,请按照《版权保护投诉指引》 来信告知,本站将应您的要求删除