论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:2868回复:12
草龙
注册时间2004-12-17
[MT4-EA]10点EA指标最终版
楼主发表于:2014-01-01 17:57只看该作者倒序浏览
1楼 电梯直达
电梯直达
这个应该是改良了好几版以后放出来的 可以用作对比研究下//+------------------------------------------------------------------+ //| 10points 3.mq4 | //| Copyright 2005, Alejandro Galindo | //| http://elCactus.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2005, Alejandro Galindo" #property link "http://elCactus.com" extern double Lots = 0.1; extern double TakeProfit = 30; extern int Pips = 20; extern int MaxTrades = 15; extern double Multiplier = 2; extern string Indicator ="TURBO"; extern int H_level =70; extern int L_level =30; extern int mm=0; extern int risk=5; #define Magic 20070413 #define EAname "10points_4_Inds" int AccountisNormal=0; int SecureProfit=100; int AccountProtection=1; int OrderstoProtect=3; double InitialStop = 0; double TrailingStop = 15; int OpenOrders=0, cnt=0; int Slippage=5; double sl=0, tp=0; double BuyPrice=0, SellPrice=0; double lotsi=0, mylotsi=0; int mode=0, myOrderType=0, myBuyOrderType=0, mySellOrderType=0; bool ContinueOpening=True; double LastPrice=0; int PreviousOpenOrders=0; double Profit=0; int LastTicket=0, LastType=0; double LastClosePrice=0, LastLots=0; double Pivot=0; double PipValue=0; string text="", text2=""; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- double ind; if (AccountisNormal==1) { if (mm!=0) { lotsi=MathCeil(AccountBalance()*risk/10000); } else { lotsi=Lots; } } else { // then is mini if (mm!=0) { lotsi=MathCeil(AccountBalance()*risk/10000)/100; } else { lotsi=Lots; } } if (lotsi>100){ lotsi=100; } OpenOrders=0; for(cnt=0;cntOpenOrders) { for(cnt=OrdersTotal();cnt>=0;cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); mode=OrderType(); if (OrderSymbol()==Symbol() && OrderMagicNumber() == Magic) { if (mode==OP_BUY) { OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Blue); } if (mode==OP_SELL) { OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Red); } return(0); } } } PreviousOpenOrders=OpenOrders; if (OpenOrders>=MaxTrades) { ContinueOpening=False; } else { ContinueOpening=True; } if (LastPrice==0) { for(cnt=0;cntH_level) myOrderType=1; if(iRSI(NULL,Period(),14,PRICE_CLOSE,0)iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,1)) myOrderType=2; if (iMACD(NULL,Period(),14,26,9,PRICE_CLOSE,MODE_MAIN,0) H_level) myOrderType=1; if (iCustom(Symbol(),Period(),"Turbo_JRSX",14,MODE_MAIN,0)< L_level) myOrderType=2; } if (Indicator=="TURBO2") { if (iCustom(Symbol(),Period(),"Turbo_JVEL",14,MODE_MAIN,0)> 0.10) myOrderType=1; if (iCustom(Symbol(),Period(),"Turbo_JVEL",14,MODE_MAIN,0)< -0.10) myOrderType=2; } if (Indicator=="STOCH") { if(iStochastic(NULL,Period(),5,3,9,MODE_SMA,0,MODE_MAIN,0)>H_level && iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,1)>H_level) myOrderType=1; if(iStochastic(NULL,Period(),5,3,9,MODE_SMA,0,MODE_MAIN,0)=0;cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol()==Symbol() && OrderMagicNumber() == Magic) { if (OrderType()==OP_SELL) { if (TrailingStop>0) { if (OrderOpenPrice()-Ask>=(TrailingStop+Pips)*Point) { if (OrderStopLoss()>(Ask+Point*TrailingStop)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderClosePrice()-TakeProfit*Point-TrailingStop*Point,800,Purple); return(0); } } } } if (OrderType()==OP_BUY) { if (TrailingStop>0) { if (Bid-OrderOpenPrice()>=(TrailingStop+Pips)*Point) { if (OrderStopLoss()<(Bid-Point*TrailingStop)) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderClosePrice()+TakeProfit*Point+TrailingStop*Point,800,Yellow); return(0); } } } } } } Profit=0; LastTicket=0; LastType=0; LastClosePrice=0; LastLots=0; for(cnt=0;cntOrderOpenPrice()) { Profit=Profit+(OrderClosePrice()-OrderOpenPrice())*OrderLots()/Point; } } if (LastType==OP_SELL) { //Profit=Profit+(Ord(cnt,VAL_OPENPRICE)-Ord(cnt,VAL_CLOSEPRICE))*PipValue*Ord(cnt,VAL_LOTS); if (OrderClosePrice()>OrderOpenPrice()) { Profit=Profit-(OrderClosePrice()-OrderOpenPrice())*OrderLots()/Point; } if (OrderClosePrice()=(MaxTrades-OrderstoProtect) && AccountProtection==1) { //Print(Symbol,":",Profit); if (Profit>=SecureProfit) { OrderClose(LastTicket,LastLots,LastClosePrice,Slippage,Yellow); ContinueOpening=False; return(0); } } if (!IsTesting()) { if (myOrderType==3) { text="No conditions to open trades"; } else { text=" "; } Comment("LastPrice=",LastPrice," Previous open orders=",PreviousOpenOrders,"\nContinue opening=",ContinueOpening," OrderType=",myOrderType,"\n",text2,"\nLots=",lotsi,"\n",text); } if (myOrderType==1 && ContinueOpening) { if ((Bid-LastPrice)>=Pips*Point || OpenOrders<1) { SellPrice=Bid; LastPrice=0; if (TakeProfit==0) { tp=0; } else { tp=SellPrice-TakeProfit*Point; } if (InitialStop==0) { sl=0; } else { sl=SellPrice+InitialStop*Point; } if (OpenOrders!=0) { mylotsi=lotsi; for(cnt=1;cnt<=OpenOrders;cnt++) { mylotsi=NormalizeDouble(mylotsi*Multiplier,2); Comment(mylotsi); } } else { mylotsi=lotsi; } if (mylotsi>100) { mylotsi=100; } if (mylotsi>1) { tp =NormalizeDouble(tp+(tp*0.15),2); mylotsi=NormalizeDouble(mylotsi-(mylotsi*0.15),2); } OrderSend(Symbol(),OP_SELL,mylotsi,SellPrice,Slippage,sl,tp,EAname,Magic,0,Red); return(0); } } if (myOrderType==2 && ContinueOpening) { if ((LastPrice-Ask)>=Pips*Point || OpenOrders<1) { BuyPrice=Ask; LastPrice=0; if (TakeProfit==0) { tp=0; } else { tp=BuyPrice+TakeProfit*Point; } if (InitialStop==0) { sl=0; } else { sl=BuyPrice-InitialStop*Point; } if (OpenOrders!=0) { mylotsi=lotsi; for(cnt=1;cnt<=OpenOrders;cnt++) { mylotsi=NormalizeDouble(mylotsi*Multiplier,2); Comment(mylotsi); } } else { mylotsi=lotsi; } if (mylotsi>100) { mylotsi=100; } if (mylotsi>1) { tp =NormalizeDouble(tp+(tp*0.15),2); mylotsi=NormalizeDouble(mylotsi-(mylotsi*0.15),2); } OrderSend(Symbol(),OP_BUY,mylotsi,BuyPrice,Slippage,sl,tp,EAname,Magic,0,Blue); return(0); } } //---- return(0); } //+------------------------------------------------------------------+
TK29帖子1楼右侧xm竖版广告90-240
个性签名

