比特币通信协议 - 币圈消息

比特币通信协议篇11、二、TURN简介。在典型的情况下,TURN客户端连接到内网中,并且通过一个或者多个NAT到 详细

这些变量代表的是什么意思?

  [复制链接]
270 6
cxrwq 发表于 2018-1-11 00:53:28 | 只看该作者 |阅读模式 打印 上一主题 下一主题
MagicNumber = 1;
Lots_1 = 0.01;
Lots_2 = 0.01;
KoeffLots = 2.0;
LossInValute = 3.0;
ProfitInValute = 3.0;
fitInValute = 2.0;
Slippage = 3;
这些变量是什么意思???
收藏
收藏0
转播
转播
分享
分享
分享
淘帖0

精彩评论6

跳转到指定楼层
沙发
admin 发表于 2018-1-11 01:22:26 | 只看该作者
MagicNumber = 1; 订单编号,用于区别其他EA所操作的订单
Lots_1 = 0.01; 下单手数1
Lots_2 = 0.01;下单手数2
KoeffLots = 2.0;不懂
LossInValute = 3.0;损失金额
ProfitInValute = 3.0;盈利金额
fitInValute = 2.0;不懂
Slippage = 3;滑点最大数
这些都是变量 是程序作者自己写的,我们只能从英文角度猜测其意思
板凳
 楼主| cxrwq 发表于 2018-1-11 02:37:03 | 只看该作者
