论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:714回复:3
少年不平凡
注册时间2014-09-05
[求助]在别的地方看到一个马丁EA,为什么无法运行
楼主发表于:2016-07-03 05:54只看该作者倒序浏览
1楼 电梯直达
电梯直达
/*   +--------+   |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= 0 && TimeHour(TimeCurrent()) < 8)sig = 1;else sig = 2;   double p=Point;   double spread=Ask-Bid;   int cnt=0;   int gle=0;   int OrdersPerSymbol=0;   // stoploss and takeprofit and close control   double SL=0;   double TP=0;   double CurrentProfit=0;   double CurrentBasket=0;   // direction control   bool BUYme=false;   bool SELLme=false;   // Trade stuff   double ma0;   double ma1;   double ma2;   double ma3;   double maHI;   double maLO;   double maOPEN;   double ma2_1,ma2_2;   // bar counting   if(bartime!=Time[0])   {   bartime=Time[0];   bartick++;   objtick++;   TradeAllowed=true;   }   OrdersPerSymbol=0;   for(cnt=OrdersTotal();cnt>=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 < ma3)close_order(OP_BUY,0);   }   if(maHI>ma0 && maLO>ma0 && maOPEN>ma0   && maHI>ma2 && maOPEN>ma2   && maOPEN>ma1 && ma0>ma1   && ma2 > ma3   && ma2_1>ma2 && ma2>ma2_2   //&& kdj1>kdj2 //&& kdj1<90   ) BUYme=true;   if(maHI10   ) SELLme=true;   //+------------+   //| End Insert |   //+------------+   // if(kdj1>kdj2)close_order(OP_SELL,1);   // if(kdj1TK29帖子1楼右侧xm竖版广告90-240
个性签名

韬客社区www.talkfx.co

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
少年不平凡
注册时间2014-09-05
楼主发表于:2016-07-03 05:55只看该作者
2楼
编译的时候提示有很多错误啊,哪位朋友懂的帮忙看看。
少年不平凡
注册时间2014-09-05
少年不平凡
注册时间2014-09-05

本站免责声明:

1、本站所有广告及宣传信息均与韬客无关,如需投资请依法自行决定是否投资、斟酌资金安全及交易亏损风险;

2、韬客是独立的、仅为投资者提供交流的平台,网友发布信息不代表韬客的观点与意思表示,所有因网友发布的信息而造成的任何法律后果、风险与责任,均与韬客无关;

3、金融交易存在极高法律风险,未必适合所有投资者,请不要轻信任何高额投资收益的诱导而贸然投资;投资保证金交易导致的损失可能超过您投入的资金和预期。请您考虑自身的投资经验及风险承担能力,进行合法、理性投资;

4、所有投资者的交易帐户应仅限本人使用,不应交由第三方操作,对于任何接受第三方喊单、操盘、理财等操作的投资和交易,由此导致的任何风险、亏损及责任由投资者个人自行承担;

5、韬客不隶属于任何券商平台,亦不受任何第三方控制,韬客不邀约客户投资任何保证金交易,不接触亦不涉及投资者的任何资金及账户信息,不代理任何交易操盘行为,不向客户推荐任何券商平台,亦不存在其他任何推荐行为。投资者应自行选择券商平台,券商平台的任何行为均与韬客无关。投资者注册及使用韬客即表示其接受和认可上述声明,并自行承担法律风险。

版权所有:韬客外汇论坛 www.talkfx.com 联络我们:[email protected]