有您的持续关注
我们会做得更好

FlashMoney888 EA



FlashMoney888 EA应该是出自国人之手,很多函数采用中文命名。测试时候注意里面的日期限制

if (TimeCurrent() <= D'01.12.2022 07:08')

及其它相关交易日期限制。

本网收集整理智能交易EA仅为MQL4编程爱好者提供语法及相关编程技巧的学习研究之用,智能交易存在极高的风险测试请用模拟盘,请勿用于实盘。FlashMoney888 EA源码:

#include <WinUser32.mqh>

extern string 功能隔离线0 = "* =============================== *";
extern string 以下是基本参数设置 = "* 以下是基本参数设置 *";
extern double 起始手数 = 0.1;
extern double 起始手数加倍 = 1.0;
extern int 最大持仓个数 = 6;
extern int 间隔点数 = 13;
extern double 止赢 = 16.0;
extern double 止损 = 300.0;
extern double 移动止损 = 16.0;
extern double profit=0;                    
extern double 最大亏损全部平仓=1400;
extern int 滑点 = 3;
extern int FlashMoney多单标示码 = 1818;
extern int FlashMoney空单标示码 = 1919;
extern string 功能隔离线1 = "* =============================== *";
extern string 以下是用CCI控制开仓方向的设置 = "* 以下是用CCI控制开仓方向的设置 *";
extern bool 用CCI控制开仓方向 = TRUE;
extern string 上一项控制开仓方向的说明1 = "*若设为false,则由EA自动或手动定方向*";
extern string 上一项控制开仓方向的说明2 = "*若设为true,手动控制开仓方向也将失效*";
extern int CCI的时间周期 = 13;
extern int CCI在本水平位以上时首仓只做空 = 150;
extern int CCI在本水平位以下时首仓只做多 = -150;
extern string 方向说明1 = "* 在+10和-10之间时由EA自动定方向 *";
extern string 方向说明2 = "在+10和+150之间且MACD上升时首仓只做多";
extern string 方向说明3 = "在+10和+150之间但MACD下降时首仓只做空";
extern string 方向说明4 = "在-10和-150之间且MACD下降时首仓只做空";
extern string 方向说明5 = "在-10和-150之间但MACD上升时首仓只做多";
extern string 方向说明6 = "* 在+150之上时首仓只做空 *";
extern string 方向说明7 = "* 在-150之下时首仓只做多 *";
extern string 用CCI控制开仓方向的参数说明 = "其中10和-10已固定,+ -150可调整";
extern string 功能隔离线2 = "* =============================== *";
extern bool 手动控制开仓方向 = FALSE;
extern string 上一项手动控制开仓方向说明1 = "默认false为由EA自动计算开仓方向";
extern string 上一项手动控制开仓方向说明2 = "上一项若设为true是手动控制开仓方向";
extern bool 手动控制开仓做多 = TRUE;
extern string 上一项手动控制开仓做多说明 = "上一项若设为false则是开仓做空";
extern string 功能隔离线3 = "* =============================== *";
extern string 以下是对EA开仓的限制 = "* 以下是对EA开仓的限制 *";
extern bool K距临界价格一定点数时不开新仓 = TRUE;
extern double 请输入你认为的临界高点价格 = 1.98765;
extern double 请输入你认为的临界低点价格 = 1.12345;
extern double 距临界价格多少点数时不开新仓 = 30.0;
extern string 功能隔离线4 = "* =============================== *";
extern string 以下是为避开数据市对EA的限制 = "* 以下是为避开数据市对EA设定限制 *";
extern string 以下是一次性可多个时点限制开仓 = "*(一)以下是一次性设多个时点限制开仓*";
extern int MT4平台时间与北京时间的时差 = 5;
extern string 以下是按北京时间设置开关 = "=== 以下是按北京时间设置开关 ===";
extern string 设置多个时点开关的方法 = "默认false为开仓,若设为true则为不开仓";
extern string 多个时点限制开仓说明 = "只限制开新仓,不限制有持仓时的加仓";
extern bool 让EA在0-1点不开仓吗 = FALSE;
extern bool 让EA在1-2点不开仓吗 = FALSE;
extern bool 让EA在2-3点不开仓吗 = FALSE;
extern bool 让EA在3-4点不开仓吗 = FALSE;
extern bool 让EA在4-5点不开仓吗 = FALSE;
extern bool 让EA在5-6点不开仓吗 = FALSE;
extern bool 让EA在6-7点不开仓吗 = FALSE;
extern bool 让EA在7-8点不开仓吗 = FALSE;
extern bool 让EA在8-9点不开仓吗 = FALSE;
extern bool 让EA在9-10点不开仓吗 = FALSE;
extern bool 让EA在10-11点不开仓吗 = FALSE;
extern bool 让EA在11-12点不开仓吗 = FALSE;
extern bool 让EA在12-13点不开仓吗 = FALSE;
extern bool 让EA在13-14点不开仓吗 = FALSE;
extern bool 让EA在14-15点不开仓吗 = FALSE;
extern bool 让EA在15-16点不开仓吗 = FALSE;
extern bool 让EA在16-17点不开仓吗 = FALSE;
extern bool 让EA在17-18点不开仓吗 = FALSE;
extern bool 让EA在18-19点不开仓吗 = FALSE;
extern bool 让EA在19-20点不开仓吗 = FALSE;
extern bool 让EA在20-21点不开仓吗 = FALSE;
extern bool 让EA在21-22点不开仓吗 = FALSE;
extern bool 让EA在22-23点不开仓吗 = FALSE;
extern bool 让EA在23-24点不开仓吗 = FALSE;
extern string 功能隔离线5 = "* ------------------------------- *";
extern string 以下是设定日内时间段不让EA工作 = "*(二)以下设定日内时间段不让EA工作*";
extern string 设定时间段不让EA工作的用途 = "*适用于数据或消息发布时段*";
extern bool 是否限制时间段不让EA工作 = FALSE;
extern int MT4平台北京时间几点前运行 = 18;
extern int MT4平台北京时间几点后运行 = 22;
extern string 功能隔离线6 = "* ------------------------------- *";
extern string 以下设定两个日期之间不让EA工作 = "*(三)以下设定两日期之间不让EA工作*";
extern string 设定两日期之间不让EA工作的用途 = "*适用于上班、外出、旅游等无法盯盘时*";
extern bool 是否限制两个日期之间不让EA工作 = FALSE;
extern datetime 开始不让EA运行的MT4服务器日期 = D'02.11.2021';
extern datetime 结束不让EA运行的MT4服务器日期 = D'01.12.2021 02:00';
extern string 功能隔离线7 = "* ------------------------------- *";
extern string 以下是设定星期几不让EA工作 = "*(四)以下设定星期几不让EA工作*";
extern string 设定星期几不让EA工作的用途 = "*能够避免行情无规律的周一或周五*";
extern bool 是否限制星期几不让EA工作 = FALSE;
extern int 准备在星期几不让EA工作? = 6;
extern string 在星期几不让EA工作的填法说明 = "* 填 1 2 3 4 5 6 0 对应周一到周日 *";
double gd_676;
int gi_unused_684 = 0;
int gi_688 = 10;
int gi_692 = 1;
int gi_696 = 3;
int gi_700 = 0;
double gd_704 = 10.0;
double gd_712 = 10.0;
double gd_720 = 10.0;
double gd_728 = 9.715;
int gi_unused_736 = 2005;
int gi_unused_740 = 1;
int gi_unused_744 = 2050;
int gi_unused_748 = 12;
int gi_unused_752 = 22;
int gi_unused_756 = 30;
int gi_760 = 0;
int gi_764 = 12;
int gi_768 = 0;
int g_count_772 = 0;
int g_pos_776 = 0;
double g_price_780 = 0.0;
double g_price_788 = 0.0;
double g_ask_796 = 0.0;
double g_bid_804 = 0.0;
double gd_812 = 0.0;
double g_lots_820 = 0.0;
int g_cmd_828 = OP_BUY;
int gi_832 = 0;
bool gi_836 = TRUE;
double g_order_open_price_840 = 0.0;
int gi_848 = 0;
double gd_852 = 0.0;
int g_ticket_860 = 0;
int gi_864 = 0;
double g_price_868 = 0.0;
double g_order_lots_876 = 0.0;
double gd_unused_884 = 0.0;
double gd_892 = 0.0;
string gs_unused_900 = "";
string gs_908 = "";
double gd_916;
bool cg = false;