阅尽天下指标
搬砖开始,始于2014

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
devia
注册时间2012-10-23
发表于:2014-05-20 15:38只看该作者
2楼
本人菜鸟 看不懂 以前不知道在哪里弄了一个盈利10点后自动移动止损保本的EA,电脑重装后一直找不到了 楼主可以帮忙写一个不?emoji-image
MikeFX
注册时间2014-05-22
发表于:2014-05-24 04:16只看该作者
3楼
感谢感谢! 但是编译通过不了呀!
microscale
注册时间2014-02-08
十月十日上
注册时间2015-02-04
发表于:2015-02-04 07:55只看该作者
5楼
这个有13个错误呀
ljwlxrll
注册时间2015-02-10
yongp
注册时间2015-03-13
aacky
注册时间2015-04-11
风轻云
注册时间2015-04-26
发表于:2015-04-27 03:00只看该作者
9楼
neri666
注册时间2015-05-06
发表于:2015-05-14 06:29只看该作者
11楼
里面错误好多。。还缺指标。。RSI,,MACD等等好多判断估计成功率也不高
个性签名

韬客社区www.talkfx.co

plm
注册时间2015-10-29
混血王子
注册时间2016-06-07
发表于:2016-06-10 11:09只看该作者
13楼
完全看不懂这些
个性签名

韬客社区www.talkfx.co

本站免责声明:

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

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

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

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

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

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