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

ForexGoldenGooseULTIMATE_D_Full EA



ForexGoldenGooseULTIMATE_D_Full EA根据盈亏增减开仓手数。风险与利润并存。一般平台限制单个订单最大手数50标准手。我在整理的时候加了个仓数extern double     MaxLots     =   50;如果不加超过50手的话会报错。如果跑单量,也可以将最大开仓手数限制在某个合理的水平。

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

//+------------------------------------------------------------------+
//|                              ForexGoldenGooseULTIMATE_D_Full.mq4 |
//|                                              ForexCashTools @2008|
//+------------------------------------------------------------------+

#property copyright     "ForexCashTools @2008"
#property link          "www.ForexCashTools.com"
extern string           __ForexGoldenGooseFX__  = "<<< @2008 Jarvis McCrary >>>";
extern string           UNLOCKCODE              = "UNFLOCKED";
extern int              MAGICTerminal           =         101;
extern double           StopLoss                =        32.0;
extern bool             RISKY_Trader            =        TRUE;
extern bool             BUYCurrency             =        TRUE;
extern bool             SELLCurrency            =        TRUE;
extern double           NEWORDER_Trigger        =        10.0;
extern double           Minimum_StandardDev     =        23.0;
extern double           Desired_LOTSIZE_Invest  =         0.0;
extern double           Desired_PERCENT_Invest  =         0.1;
extern double           MaxLots                 =          50;
extern string           FXCOMMAND               =          "";
double gd_160;          double gd_168;          double gd_176;          double gd_192;
double gd_200;          double gd_528;          double gd_672;          double gd_744;
double gd_456;          double gd_792;          double gd_800;          double gd_808;
double gd_816;          double gd_856;          double gd_864;          double gd_944;
double gd_952;          double gd_960;          double gd_968;          double gd_240;
double gd_256;          double gd_272;          double gd_384;          double g_ima_496;
double g_ima_536;       double g_ima_544;       double g_ima_632;       double g_ima_720;
double g_ima_784;       double g_bid_352;       double g_bid_360;       double g_bid_368;
double g_bid_184;       double g_bid_232;       double g_lots_440;      double g_lots_448;
double g_lots_896;      double g_lots_904;      double g_price_488;     double g_price_216;
double g_price_224;     double g_minlot_1156;   double g_lotsize_248;   double g_ord_open_344;
double gd_208  =   0.0; double gd_520  =  0.0;  double gd_848  =  0.0;  double gd_880    =    0.0;
double gd_888  =   0.0; double gd_1096 =  0.0;  double gd_1032 =  0.0;  double gd_1132   =    0.0;
double gd_984  =  40.0; double gd_992  = 20.0;  double gd_1008 = 90.0;  double gd_1024   =   32.0;
double gd_1000 = 100.0; double gd_1048 = 20.0;  double gd_1056 =  5.0;  double g_bid_376 = 1000.0;
int    gi_used_156;     int    gi_976  =  3;    int    gi_1140 = 20;    int    gi_1144   =   52;       int    Ind_TF = PERIOD_H1;
string g_comment_392;   string gs_920;          string gs_928;          string gs_936;
bool MiniAcct;          bool StopTrade = FALSE; bool gi_980  = TRUE;    bool gi_1016 = FALSE;
bool gi_1020 = FALSE;   bool gi_1040   = FALSE; bool gi_1044 = FALSE;

void deinit() {
  Comment("www.125808047.com");
}

