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

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

在别的地方看到一个马丁EA,为什么无法运行

  [复制链接]
437 14
qaz8988 发表于 2016-7-3 20:38:04 | 只看该作者 |阅读模式 打印 上一主题 下一主题
[C++] 纯文本查看 复制代码 /*
  +--------+
  |Divergence Trader -- v11 has no divergence. How 'bout that!
  +--------+
  */
  #property copyright " "
  #property link ""
  extern bool auto_close_order = false;
  // user input
  extern double Lots=0.1; // how many lots to trade at a time
  extern int MA1_Period=50;
  extern int MA2_Period=150;
  extern int MA3_Period=10;
  extern int MA4_Period=20;
  int MA_Price = PRICE_OPEN;
  int MA_Mode = MODE_SMA;
  extern double ProfitMade=100; // how much money do you expect to make
  extern double LossLimit=115; // how much loss can you tolorate
  //extern int BasketProfit=10; // if equity reaches this level, close trades
  //extern int BasketLoss=9999; // if equity reaches this negative level, close trades
  extern int PLBreakEven=9999; // set break even when this many pips are made (999=off)
  int Slippage=2; // how many pips of slippage can you tolorate
  // naming and numbering
  int MagicNumber = 200601182020; // allows multiple experts to trade on same account
  string TradeComment = "哥的EA";
  // Bar handling
  datetime bartime=0; // used to determine when a bar has moved
  int bartick=0; // number of times bars have moved
  int objtick=0; // used to draw objects on the chart
  int tickcount=0;
  // Trade control
  bool TradeAllowed=true; // used to manage trades
  //+-------------+
  //| Custom init |
  //|-------------+
  // Called ONCE when EA is added to chart or recompiled
  int init()
  {
  int i;
  string o;
  //remove the old objects
  for(i=0; i[B]= 0 && TimeHour(TimeCurrent()) =0;cnt--)
  {
  OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
  if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)
  {
  OrdersPerSymbol++;
  }
  }
  //+-----------------------------+
  //| Insert your indicator here |
  //| And set either BUYme or |
  //| SELLme true to place orders |
  //+-----------------------------+
  // high and low of [1] and open of [0] either above or below the MA
  maHI=High[1];
  maLO=Low[1];
  maOPEN=Open[0];
  ma0=iMA(Symbol(),0,MA1_Period,0,MA_Mode,MA_Price,1);
  ma1=iMA(Symbol(),0,MA2_Period,0,MA_Mode,MA_Price,1);
  ma2=iMA(Symbol(),0,MA3_Period,0,MA_Mode,MA_Price,1);
  ma3=iMA(Symbol(),0,MA4_Period,0,MA_Mode,MA_Price,1);
  ma2_1=iMA(Symbol(),0,MA3_Period,0,MA_Mode,MA_Price,0);
  ma2_2=iMA(Symbol(),0,MA3_Period,0,MA_Mode,MA_Price,2);
  double kdj1 = iStochastic(Symbol(),0,10,5,5,MODE_SMA,1,MODE_MAIN,1);
  double kdj2 = iStochastic(Symbol(),0,10,5,5,MODE_SMA,1,MODE_SIGNAL,1);
  // double kdj11 = iStochastic(Symbol(),0,20,10,10,MODE_SMA,1,MODE_MAIN,1);
  // double kdj21 = iStochastic(Symbol(),0,20,10,10,MODE_SMA,1,MODE_SIGNAL,1);
  // if(kdj1>kdj2 && kdj11>kdj21)close_order(OP_SELL,1);
  // if(kdj1 ma3)close_order(OP_SELL,0);
  if(ma2 ma0 && maLO>ma0 && maOPEN>ma0
  && maHI>ma2 && maOPEN>ma2
  && maOPEN>ma1 && ma0>ma1
  && ma2 > ma3
  && ma2_1>ma2 && ma2>ma2_2
  //&& kdj1>kdj2 //&& kdj110
  ) SELLme=true;
  //+------------+
  //| End Insert |
  //+------------+
  // if(kdj1>kdj2)close_order(OP_SELL,1);
  // if(kdj1
收藏
收藏0
转播
转播
分享
分享
分享
淘帖0

精彩评论14

跳转到指定楼层
沙发
 楼主| qaz8988 发表于 2016-7-3 20:39:18 | 只看该作者
