☆本站外汇EA驻群后全部免费下载!请点击加入QQ下载群:1128719745 ,由于免费EA无法尽数测试,请自测和做好风控!
当前位置:首页 > 外汇EA集市 > 马丁/加仓EA > 售价476美金的商业EA源码奉献 内容

售价476美金的商业EA源码奉献

选择字号: 超大 标准 发布时间:2022-07-19 15:36 | 作者:外汇EA


  1. //用于15分钟。
  2. //EA名字叫“高级外汇智能交易系统
  3. //-------------------------------------------------------------------------
  4. extern string G_Parameters = "---- Trade Management ----";
  5. extern int MaxTrades = 1;
  6. extern double TakeProfit = 30;//30/40//50
  7. extern int StopLoss = 75;
  8. extern bool UseHourTrade = FALSE;
  9. extern int FromHourTrade = 6;
  10. extern int ToHourTrade = 18;
  11. extern int magic = 3557;
  12. extern string MM_Parameters = "---- Money Management ----";
  13. extern double Lots = 1.0;
  14. extern bool MM = FALSE;
  15. extern bool AccountIsMicro = FALSE;
  16. extern int Risk = 15;
  17. double gd_144 = 1.0;
  18. int g_error_152;

  19. double setpoint() {
  20.    double ld_ret_0;
  21.    if (Digits <= 3) ld_ret_0 = 0.01;
  22.    else ld_ret_0 = 0.0001;
  23.    return (ld_ret_0);
  24. }
  25. int init() {
  26.    string ls_0 = "2019.08.08";
  27.    int l_str2time_8 = StrToTime(ls_0);
  28.    if (TimeCurrent() >= l_str2time_8) {
  29.       Print("The trial version has been expired");
  30.       return (0);
  31.    }
  32.    if (Period() != PERIOD_M15) {
  33.       Print("Please select 15 min period.");
  34.       return (0);
  35.    }
  36.    SetDigits();
  37.    HideTestIndicators(TRUE);
  38.    return (0);
  39. }
  40. void SetDigits() {
  41.    if (Digits == 5 || Digits == 3) gd_144 = 10;
  42. }
  43. void deinit() {
  44.    Comment("");
  45. }
  46. int orderscnt() {
  47.    int l_count_0 = 0;
  48.    for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {
  49.       if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES))
  50.          if (OrderSymbol() == Symbol() && magic == OrderMagicNumber()) l_count_0++;
  51.    }
  52.    return (l_count_0);
  53. }
  54. int start() {
  55.    double ld_0;
  56.    double ld_8;
  57.    int l_ticket_16;
  58.    //ads();
  59.    double l_ihigh_20 = iHigh(NULL, 0, 1);
  60.    double l_ihigh_28 = iHigh(NULL, 0, 2);
  61.    double l_ihigh_36 = iHigh(NULL, 0, 1);
  62.    double l_ihigh_44 = iHigh(NULL, 0, 2);
  63.    double l_ilow_52 = iLow(NULL, 0, 1);
  64.    double l_ilow_60 = iLow(NULL, 0, 2);
  65.    double l_ilow_68 = iLow(NULL, 0, 1);
  66.    double l_ilow_76 = iLow(NULL, 0, 2);
  67.    double l_ima_84 = iMA(NULL, 0, 3, 0, MODE_EMA, PRICE_CLOSE, 1);
  68.    double l_ima_92 = iMA(NULL, 0, 13, 0, MODE_EMA, PRICE_CLOSE, 1);
  69.    double l_ima_100 = iMA(NULL, 0, 36, 0, MODE_EMA, PRICE_CLOSE, 1);
  70.    double l_imomentum_108 = iMomentum(NULL, 0, 100, PRICE_OPEN, 0);
  71.    double l_iadx_116 = iADX(NULL, 0, 41, PRICE_CLOSE, MODE_MAIN, 0);
  72.    double l_irsi_124 = iRSI(NULL, 0, 31, PRICE_CLOSE, 0);
  73.   // Comments();
  74.    if (MM) Lots = subLotSize();
  75.    int l_ord_total_132 = OrdersTotal();
  76.    if (l_ord_total_132 < 1) {
  77.       if (l_ihigh_20 < l_ima_100 || l_ima_84 > l_ima_92 || (l_ilow_52 > l_ilow_60 && l_ilow_76 > l_ilow_60 && l_ihigh_36 > l_ihigh_28) && l_imomentum_108 > 100.0 && l_iadx_116 > 19.0 &&
  78.          l_irsi_124 > 70.0) {
  79.          if (orderscnt() < MaxTrades) {
  80.             if (StopLoss == 0) ld_0 = 0;
  81.             else ld_0 = Ask - StopLoss * setpoint() * gd_144;
  82.             if (TakeProfit == 0.0) ld_8 = 0;
  83.             else ld_8 = Ask + TakeProfit * setpoint() * gd_144;
  84.             l_ticket_16 = OrderSend(Symbol(), OP_BUY, Lots, NormalizeDouble(Ask, Digits), 2, 0, 0, "Ripper", magic, 0, Blue);
  85.             if (l_ticket_16 <= 0) {
  86.                g_error_152 = GetLastError();
  87.                if (g_error_152 > 0) Print("BuyOrderSend failed: ", g_error_152, ": ", g_error_152);
  88.             } else OrderModify(l_ticket_16, OrderOpenPrice(), NormalizeDouble(ld_0, Digits), NormalizeDouble(ld_8, Digits), 0, CLR_NONE);
  89.             PlaySound("Alert.wav");
  90.          }
  91.       }
  92.       if (l_ilow_52 > l_ima_100 || l_ima_92 > l_ima_84 || (l_ihigh_28 > l_ihigh_20 && l_ihigh_28 > l_ihigh_44 && l_ilow_60 > l_ilow_68) && l_imomentum_108 < 100.0 && l_iadx_116 < 21.0 &&
  93.          l_irsi_124 < 30.0) {
  94.          if (orderscnt() < MaxTrades) {
  95.             if (StopLoss == 0) ld_0 = 0;
  96.             else ld_0 = Bid + StopLoss * setpoint() * gd_144;
  97.             if (TakeProfit == 0.0) ld_8 = 0;
  98.             else ld_8 = Bid - TakeProfit * setpoint() * gd_144;
  99.             l_ticket_16 = OrderSend(Symbol(), OP_SELL, Lots, NormalizeDouble(Bid, Digits), 2, 0, 0, "Ripper", magic, 0, Red);
  100.             if (l_ticket_16 <= 0) {
  101.                g_error_152 = GetLastError();
  102.                if (g_error_152 > 0) Print("SellOrderSend failed: ", g_error_152, ": ", g_error_152);
  103.             } else OrderModify(l_ticket_16, OrderOpenPrice(), NormalizeDouble(ld_0, Digits), NormalizeDouble(ld_8, Digits), 0, CLR_NONE);
  104.             PlaySound("Alert.wav");
  105.          }
  106.       }
  107.       return (0);
  108.    }
  109.    return (0);
  110. }
  111. void Comments() {
  112.    string ls_0 = "";
  113.    string ls_8 = "\n";
  114.    string ls_16 = ""
  115.       + "\n"
  116.       + " Copyright ?2010, ForexRipperEA"
  117.       + "\n"
  118.       + "======================"
  119.       + "\n"
  120.       + "BROKER INFORMATION:"
  121.       + "\n"
  122.       + "Broker:        " + AccountCompany()
  123.       + "\n"
  124.       + "======================"
  125.       + "\n"
  126.       + "MARGIN INFORMATION:"
  127.       + "\n"
  128.       + "Free Margin:            " + DoubleToStr(AccountFreeMargin(), 2) + ls_8 + "Used Margin:            " + DoubleToStr(AccountMargin(), 2)
  129.       + "\n"
  130.    + "======================" + ls_8;
  131.    for (int l_count_24 = 0; !IsStopped() && !IsConnected(); l_count_24++) {
  132.       ls_0 = "Not connected.";
  133.       Sleep(150);
  134.    }
  135.    if (UseHourTrade)
  136.       if (!(Hour() >= FromHourTrade && Hour() <= ToHourTrade)) ls_0 = "Non-Trading Hours!";
  137.    Comment(ls_16 + ls_0);
  138. }
  139. double subLotSize() {
  140.    double ld_ret_0 = MathCeil(AccountFreeMargin() * Risk / 1000.0) / 100.0;
  141.    if (AccountIsMicro == FALSE) {
  142.       if (ld_ret_0 < 0.1) ld_ret_0 = Lots;
  143.       if (ld_ret_0 > 0.5 && ld_ret_0 < 1.0) ld_ret_0 = 0.5;
  144.       if (ld_ret_0 > 1.0) ld_ret_0 = MathCeil(ld_ret_0);
  145.       if (ld_ret_0 > 100.0) ld_ret_0 = 100;
  146.    } else {
  147.       if (ld_ret_0 < 0.01) ld_ret_0 = Lots;
  148.       if (ld_ret_0 > 1.0) ld_ret_0 = MathCeil(ld_ret_0);
  149.       if (ld_ret_0 > 100.0) ld_ret_0 = 100;
  150.    }
  151.    return (ld_ret_0);
  152. }


【下载必读】如何下载本站资源:

*本站资源全部免费下载,请加QQ群:1128719745,验证消息【EAMT】,通过后在【群文件】搜索名称下载!群内禁发广告,每个QQ仅1次申请资格,请珍惜!

*群内资源采用最新的压缩方式,双击直接解压,解压缩时请关闭杀毒软件或允许。无毒请放心使用!


★据此入市,风险自担,谨防损失!★
最新文章
随机文章