int start() {
   int l_ticket_4;
   gd_160 = 1;
   if (gi_1040 == TRUE) gd_160 = 10;
   g_lotsize_248 = MarketInfo(Symbol(), MODE_LOTSIZE);
   g_minlot_1156 = MarketInfo(Symbol(), MODE_MINLOT);
   MiniAcct = FALSE;
   if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.01) MiniAcct = TRUE;
   gd_256 = AccountLeverage();
   gd_672 = 10000.0 * iATR(0, Ind_TF, 14, 0);
   gd_944 = Desired_LOTSIZE_Invest;
   gd_952 = Desired_PERCENT_Invest;
   gd_960 = Desired_LOTSIZE_Invest;
   gd_968 = Desired_PERCENT_Invest;
   gd_456 = 10000.0 * iStdDev(0, Ind_TF, 20, 0, MODE_SMA, PRICE_CLOSE, 0);
   if (gd_456 < Minimum_StandardDev) {      gd_880 = 1;      gd_888 = 1;   }
   g_ima_536 = iMA(0, Ind_TF, 5, 0, MODE_EMA, PRICE_CLOSE, 0);
   g_ima_720 = iMA(0, Ind_TF, 5, 0, MODE_EMA, PRICE_CLOSE, 1);
   gd_744 = (g_ima_536 - g_ima_720) / Point;
   g_ima_632 = iMA(0, Ind_TF, 10, 0, MODE_EMA, PRICE_CLOSE, 0);
   g_ima_784 = iMA(0, Ind_TF, 10, 0, MODE_EMA, PRICE_CLOSE, 1);
   gd_792 = (g_ima_632 - g_ima_784) / Point;
   g_ima_544 = iMA(0, Ind_TF, 20, 0, MODE_EMA, PRICE_CLOSE, 0);
   gd_800 = (g_ima_536 - g_ima_632) / Point;
   g_lots_440 = 0.01;
   g_bid_232 = 1;
   if (gi_1044 == TRUE) g_bid_232 = Bid;
   gd_240 = AccountCredit() + AccountBalance();
   if (gd_952 != 0.0 && gd_944 == 0.0 && gd_952 > 0.0 && gd_952 <= 0.99) gd_240 = (AccountCredit() + AccountBalance()) * gd_952;
   while (g_lots_440 < gd_240 / (g_lotsize_248 * g_bid_232 / gd_256)) g_lots_440 += 0.01;
   if (gd_944 != 0.0) g_lots_440 = gd_944;
   if (MiniAcct == FALSE) g_lots_440 = NormalizeDouble(MathRound(10.0 * g_lots_440) / 10.0, 2);
   else g_lots_440 = NormalizeDouble(MathRound(100.0 * g_lots_440) / 100.0, 2);
   if (g_lots_440 < 0.01) {
      if (g_lots_440 < 0.1 && MiniAcct == FALSE) g_lots_440 = 0.1;
      if (g_lots_440 < 0.01 && MiniAcct == TRUE) g_lots_440 = 0.01;
   }
    if (g_lots_440 >= MaxLots) g_lots_440 = MaxLots;
   if (g_lots_440 < g_minlot_1156) g_lots_440 = g_minlot_1156;
   g_lots_448 = 0.01;
   g_bid_232 = 1;
   if (gi_1044 == TRUE) g_bid_232 = Bid;
   gd_240 = AccountCredit() + AccountBalance();
   if (gd_968 != 0.0 && gd_960 == 0.0 && gd_968 > 0.0 && gd_968 <= 0.99) gd_240 = (AccountCredit() + AccountBalance()) * gd_968;
   while (g_lots_448 < gd_240 / (g_lotsize_248 * g_bid_232 / gd_256)) g_lots_448 += 0.01;
   if (gd_960 != 0.0) g_lots_448 = gd_960;
   if (MiniAcct == FALSE) g_lots_448 = NormalizeDouble(MathRound(10.0 * g_lots_448) / 10.0, 2);
   else g_lots_448 = NormalizeDouble(MathRound(100.0 * g_lots_448) / 100.0, 2);
   if (g_lots_448 < 0.01) {
      if (g_lots_448 < 0.1 && MiniAcct == FALSE) g_lots_448 = 0.1;
      if (g_lots_448 < 0.01 && MiniAcct == TRUE) g_lots_448 = 0.01;
   }
   if (g_lots_448 >= MaxLots) g_lots_448 = MaxLots;
   if (g_lots_448 < g_minlot_1156) g_lots_448 = g_minlot_1156;
   g_lots_896 = g_lots_440 / 2.0;
   g_lots_904 = g_lots_448 / 2.0;
   if (MiniAcct == FALSE) g_lots_896 = NormalizeDouble(MathRound(10.0 * g_lots_896) / 10.0, 2);
   else g_lots_896 = NormalizeDouble(MathRound(100.0 * g_lots_896) / 100.0, 2);
   if (MiniAcct == FALSE) g_lots_904 = NormalizeDouble(MathRound(10.0 * g_lots_904) / 10.0, 2);
   else g_lots_904 = NormalizeDouble(MathRound(100.0 * g_lots_904) / 100.0, 2);
   if (g_lots_904 >= MaxLots) g_lots_904 = MaxLots;
   
   StopTrade = FALSE; 
   if ((gd_944 != 0.0 && gd_952 != 0.0) || 
       (gd_944 == 0.0 && gd_952 == 0.0))   { Comment("Please Choose LOTSIZE or PERCENT Wager NOT BOTH!! - Edit Inputs and RESTART");      StopTrade = TRUE;}
   if  (gd_952 >= 1.0)                     { Comment("Please Choose PERCENT between 0.01 (1%) and 0.99 (99%) - Edit Inputs and RESTART"); StopTrade = TRUE;}
   if ((gd_960 != 0.0 && gd_968 != 0.0) || 
       (gd_960 == 0.0 && gd_968 == 0.0))   { Comment("Please Choose LOTSIZE or PERCENT Wager NOT BOTH!! - Edit Inputs and RESTART");      StopTrade = TRUE;}
   if  (gd_968 >= 1.0)                     { Comment("Please Choose PERCENT between 0.01 (1%) and 0.99 (99%) - Edit Inputs and RESTART"); StopTrade = TRUE;}
   
   
   int l_count_12 = 0;
   for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
      gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
      if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) l_count_12++;
      if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) l_count_12++;
      if (OrderType() == OP_BUYLIMIT && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) l_count_12++;
      if (OrderType() == OP_SELLLIMIT && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) l_count_12++;
      if (OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol() && OrderType() == OP_BUY) {
         gd_1024 = MathAbs((OrderOpenPrice() - g_ima_632) / Point);
         if (gd_1024 > StopLoss) gd_1024 = StopLoss;
      }
      if (OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol() && OrderType() == OP_SELL) {
         gd_1024 = MathAbs((g_ima_632 - OrderOpenPrice()) / Point);
         if (gd_1024 > StopLoss) gd_1024 = StopLoss;
      }
   }
   gd_856 = 0;
   gd_864 = 0;
   gd_816 = 0;
   l_pos_0 = OrdersHistoryTotal();
   if (l_pos_0 > 0 && gd_848 != 0.0) {
      for (int l_pos_32 = 0; l_pos_32 < l_pos_0; l_pos_32++) {
         gi_used_156 = OrderSelect(l_pos_32, SELECT_BY_POS, MODE_HISTORY);
         if (OrderMagicNumber() != MAGICTerminal || OrderSymbol() != Symbol()) continue;
         if (OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol() && OrderCloseTime() > gd_816) {
            gd_816 = OrderCloseTime();
            gd_864 = 0;
            gd_856 = 0;
            if (OrderType() == OP_SELL) {
               gd_856 = 1;
               gd_864 = 0;
            }
            if (OrderType() == OP_BUY) {
               gd_864 = 1;
               gd_856 = 0;}}}}
               
   if (l_pos_0 > 0 && gd_848 != 0.0)
    { if (gd_856 == 1.0) gd_880 = 1;
      if (gd_864 == 1.0) gd_888 = 1;}
   if (FXCOMMAND == "tradeok" || RISKY_Trader == TRUE)
    { gd_880 = 1;
      gd_888 = 1;}
   if (FXCOMMAND == "buyok") gd_880 = 1;
   if (FXCOMMAND == "sellok") gd_888 = 1;
   gs_920 = "";
   gs_928 = "WAITING FOR StdDev<" + DoubleToStr(Minimum_StandardDev, 0);
   gs_936 = gs_928;
   if (gd_880 == 1.0) gs_928 = "READY";
   if (gd_888 == 1.0) gs_936 = "READY";
   if ((l_count_12 < 1 && gd_272 == 0.0) || (gd_272 != 0.0 && TimeCurrent() > gd_272 + Ind_TF * gi_1140)) {
      gd_272 = iTime(Symbol(), Ind_TF, 0);
      gd_272 += 60 * Ind_TF;
   }
   if ((StopTrade == FALSE && l_count_12 < 1 && TimeCurrent() > gd_520 && TimeCurrent() >= gd_272) || (StopTrade == FALSE && l_count_12 < 1 && (FXCOMMAND == "buynow" || FXCOMMAND == "sellnow"))) {
      gd_200 = 0;
      gd_208 = 0;
      gd_528 = gd_272 + Ind_TF * gi_1144;
      gd_808 = gd_272 + 299.0;
      if ((gd_880 == 1.0 && BUYCurrency == TRUE && g_ima_536 > g_ima_632 && gd_744 >= NEWORDER_Trigger && gd_456 > Minimum_StandardDev) || FXCOMMAND == "buynow") {
         g_comment_392 = "GooseXBUY";
         g_bid_360 = 0;
         gd_880 = 0;
         l_ticket_4 = OrderSend(Symbol(), OP_BUY, g_lots_440, Ask, gi_976 * gd_160, 0, 0, g_comment_392, MAGICTerminal, 0, Fuchsia);
         gd_848 = 1;
         if (l_ticket_4 > 0) gd_520 = TimeCurrent() + 60.0 * gd_1048;
      }
      if ((gd_888 == 1.0 && SELLCurrency == TRUE && g_ima_536 < g_ima_632 && gd_744 <= (-NEWORDER_Trigger) && gd_456 > Minimum_StandardDev) || FXCOMMAND == "sellnow") {
         g_comment_392 = "GooseXSELL";
         g_bid_376 = 1000;
         gd_888 = 0;
         l_ticket_4 = OrderSend(Symbol(), OP_SELL, g_lots_448, Bid, gi_976 * gd_160, 0, 0, g_comment_392, MAGICTerminal, 0, Lime);
         gd_848 = 1;
         if (l_ticket_4 > 0) gd_520 = TimeCurrent() + 60.0 * gd_1048;
      }
   }
   if (gi_1020 == FALSE && StopTrade == FALSE && l_count_12 == 1 && StopLoss != 0.0) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderStopLoss() == 0.0 && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol())
            if (StopLoss != 0.0) gi_used_156 = OrderModify(l_ticket_4, 0, OrderOpenPrice() - StopLoss * gd_160 * Point, 0, 0, Gold);
         if (OrderType() == OP_SELL && OrderStopLoss() == 0.0 && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol())
            if (StopLoss != 0.0) gi_used_156 = OrderModify(l_ticket_4, 0, OrderOpenPrice() + StopLoss * gd_160 * Point, 0, 0, Gold);
      }
   }
   if (StopTrade == FALSE && l_count_12 > 0) {
      gd_168 = 0;
      gd_176 = 0;
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            if (OrderType() == OP_BUY) {
               gd_200 = (Bid - OrderOpenPrice()) / Point;
               gd_168 = 1;
               gd_192 = Bid - OrderOpenPrice();
               gs_928 = "ACTIVE BUY";
               gd_848 = 1;
               g_ord_open_344 = OrderOpenPrice();
               g_price_216 = g_ord_open_344;
               g_price_224 = g_ord_open_344;
               g_price_216 += gd_992 * gd_160 * Point;
               g_price_224 += gd_1008 * gd_160 * Point;
               g_bid_352 = Bid;
               if (g_bid_352 > g_bid_360) g_bid_360 = g_bid_352;
               gd_384 = (Bid - g_bid_360) / Point;
               if (gd_200 > gd_208) gd_208 = gd_200;
            }
            if (OrderType() == OP_SELL) {
               gd_200 = (OrderOpenPrice() - Ask) / Point;
               gd_176 = 1;
               gd_192 = OrderOpenPrice() - Ask;
               gs_936 = "ACTIVE SELL";
               gd_848 = 1;
               g_ord_open_344 = OrderOpenPrice();
               g_price_216 = g_ord_open_344;
               g_price_224 = g_ord_open_344;
               g_price_216 -= gd_992 * gd_160 * Point;
               g_price_224 -= gd_1008 * gd_160 * Point;
               g_bid_368 = Bid;
               if (g_bid_368 < g_bid_376) g_bid_376 = g_bid_368;
               gd_384 = (g_bid_376 - Bid) / Point;
               if (gd_200 > gd_208) gd_208 = gd_200;
            }
         }
      }
      if (gd_168 == 1.0 && g_lots_896 < g_minlot_1156) gs_928 = "BUYOrder TOO SMALL TO SELL HALF";
      if (gd_176 == 1.0 && g_lots_904 < g_minlot_1156) gs_936 = "SELLOrder TOO SMALL TO SELL HALF";
   }
   if ((StopTrade == FALSE && gd_168 == 1.0 && l_count_12 > 0 && g_ima_536 != 0.0 && g_ima_632 != 0.0 && g_ima_544 != 0.0 && g_ima_536 < g_ima_632) || (RISKY_Trader == TRUE &&
      gd_200 > 0.0 && Bid <= g_ima_632) || (RISKY_Trader == FALSE && Bid <= g_ima_632)) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_BID);
            g_bid_360 = 0;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, LightSlateGray);
            gd_520 = TimeCurrent() + 60.0 * gd_1056;
         }
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_376 = 1000;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, LightSlateGray);
            gd_520 = TimeCurrent() + 60.0 * gd_1056;
         }
      }
   }
   if ((StopTrade == FALSE && gd_176 == 1.0 && l_count_12 > 0 && g_ima_536 != 0.0 && g_ima_632 != 0.0 && g_ima_544 != 0.0 && g_ima_536 > g_ima_632) || (RISKY_Trader == TRUE &&
      gd_200 > 0.0 && Bid >= g_ima_632) || (RISKY_Trader == FALSE && Bid >= g_ima_632)) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_BID);
            g_bid_360 = 0;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, LightSlateGray);
            gd_520 = TimeCurrent() + 60.0 * gd_1056;
         }
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_376 = 1000;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, LightSlateGray);
            gd_520 = TimeCurrent() + 60.0 * gd_1056;
         }
      }
   }
   if (gi_1016 == TRUE && StopTrade == FALSE && l_count_12 > 0 && gd_200 * gd_160 <= gd_1008 * gd_160 && gd_208 * gd_160 >= gd_1000 * gd_160) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_BID);
            g_bid_360 = 0;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, DodgerBlue);
         }
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_376 = 1000;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, DodgerBlue);
         }
      }
   }
   if (gi_1020 == TRUE && StopTrade == FALSE && l_count_12 > 0 && gd_200 * gd_160 <= (-StopLoss) * gd_160) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_BID);
            g_bid_360 = 0;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, Gold);
         }
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_376 = 1000;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, Gold);
         }
      }
   }
   if (StopTrade == FALSE && l_count_12 > 0 && gd_200 * gd_160 > 0.0 && gd_456 < Minimum_StandardDev) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_BID);
            g_bid_360 = 0;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, LightSlateGray);
            gd_520 = TimeCurrent() + 60.0 * gd_1056;
         }
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_376 = 1000;
            gi_used_156 = OrderClose(l_ticket_4, OrderLots(), g_bid_184, gi_976 * gd_160, LightSlateGray);
            gd_520 = TimeCurrent() + 60.0 * gd_1056;
         }
      }
   }
   if (StopTrade == FALSE && gi_980 == FALSE && l_count_12 > 0 && gd_984 != 0.0 && gd_200 * gd_160 >= gd_984 * gd_160) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol())
            if ((Bid >= g_price_216 && OrderStopLoss() < g_price_216) || OrderStopLoss() == 0.0) gi_used_156 = OrderModify(OrderTicket(), 0, g_price_216, OrderTakeProfit(), 0, CLR_NONE);
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol())
            if ((Bid <= g_price_216 && OrderStopLoss() > g_price_216) || OrderStopLoss() == 0.0) gi_used_156 = OrderModify(OrderTicket(), 0, g_price_216, OrderTakeProfit(), 0, CLR_NONE);
      }
   }
   if (gi_1016 == FALSE && StopTrade == FALSE && l_count_12 > 0 && gd_1000 != 0.0 && gd_200 * gd_160 >= gd_1000 * gd_160) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol())
            if ((Bid >= g_price_224 && OrderStopLoss() < g_price_224) || OrderStopLoss() == 0.0) gi_used_156 = OrderModify(OrderTicket(), 0, g_price_224, OrderTakeProfit(), 0, Gold);
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol())
            if ((Bid <= g_price_224 && OrderStopLoss() > g_price_224) || OrderStopLoss() == 0.0) gi_used_156 = OrderModify(OrderTicket(), 0, g_price_224, OrderTakeProfit(), 0, Gold);
      }
   }
   if (StopTrade == FALSE && l_count_12 > 0 && gd_200 * gd_160 >= gd_1096 * gd_160 && gd_1096 != 0.0) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            gd_192 = Bid - OrderOpenPrice();
            gd_200 = (Bid - OrderOpenPrice()) / Point;
            if (Bid > g_price_488 || g_price_488 == 0.0) g_price_488 = Bid;
            if (gd_200 >= gd_208) {
               gd_208 = gd_200;
               g_ima_496 = g_ima_632;
               if (OrderStopLoss() != 0.0) gi_used_156 = OrderModify(OrderTicket(), 0, g_ima_496, OrderTakeProfit(), 0, CLR_NONE);
               Sleep(1000.0 * gd_1132);
            }
         }
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            gd_192 = OrderOpenPrice() - Ask;
            gd_200 = (OrderOpenPrice() - Ask) / Point;
            if (Ask < g_price_488 || g_price_488 == 0.0) g_price_488 = Ask;
            if (gd_200 >= gd_208) {
               gd_208 = gd_200;
               g_ima_496 = g_ima_632;
               if (OrderStopLoss() != 0.0) gi_used_156 = OrderModify(OrderTicket(), 0, g_ima_496, OrderTakeProfit(), 0, CLR_NONE);
               Sleep(1000.0 * gd_1132);
            }
         }
      }
   }
   if (StopTrade == FALSE && gi_980 == TRUE && l_count_12 > 0 && gd_984 != 0.0 && gd_200 * gd_160 >= gd_1024 * gd_160) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol() && OrderComment() == "GooseXBUY" && g_lots_896 > g_minlot_1156) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_BID);
            g_bid_360 = 0;
            if (gd_1024 == StopLoss) gi_used_156 = OrderClose(l_ticket_4, g_lots_896, g_bid_184, gi_976 * gd_160, Red);
            if (gd_1024 != StopLoss) gi_used_156 = OrderClose(l_ticket_4, g_lots_896, g_bid_184, gi_976 * gd_160, DarkViolet);
         }
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol() && OrderComment() == "GooseXSELL" && g_lots_904 > g_minlot_1156) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_376 = 1000;
            if (gd_1024 == StopLoss) gi_used_156 = OrderClose(l_ticket_4, g_lots_904, g_bid_184, gi_976 * gd_160, Red);
            if (gd_1024 != StopLoss) gi_used_156 = OrderClose(l_ticket_4, g_lots_904, g_bid_184, gi_976 * gd_160, DarkViolet);
         }
      }
   }
   if (StopTrade == FALSE && l_count_12 == 1 && gd_1032 != 0.0 && gd_200 * gd_160 <= (-gd_1032) * gd_160) {
      for (l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
         gi_used_156 = OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
         l_ticket_4 = OrderTicket();
         if (OrderType() == OP_BUY && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_BID);
            g_bid_360 = 0;
            l_ticket_4 = OrderSend(Symbol(), OP_SELL, g_lots_904, Bid, gi_976 * gd_160, OrderOpenPrice(), OrderStopLoss(), "HEDGE", MAGICTerminal, 0, Aqua);
         }
         if (OrderType() == OP_SELL && OrderMagicNumber() == MAGICTerminal && OrderSymbol() == Symbol()) {
            g_bid_184 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_376 = 1000;
            l_ticket_4 = OrderSend(Symbol(), OP_BUY, g_lots_896, Ask, gi_976 * gd_160, OrderOpenPrice(), OrderStopLoss(), "HEDGE", MAGICTerminal, 0, Aqua);
         }
      }
   }
   gs_920 = "BUYMode: " + gs_928 + " - SELLMode: " + gs_936;
   if (StopTrade == FALSE && (FXCOMMAND == "firsttrade" || FXCOMMAND == "tradeok")) gd_848 = 1;
   if (StopTrade == FALSE && (FXCOMMAND != "showfxdata" && FXCOMMAND != "jmxpro"))
    Comment("----------------------------------------------------------------------\nForexGoldenGoose-SUPERTrend - ?ForexCashTools.com v8.11a\nPIPProfits [",
    gd_192, "] [", gd_200, "] - PIPXHigh Profits:[", gd_208, "] - StdDev: [", gd_456, "]\nStatus: ", gs_920);
   if (StopTrade == FALSE && (FXCOMMAND == "showfxdata" || FXCOMMAND == "jmxpro")) {
    Comment("----------------------------------------------------------------------\nForexGoldenGoose-SUPERTrend - ?ForexCashTools.com v8.11a\nPIPProfits [",
    gd_192, "] [", gd_200, "] - PIPXHigh Profits:[", gd_208, "]\nMAE5: ", g_ima_536, " - MAE5x: ", g_ima_720, " - MAE5Gap: ", gd_744, " - [", MathAbs(gd_744),
    "]\nMAE10: ", g_ima_632, " - MAE10x: ", g_ima_784, " - MAE10Gap: ", gd_792, " - [", MathAbs(gd_792), "]\nStdDev: ", gd_456, " - ATR: ", gd_672,
    " - TimeCurrent: ", TimeCurrent(), " - BarTime: ", gd_272, "\nMAE510Gap: ", gd_800, " [", MathAbs(gd_800), "] [", MarketInfo(Symbol(), MODE_MINLOT),
    "] [", MarketInfo(Symbol(), MODE_LOTSTEP), "] {", gd_848, "}\nStatus: ", gs_920);}
   return (0);}

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