/*
  +--------+
  |Divergence Trader -- v11 has no divergence. How 'bout that!
  +--------+
  */
  #property copyright " "
  #property link ""
  extern bool auto_close_order = false;
  // user input
  extern double Lots=0.1; // how many lots to trade at a time
  extern int MA1_Period=50;
  extern int MA2_Period=150;
  extern int MA3_Period=10;
  extern int MA4_Period=20;
  int MA_Price = PRICE_OPEN;
  int MA_Mode = MODE_SMA;
  extern double ProfitMade=100; // how much money do you expect to make
  extern double LossLimit=115; // how much loss can you tolorate
  //extern int BasketProfit=10; // if equity reaches this level, close trades
  //extern int BasketLoss=9999; // if equity reaches this negative level, close trades
  extern int PLBreakEven=9999; // set break even when this many pips are made (999=off)
  int Slippage=2; // how many pips of slippage can you tolorate
  // naming and numbering
  int MagicNumber = 200601182020; // allows multiple experts to trade on same account
  string TradeComment = "哥的EA";
  // Bar handling
  datetime bartime=0; // used to determine when a bar has moved
  int bartick=0; // number of times bars have moved
  int objtick=0; // used to draw objects on the chart
  int tickcount=0;
  // Trade control
  bool TradeAllowed=true; // used to manage trades
  //+-------------+
  //| Custom init |
  //|-------------+
  // Called ONCE when EA is added to chart or recompiled
  int init()
  {
  int i;
  string o;
  //remove the old objects
  for(i=0; i[B]= 0 && TimeHour(TimeCurrent()) =0;cnt--)
  {
  OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
  if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)
  {
  OrdersPerSymbol++;
  }
  }
  //+-----------------------------+
  //| Insert your indicator here |
  //| And set either BUYme or |
  //| SELLme true to place orders |
  //+-----------------------------+
  // high and low of [1] and open of [0] either above or below the MA
  maHI=High[1];
  maLO=Low[1];
  maOPEN=Open[0];
  ma0=iMA(Symbol(),0,MA1_Period,0,MA_Mode,MA_Price,1);
  ma1=iMA(Symbol(),0,MA2_Period,0,MA_Mode,MA_Price,1);
  ma2=iMA(Symbol(),0,MA3_Period,0,MA_Mode,MA_Price,1);
  ma3=iMA(Symbol(),0,MA4_Period,0,MA_Mode,MA_Price,1);
  ma2_1=iMA(Symbol(),0,MA3_Period,0,MA_Mode,MA_Price,0);
  ma2_2=iMA(Symbol(),0,MA3_Period,0,MA_Mode,MA_Price,2);
  double kdj1 = iStochastic(Symbol(),0,10,5,5,MODE_SMA,1,MODE_MAIN,1);
  double kdj2 = iStochastic(Symbol(),0,10,5,5,MODE_SMA,1,MODE_SIGNAL,1);
  // double kdj11 = iStochastic(Symbol(),0,20,10,10,MODE_SMA,1,MODE_MAIN,1);
  // double kdj21 = iStochastic(Symbol(),0,20,10,10,MODE_SMA,1,MODE_SIGNAL,1);
  // if(kdj1>kdj2 && kdj11>kdj21)close_order(OP_SELL,1);
  // if(kdj1 ma3)close_order(OP_SELL,0);
  if(ma2 ma0 && maLO>ma0 && maOPEN>ma0
  && maHI>ma2 && maOPEN>ma2
  && maOPEN>ma1 && ma0>ma1
  && ma2 > ma3
  && ma2_1>ma2 && ma2>ma2_2
  //&& kdj1>kdj2 //&& kdj110
  ) SELLme=true;
  //+------------+
  //| End Insert |
  //+------------+
  // if(kdj1>kdj2)close_order(OP_SELL,1);
  // if(kdj1<kdj2)close_order(OP_BUY,1);
  //ENTRY LONG (buy, Ask)
  if(TradeAllowed && BUYme)
  {
  close_order(OP_SELL,0);
  //Ask(buy, long)
  if(LossLimit ==0) SL=0; else SL=Ask-( (LossLimit +7)*Point );
  if(ProfitMade==0) TP=0; else TP=Ask+( (ProfitMade+7)*Point );
  OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,TradeComment,MagicNumber,White);
  gle=GetLastError();
  if(gle==0)
  {
  Print("BUY Ask=",Ask," bartick=",bartick);
  ObjectCreate("myx"+DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[0], High[0]+(5*p));
  ObjectSetText("myx"+DoubleToStr(objtick,0),"B",15,"Arial",Red);
  bartick=0;
  TradeAllowed=false;
  }
  else
  {
  Print("-----ERROR----- BUY Ask=",Ask," error=",gle," bartick=",bartick);
  }
  }
板凳
 楼主| qaz8988 发表于 2016-7-3 21:55:14 | 只看该作者
哪位朋友能帮忙看看,问题出在哪里了?
地板
 楼主| qaz8988 发表于 2016-7-4 09:31:03 | 只看该作者
貌似是 哪里有 }  用的不对
5#
 楼主| qaz8988 发表于 2016-7-4 14:43:49 | 只看该作者
哪位看看。。。
6#
 楼主| qaz8988 发表于 2016-7-4 18:37:52 | 只看该作者
'{' - unbalanced parentheses        马丁网格1.mq4        79        1
')' - unexpected end of program        马丁网格1.mq4        187        1
7#
jueeee 发表于 2016-7-4 22:29:00 | 只看该作者
你这就是个半成品,,都还没有写完的
8#
 楼主| qaz8988 发表于 2016-7-4 22:29:49 | 只看该作者

.........i原来如此啊
9#
james_luqixuan 发表于 2016-7-4 18:37:00 | 只看该作者
额,看看看看了解一下
10#
 楼主| qaz8988 发表于 2016-7-5 16:34:13 | 只看该作者

兄弟懂吗,帮忙看看
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

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