#property copyright "Copyright ?2012, Fx-robot.ru"
#property link      "zhtfx.com"
extern int MagicNumber = 1;
extern double Lots_1 = 0.01;
extern double Lots_2 = 0.01;
extern double KoeffLots = 2.0;
extern double LossInValute = 3.0;
extern double ProfitInValute = 3.0;
extern double SumProfitInValute = 2.0;
extern int Slippage = 3;
extern string OrdersComment = "Shurgin_Collector";
int gi_160;
int g_magic_164;
int g_ticket_168;
int g_count_172;
int gi_176;
int gi_180;
int gi_184;
double g_lots_188;
double g_maxlot_212;
double g_minlot_220;
double g_lotstep_228;
double g_maxlot_236;
double g_minlot_244;
double g_lotstep_252;
double gda_260[500];
double gda_264[500];
double gd_268;
double gd_276;
string g_comment_284;
string g_comment_292;
string g_text_300;
bool gba_308[500];
bool gba_312[500];
bool gba_316[500];
bool gba_320[500];
int init() {
   if ((!IsExpertEnabled()) && !IsTesting()) Comment("Running experts in the terminal is prohibited! Click the \"EA\" on the toolbar.");
   ObjectCreate("Copyright", OBJ_LABEL, 0, 0, 1.0);
   ObjectSet("Copyright", OBJPROP_CORNER, 2);
   ObjectSet("Copyright", OBJPROP_XDISTANCE, 3);
   ObjectSet("Copyright", OBJPROP_YDISTANCE, 1);
   g_text_300 = "Shurgin Aleksandr " + CharToStr(174) + " zhtfx.com";
   ObjectSetText("Copyright", g_text_300, 12, "Times New Roman", Tomato);
   ObjectSet("Copyright", OBJPROP_TIMEFRAMES, NULL);
   ObjectSet("Copyright", OBJPROP_BACK, FALSE);
   gi_160 = 1000 * MagicNumber;
   g_maxlot_212 = MarketInfo(Pair_1, MODE_MAXLOT);
   g_minlot_220 = MarketInfo(Pair_1, MODE_MINLOT);
   g_lotstep_228 = MarketInfo(Pair_1, MODE_LOTSTEP);
   if (g_lotstep_228 = 0; pos_0--) {
      if (OrderSelect(pos_0, SELECT_BY_POS)) {
         if ((OrderSymbol() != Pair_1 && OrderSymbol() != Pair_2) || OrderMagicNumber() = gi_160 + 1000) continue;
         if (OrderMagicNumber() = 2 && gd_268 >= SumProfitInValute) {
      Print("*** Closure of all first orders at (SumProfitInValute) of profit ", gd_268);
      CloseAll(1, -1);
      return (0);
   }
   if (li_16 >= 2 && gd_276 >= SumProfitInValute) {
      Print("*** Closure of second order in (SumProfitInValute) of profit ", gd_276);
      CloseAll(2, -1);
      return (0);
   }
   if (gda_260[li_12] >= ProfitInValute) {
      Print("*** Closure ", li_12 + 1," a pair of first order in (ProfitInValute) of profit ", gda_260[li_12]);
      CloseAll(1, li_12);
      return (0);
   }
   if (gda_264[li_16] >= ProfitInValute) {
      Print("*** Closure ", li_16 + 1," a pair of second order (ProfitInValute) of profit ", gda_264[li_16]);
      CloseAll(2, li_16);
      return (0);
   }
   RefreshRates();
   if (li_12 = 0 && (!gba_308[li_12]) && gba_312[li_12]) {
         Print("*** Opening of the first order of the first pair");
         g_lots_188 = NRL1(Lots_1 * MathPow(KoeffLots, li_12));
         g_magic_164 = gi_160 + li_12;
      } else {
         if (li_12 >= 0 && gba_308[li_12] && gba_312[li_12] && gda_260[li_12]  0.0) {
      g_ticket_168 = OrderSend(Pair_1, OP_BUY, g_lots_188, MarketInfo(Pair_1, MODE_ASK), Slippage, 0, 0, g_comment_284, g_magic_164, 0, Blue);
      if (g_ticket_168 > 0) {
         g_count_172 = 0;
         while (g_count_172 = 0 && (!gba_312[li_12]) && gba_308[li_12]) {
         Print("*** Opening of the first order of the first pair");
         g_lots_188 = NRL2(Lots_2 * MathPow(KoeffLots, li_12));
         g_magic_164 = gi_160 + li_12;
      } else {
         if (li_12 >= 0 && gba_308[li_12] && gba_312[li_12] && gda_260[li_12]  0.0) {
      g_ticket_168 = OrderSend(Pair_2, OP_SELL, g_lots_188, MarketInfo(Pair_2, MODE_BID), Slippage, 0, 0, g_comment_284, g_magic_164, 0, Red);
      if (g_ticket_168 > 0) {
         g_count_172 = 0;
         while (g_count_172 = 0 && (!gba_316[li_16]) && gba_320[li_16]) {
         Print("*** Opening of the first order of the second pair");
         g_lots_188 = NRL1(Lots_1 * MathPow(KoeffLots, li_16));
         g_magic_164 = gi_160 + li_16 + 500;
      } else {
         if (li_16 >= 0 && gba_316[li_16] && gba_320[li_16] && gda_264[li_16]  0.0) {
      g_ticket_168 = OrderSend(Pair_2, OP_BUY, g_lots_188, MarketInfo(Pair_2, MODE_ASK), Slippage, 0, 0, g_comment_292, g_magic_164, 0, Blue);
      if (g_ticket_168 > 0) {
         g_count_172 = 0;
         while (g_count_172 = 0 && (!gba_320[li_16]) && gba_316[li_16]) {
         Print("*** Opening of the first order of the second pair");
         g_lots_188 = NRL2(Lots_2 * MathPow(KoeffLots, li_16));
         g_magic_164 = gi_160 + li_16 + 500;
      } else {
         if (li_16 >= 0 && gba_316[li_16] && gba_320[li_16] && gda_264[li_16]  0.0) {
      g_ticket_168 = OrderSend(Pair_1, OP_SELL, g_lots_188, MarketInfo(Pair_1, MODE_BID), Slippage, 0, 0, g_comment_292, g_magic_164, 0, Red);
      if (g_ticket_168 > 0) {
         g_count_172 = 0;
         while (g_count_172  g_maxlot_212) return (g_maxlot_212);
   return (NormalizeDouble(ad_0, gi_176));
}
double NRL2(double ad_0) {
   if (ad_0  g_maxlot_236) return (g_maxlot_236);
   return (NormalizeDouble(ad_0, gi_180));
}
int deinit() {
   ObjectDelete("Copyright");
   Comment("");
   return (0);
}
void CloseAll(int ai_0, int ai_4) {
   bool li_12 = TRUE;
   if (ai_0 == 1) {
      while (li_12) {
         li_12 = FALSE;
         for (int pos_8 = OrdersTotal() - 1; pos_8 >= 0; pos_8--) {
            if (OrderSelect(pos_8, SELECT_BY_POS)) {
               if (ai_4 >= 0 && OrderMagicNumber() != gi_160 + ai_4) continue;
               if (ai_4 = gi_160 + 500) continue;
               RefreshRates();
               if (OrderType() == OP_SELL && OrderSymbol() == Pair_2) {
                  li_12 = TRUE;
                  OrderClose(OrderTicket(), OrderLots(), MarketInfo(Pair_2, MODE_ASK), Slippage);
                  continue;
               }
               if (OrderType() == OP_BUY && OrderSymbol() == Pair_1) {
                  li_12 = TRUE;
                  OrderClose(OrderTicket(), OrderLots(), MarketInfo(Pair_1, MODE_BID), Slippage);
               }
            }
         }
         if (li_12) Sleep(2000);
      }
   } else {
      while (li_12) {
         li_12 = FALSE;
         for (pos_8 = OrdersTotal() - 1; pos_8 >= 0; pos_8--) {
            if (OrderSelect(pos_8, SELECT_BY_POS)) {
               if (ai_4 >= 0 && OrderMagicNumber() != gi_160 + ai_4 + 500) continue;
               if (ai_4 = gi_160 + 1000) continue;
               RefreshRates();
               if (OrderType() == OP_SELL && OrderSymbol() == Pair_1) {
                  li_12 = TRUE;
                  OrderClose(OrderTicket(), OrderLots(), MarketInfo(Pair_1, MODE_ASK), Slippage);
                  continue;
               }
               if (OrderType() == OP_BUY && OrderSymbol() == Pair_2) {
                  li_12 = TRUE;
                  OrderClose(OrderTicket(), OrderLots(), MarketInfo(Pair_2, MODE_BID), Slippage);
               }
            }
         }
         if (li_12) Sleep(2000);
      }
   }
}
这是原代码,但是下单的时候都 是0.1手,而且每次一下都是三个多空单,求修改成下单量每次0.01手,多空只进一单。
地板
人民币 发表于 2018-1-11 03:05:16 | 只看该作者


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
5#
天乙初一 发表于 2018-1-11 04:13:19 | 只看该作者




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
6#
chunshuo 发表于 2018-1-11 05:20:38 | 只看该作者
变量太多,理清逻辑太累了,还不如重新做
7#
光辉 发表于 2018-1-11 05:36:24 | 只看该作者
世界主要市场时间
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

Powered by 顺水鱼MT4外汇EA网! X3.2© 2001-2017 顺水MT4外汇EA公司.( 陕ICP备17014341号-1