double f0_0() {
   gd_916 = NormalizeDouble(0.2 * AccountFreeMargin() / 100000.0, 2);
   if (gd_916 < 0.1) gd_916 = 起始手数 * 起始手数加倍;
   if (gd_916 > 100.0) gd_916 = 100;
   return (gd_916);
}

int init() {

   if (Digits == 3 || Digits == 5) {
      滑点 = 10 * 滑点;
      间隔点数 = 10 * 间隔点数;
      止赢 = 10.0 * 止赢;
      止损 = 10.0 * 止损;
      移动止损 = 10.0 * 移动止损;
      gi_688 = 10 * gi_688;
      距临界价格多少点数时不开新仓 = 10.0 * 距临界价格多少点数时不开新仓;
   }
   return (0);
}

int deinit() {
  Comment("www.125808047.com");
   return (0);
}

int start() {
       
         profit=0;
        for (int g_pos_196 = OrdersTotal(); g_pos_196 >= 0; g_pos_196--) 
       {
        cg = OrderSelect(g_pos_196, SELECT_BY_POS, MODE_TRADES);
        profit=OrderProfit()+profit;
       }

       if (profit<=-最大亏损全部平仓)
       {
        for (g_pos_196 = OrdersTotal(); g_pos_196 >= 0; g_pos_196--) 
       {
         cg =  OrderSelect(g_pos_196, SELECT_BY_POS, MODE_TRADES);
          cg = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 0, Red);
       }
       } 


   double icci_16;

   if (是否限制两个日期之间不让EA工作 == TRUE) {
      if (TimeCurrent() >= 开始不让EA运行的MT4服务器日期 && TimeCurrent() <= 结束不让EA运行的MT4服务器日期) {
         ObjectDelete("text_object");
         ObjectDelete("text_object1");
         ObjectDelete("text_object2");
         ObjectCreate("text_object3", OBJ_LABEL, 0, 0, 0);
         ObjectSet("text_object3", OBJPROP_XDISTANCE, 1);
         ObjectSet("text_object3", OBJPROP_YDISTANCE, 1);
         ObjectSetText("text_object3", "当前的MT4服务器时间是:" + TimeToStr(TimeCurrent(), TIME_DATE) + " " + TimeHour(TimeCurrent()) + ":" + TimeMinute(TimeCurrent()) + ",已设定为不让EA运行时段",
            10, "Verdana", Gold);
         return (0);
      }
   }
   if (是否限制星期几不让EA工作 == TRUE) {
      if (TimeDayOfWeek(TimeCurrent()) == 准备在星期几不让EA工作?) {
         ObjectDelete("text_object1");
         ObjectDelete("text_object2");
         ObjectDelete("text_object3");
         ObjectCreate("text_object", OBJ_LABEL, 0, 0, 0);
         ObjectSet("text_object", OBJPROP_XDISTANCE, 1);
         ObjectSet("text_object", OBJPROP_YDISTANCE, 1);
         ObjectSetText("text_object", "今天是星期" + 准备在星期几不让EA工作? + ",设定EA不工作", 10, "Verdana", Gold);
         return (0);
      }
   }
   if (是否限制时间段不让EA工作 == TRUE) {
      gd_676 = TimeHour(Time[0]) + MT4平台时间与北京时间的时差;
      if (gd_676 >= 24.0) gd_676 -= 24.0;
      if (gd_676 > MT4平台北京时间几点前运行 && gd_676 < MT4平台北京时间几点后运行) {
         ObjectDelete("text_object");
         ObjectDelete("text_object2");
         ObjectDelete("text_object3");
         ObjectCreate("text_object1", OBJ_LABEL, 0, 0, 0);
         ObjectSet("text_object1", OBJPROP_XDISTANCE, 1);
         ObjectSet("text_object1", OBJPROP_YDISTANCE, 1);
         if (TimeMinute(TimeCurrent()) < 10) {
            ObjectSetText("text_object1", "当前北京时间:" + TimeToStr(TimeCurrent(), TIME_DATE) + "日[" + TimeDayOfWeek(TimeCurrent()) + "] " + DoubleToStr(gd_676, 0) + ":0" +
               TimeMinute(TimeCurrent()) + "," + DoubleToStr(MT4平台北京时间几点前运行, 0) + "点后、" + DoubleToStr(MT4平台北京时间几点后运行, 0) + "点前EA暂停", 10, "Verdana",
               Gold);
         }
         if (TimeMinute(TimeCurrent()) < 10) return (0);
         ObjectSetText("text_object1", "当前北京时间:" + TimeToStr(TimeCurrent(), TIME_DATE) + "日[" + TimeDayOfWeek(TimeCurrent()) + "] " + DoubleToStr(gd_676, 0) + ":" +
            TimeMinute(TimeCurrent()) + "," + DoubleToStr(MT4平台北京时间几点前运行, 0) + "点后、" + DoubleToStr(MT4平台北京时间几点后运行, 0) + "点前EA暂停", 10, "Verdana",
            Gold);
         return (0);
      }
   }
   if (是否限制时间段不让EA工作 == TRUE) {
      if (gd_676 <= MT4平台北京时间几点前运行 || gd_676 >= MT4平台北京时间几点后运行) {
         ObjectDelete("text_object");
         ObjectDelete("text_object1");
         ObjectDelete("text_object3");
         ObjectCreate("text_object2", OBJ_LABEL, 0, 0, 0);
         ObjectSet("text_object2", OBJPROP_XDISTANCE, 1);
         ObjectSet("text_object2", OBJPROP_YDISTANCE, 1);
         if (TimeMinute(TimeCurrent()) < 10) {
            ObjectSetText("text_object2", "当前北京时间:" + TimeToStr(TimeCurrent(), TIME_DATE) + "日[" + TimeDayOfWeek(TimeCurrent()) + "] " + DoubleToStr(gd_676, 0) + ":0" +
               TimeMinute(TimeCurrent()) + "," + DoubleToStr(MT4平台北京时间几点前运行, 0) + "点前、" + DoubleToStr(MT4平台北京时间几点后运行, 0) + "点后EA运行", 10, "Verdana",
               Gold);
         }
         if (TimeMinute(TimeCurrent()) >= 10) {
            ObjectSetText("text_object2", "当前北京时间:" + TimeToStr(TimeCurrent(), TIME_DATE) + "日[" + TimeDayOfWeek(TimeCurrent()) + "] " + DoubleToStr(gd_676, 0) + ":" +
               TimeMinute(TimeCurrent()) + "," + DoubleToStr(MT4平台北京时间几点前运行, 0) + "点前、" + DoubleToStr(MT4平台北京时间几点后运行, 0) + "点后EA运行", 10, "Verdana",
               Gold);
         }
      }
   }
   if (K距临界价格一定点数时不开新仓 == TRUE && OrdersTotal() < 1 && MathAbs(Bid - 请输入你认为的临界高点价格) <= 距临界价格多少点数时不开新仓 * Point) {
      Alert(Symbol(), "【", Period(), "】  ", TimeToStr(TimeCurrent(), TIME_DATE), " ", TimeHour(TimeCurrent()), ":", TimeMinute(TimeCurrent()), "  K线现价=", Bid, ",距设定的临界高点价格 ",
         请输入你认为的临界高点价格, " 只有 ", MathAbs(Bid - 请输入你认为的临界高点价格) / Point, "点,当前处于限制开新仓的价格区域");
      return (0);
   }
   if (K距临界价格一定点数时不开新仓 == TRUE && OrdersTotal() < 1 && MathAbs(Bid - 请输入你认为的临界低点价格) <= 距临界价格多少点数时不开新仓 * Point) {
      Alert(Symbol(), "【", Period(), "】  ", TimeToStr(TimeCurrent(), TIME_DATE), " ", TimeHour(TimeCurrent()), ":", TimeMinute(TimeCurrent()), "  K线现价=", Bid, ",距设定的临界低点价格 ",
         请输入你认为的临界低点价格, " 只有 ", MathAbs(Bid - 请输入你认为的临界低点价格) / Point, "点,当前处于限制开新仓的价格区域");
      return (0);
   }
   if (TimeCurrent() <= D'01.12.2022 07:08') {
      icci_16 = iCCI(NULL, 0, CCI的时间周期, PRICE_TYPICAL, 0);
      if (gi_768 == 1) {
         if (gi_760 != 0) gd_812 = MathCeil(AccountBalance() * gi_764 / 100000.0);
         else gd_812 = f0_0();
      } else {
         if (gi_760 != 0) gd_812 = MathCeil(AccountBalance() * gi_764 / 100000.0) / 10.0;
         else gd_812 = f0_0();
      }
      if (gd_812 > 100.0) gd_812 = 100;
      g_count_772 = 0;
      for (g_pos_776 = 0; g_pos_776 < OrdersTotal(); g_pos_776++) {
         cg = OrderSelect(g_pos_776, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && (OrderMagicNumber() == FlashMoney多单标示码 || OrderMagicNumber() == FlashMoney空单标示码)) g_count_772++;
      }
      if (Symbol() == "EURUSD") gd_892 = gd_704;
      if (Symbol() == "GBPUSD") gd_892 = gd_712;
      if (Symbol() == "USDJPY") gd_892 = gd_728;
      if (Symbol() == "USDCHF") gd_892 = gd_720;
      if (gd_892 == 0.0) gd_892 = 5;
      if (gi_848 > g_count_772) {
         for (g_pos_776 = OrdersTotal(); g_pos_776 >= 0; g_pos_776--) {
            cg = OrderSelect(g_pos_776, SELECT_BY_POS, MODE_TRADES);
            g_cmd_828 = OrderType();
            if (OrderSymbol() == Symbol()) {
               if (g_cmd_828 == OP_BUY && OrderMagicNumber() == FlashMoney多单标示码) cg = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 滑点, Blue);
               if (!(g_cmd_828 == OP_SELL && OrderMagicNumber() == FlashMoney空单标示码)) return (0);
               cg = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 滑点, Red);
               return (0);
            }
         }
      }
      gi_848 = g_count_772;
      if (g_count_772 >= 最大持仓个数) gi_836 = FALSE;
      else gi_836 = TRUE;
      if (g_order_open_price_840 == 0.0) {
         for (g_pos_776 = 0; g_pos_776 < OrdersTotal(); g_pos_776++) {
            cg = OrderSelect(g_pos_776, SELECT_BY_POS, MODE_TRADES);
            g_cmd_828 = OrderType();
            if (OrderSymbol() == Symbol() && (OrderMagicNumber() == FlashMoney多单标示码 || OrderMagicNumber() == FlashMoney空单标示码)) {
               g_order_open_price_840 = OrderOpenPrice();
               if (g_cmd_828 == OP_BUY && OrderMagicNumber() == FlashMoney多单标示码) gi_832 = 2;
               if (g_cmd_828 == OP_SELL && OrderMagicNumber() == FlashMoney空单标示码) gi_832 = 1;
            }
         }
      }
      if (g_count_772 < 1) {
         gi_832 = 3;
         gd_676 = TimeHour(Time[0]) + MT4平台时间与北京时间的时差;
         if (gd_676 >= 24.0) gd_676 -= 24.0;
         if (让EA在0-1点不开仓吗 == TRUE && gd_676 == 0.0) return (0);
         if (让EA在1-2点不开仓吗 == TRUE && gd_676 == 1.0) return (0);
         if (让EA在2-3点不开仓吗 == TRUE && gd_676 == 2.0) return (0);
         if (让EA在3-4点不开仓吗 == TRUE && gd_676 == 3.0) return (0);
         if (让EA在4-5点不开仓吗 == TRUE && gd_676 == 4.0) return (0);
         if (让EA在5-6点不开仓吗 == TRUE && gd_676 == 5.0) return (0);
         if (让EA在6-7点不开仓吗 == TRUE && gd_676 == 6.0) return (0);
         if (让EA在7-8点不开仓吗 == TRUE && gd_676 == 7.0) return (0);
         if (让EA在8-9点不开仓吗 == TRUE && gd_676 == 8.0) return (0);
         if (让EA在9-10点不开仓吗 == TRUE && gd_676 == 9.0) return (0);
         if (让EA在10-11点不开仓吗 == TRUE && gd_676 == 10.0) return (0);
         if (让EA在11-12点不开仓吗 == TRUE && gd_676 == 11.0) return (0);
         if (让EA在12-13点不开仓吗 == TRUE && gd_676 == 12.0) return (0);
         if (让EA在13-14点不开仓吗 == TRUE && gd_676 == 13.0) return (0);
         if (让EA在14-15点不开仓吗 == TRUE && gd_676 == 14.0) return (0);
         if (让EA在15-16点不开仓吗 == TRUE && gd_676 == 15.0) return (0);
         if (让EA在16-17点不开仓吗 == TRUE && gd_676 == 16.0) return (0);
         if (让EA在17-18点不开仓吗 == TRUE && gd_676 == 17.0) return (0);
         if (让EA在18-19点不开仓吗 == TRUE && gd_676 == 18.0) return (0);
         if (让EA在19-20点不开仓吗 == TRUE && gd_676 == 19.0) return (0);
         if (让EA在20-21点不开仓吗 == TRUE && gd_676 == 20.0) return (0);
         if (让EA在21-22点不开仓吗 == TRUE && gd_676 == 21.0) return (0);
         if (让EA在22-23点不开仓吗 == TRUE && gd_676 == 22.0) return (0);
         if (让EA在23-24点不开仓吗 == TRUE && gd_676 == 23.0) return (0);
         if (用CCI控制开仓方向 == FALSE && 手动控制开仓方向 == FALSE && iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) > iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN,
            1)) gi_832 = 2;
         if (用CCI控制开仓方向 == FALSE && 手动控制开仓方向 == FALSE && iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) < iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN,
            1)) gi_832 = 1;
         if (用CCI控制开仓方向 == FALSE && 手动控制开仓方向 == TRUE && 手动控制开仓做多 == TRUE) gi_832 = 2;
         if (用CCI控制开仓方向 == FALSE && 手动控制开仓方向 == TRUE && 手动控制开仓做多 == FALSE) gi_832 = 1;
         if (用CCI控制开仓方向 == TRUE && icci_16 > 10.0 && icci_16 <= CCI在本水平位以上时首仓只做空 && iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) > iMACD(NULL,
            0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 1)) gi_832 = 2;
         if (用CCI控制开仓方向 == TRUE && icci_16 > 10.0 && icci_16 <= CCI在本水平位以上时首仓只做空 && iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) < iMACD(NULL,
            0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 1)) gi_832 = 1;
         if (用CCI控制开仓方向 == TRUE && icci_16 < -10.0 && icci_16 >= CCI在本水平位以下时首仓只做多 && iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) < iMACD(NULL,
            0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 1)) gi_832 = 1;
         if (用CCI控制开仓方向 == TRUE && icci_16 < -10.0 && icci_16 >= CCI在本水平位以下时首仓只做多 && iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) > iMACD(NULL,
            0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 1)) gi_832 = 1;
         if (用CCI控制开仓方向 == TRUE && icci_16 >= CCI在本水平位以上时首仓只做空) gi_832 = 1;
         if (用CCI控制开仓方向 == TRUE && icci_16 <= CCI在本水平位以下时首仓只做多) gi_832 = 2;
         if (用CCI控制开仓方向 == TRUE && icci_16 > -10.0 && icci_16 < 10.0 && iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) > iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE,
            MODE_MAIN, 1)) gi_832 = 2;
         if (用CCI控制开仓方向 == TRUE && icci_16 > -10.0 && icci_16 < 10.0 && iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) < iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE,
            MODE_MAIN, 1)) gi_832 = 1;
         if (gi_700 == 1) {
            if (gi_832 == 1) gi_832 = 2;
            else
               if (gi_832 == 2) gi_832 = 1;
         }
      }
      for (g_pos_776 = OrdersTotal(); g_pos_776 >= 0; g_pos_776--) {
         cg = OrderSelect(g_pos_776, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol()) {
            if (OrderType() == OP_SELL && OrderMagicNumber() == FlashMoney空单标示码) {
               if (移动止损 > 0.0) {
                  if (OrderOpenPrice() - Ask >= (移动止损 + 间隔点数) * Point) {
                     if (OrderStopLoss() > Ask + Point * 移动止损) {
                        cg = OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * 移动止损, OrderClosePrice() - 止赢 * Point - 移动止损 * Point, 800, Purple);
                        return (0);
                     }
                  }
               }
            }
            if (OrderType() == OP_BUY && OrderMagicNumber() == FlashMoney多单标示码) {
               if (移动止损 > 0.0) {
                  if (Bid - OrderOpenPrice() >= (移动止损 + 间隔点数) * Point) {
                     if (OrderStopLoss() < Bid - Point * 移动止损) {
                        cg = OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * 移动止损, OrderClosePrice() + 止赢 * Point + 移动止损 * Point, 800, Yellow);
                        return (0);
                     }
                  }
               }
            }
         }
      }
      gd_852 = 0;
      g_ticket_860 = 0;
      gi_864 = FALSE;
      g_price_868 = 0;
      g_order_lots_876 = 0;
      for (g_pos_776 = 0; g_pos_776 < OrdersTotal(); g_pos_776++) {
         cg = OrderSelect(g_pos_776, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol()) {
            g_ticket_860 = OrderTicket();
            if (OrderType() == OP_BUY && OrderMagicNumber() == FlashMoney多单标示码) gi_864 = FALSE;
            if (OrderType() == OP_SELL && OrderMagicNumber() == FlashMoney空单标示码) gi_864 = TRUE;
            g_price_868 = OrderClosePrice();
            g_order_lots_876 = OrderLots();
            if (gi_864 == FALSE) {
               if (OrderClosePrice() < OrderOpenPrice()) gd_852 -= (OrderOpenPrice() - OrderClosePrice()) * OrderLots() / Point;
               if (OrderClosePrice() > OrderOpenPrice()) gd_852 += (OrderClosePrice() - OrderOpenPrice()) * OrderLots() / Point;
            }
            if (gi_864 == TRUE) {
               if (OrderClosePrice() > OrderOpenPrice()) gd_852 -= (OrderClosePrice() - OrderOpenPrice()) * OrderLots() / Point;
               if (OrderClosePrice() < OrderOpenPrice()) gd_852 += (OrderOpenPrice() - OrderClosePrice()) * OrderLots() / Point;
            }
         }
      }
      gd_852 *= gd_892;
      gs_908 = "Profit: $" + DoubleToStr(gd_852, 2) + " +/-";
      if (g_count_772 >= 最大持仓个数 - gi_696 && gi_692 == 1 && (OrderMagicNumber() == FlashMoney多单标示码 || OrderMagicNumber() == FlashMoney空单标示码)) {
         if (gd_852 >= gi_688) {
            cg = OrderClose(g_ticket_860, g_order_lots_876, g_price_868, 滑点, Yellow);
            gi_836 = FALSE;
            return (0);
         }
      }
      if (!IsTesting()) {
         if (gi_832 == 3) gs_unused_900 = "No conditions to open trades";
         else gs_unused_900 = "                         ";
      }
      if (gi_832 == 1 && gi_836) {
         if (Bid - g_order_open_price_840 >= 间隔点数 * Point || g_count_772 < 1) {
            g_bid_804 = Bid;
            g_order_open_price_840 = 0;
            if (止赢 == 0.0) g_price_788 = 0;
            else g_price_788 = g_bid_804 - 止赢 * Point;
            if (止损 == 0.0) g_price_780 = 0;
            else g_price_780 = g_bid_804 + 止损 * Point;
            if (g_count_772 != 0) {
               g_lots_820 = gd_812;
               for (g_pos_776 = 1; g_pos_776 <= g_count_772; g_pos_776++) {
                  if (最大持仓个数 > 12) g_lots_820 = NormalizeDouble(1.5 * g_lots_820, 2);
                  else g_lots_820 = NormalizeDouble(2.0 * g_lots_820, 2);
               }
            } else g_lots_820 = gd_812;
            if (g_lots_820 > 100.0) g_lots_820 = 100;
            cg = OrderSend(Symbol(), OP_SELL, g_lots_820, g_bid_804, 滑点, g_price_780, g_price_788, 0, FlashMoney空单标示码, 0, Red);
            return (0);
         }
      }
      if (gi_832 == 2 && gi_836) {
         if (g_order_open_price_840 - Ask >= 间隔点数 * Point || g_count_772 < 1) {
            g_ask_796 = Ask;
            g_order_open_price_840 = 0;
            if (止赢 == 0.0) g_price_788 = 0;
            else g_price_788 = g_ask_796 + 止赢 * Point;
            if (止损 == 0.0) g_price_780 = 0;
            else g_price_780 = g_ask_796 - 止损 * Point;
            if (g_count_772 != 0) {
               g_lots_820 = gd_812;
               for (g_pos_776 = 1; g_pos_776 <= g_count_772; g_pos_776++) {
                  if (最大持仓个数 > 12) g_lots_820 = NormalizeDouble(1.5 * g_lots_820, 2);
                  else g_lots_820 = NormalizeDouble(2.0 * g_lots_820, 2);
               }
            } else g_lots_820 = gd_812;
            if (g_lots_820 > 100.0) g_lots_820 = 100;
            cg = OrderSend(Symbol(), OP_BUY, g_lots_820, g_ask_796, 滑点, g_price_780, g_price_788, 0, FlashMoney多单标示码, 0, Blue);
            return (0);
         }
      }
   }  
   return (0);
}

如您喜欢此文章请点下面分享按钮↴峰汇在线 » FlashMoney888 EA
上一篇:
下一篇:
分享到:更多 ()