[MT4-EA]大家来讨论下这个EA 是啥原理的?可用不?
EA,哪位懂的下载看看说说能用不?什么原理?好盈利不?
RUBBERBANDS_2套利.mq4
2楼
我不是想挣通宝,是想请教大家,可是一上次附件就这样。我把内容黏贴上来吧,不用的可以不用下载看、
韬客社区www.talkfx.co
5楼
//+------------------------------------------------------------------+
//| RUBBERBANDS_2.mq4 |
//| Version 1.2 |
//| Copyright ?2009, SummerSoft Labs |
//| http://www.summersoftlabs.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2009, SummerSoft Labs"
#property link "http://www.summersoftlabs.com/"
//////////////////////////////////////
extern double Lots = 0.02;
extern int maxcount = 10;
extern int pipstep = 50;
//////////////////////////////////////
extern bool quiescenow = false;
extern bool donow = false;
extern bool stopnow = false;
extern bool closenow = false;
//////////////////////////////////////
extern bool use_sessionTP = true;
extern double sessionTP = 1000; // per lot
extern bool use_sessionSL = false;
extern double sessionSL = 300; // per lot
//////////////////////////////////////
extern bool useinvalues = false; // set to true on restart
extern double inmax = 0; // set former max on restart
extern double inmin = 0; // set former min on restart
//////////////////////////////////////
//global var's
double GLBmax;
double GLBmin;
bool GLBcloseall;
bool GLBbuynow;
bool GLBsellnow;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int tradeno()
{
int cnt, total, xcnt;
total=OrdersTotal();
if (total==0)
{
return(0);
}
xcnt=0;
for(cnt=0;cnt0)
{
close1by1();
return(0);
}
if (GLBcloseall==true && total==0)
{
GLBcloseall=false;
GLBmax=Ask;
GLBmin=Ask;
GLBbuynow=false;
GLBsellnow=false;
}
// check free margin
if(AccountFreeMargin()<(1000*Lots))
{
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
// BUY NOW?
if (GLBbuynow==true)
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"RUBBERBANDS_2",10000,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
}
else
{
Print("Error opening BUY order : ",GetLastError());
return(-1);
}
GLBbuynow=false;
return(0);
}
// SELL NOW?
if (GLBsellnow==true)
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"RUBBERBANDS_2",20000,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
}
else
{
Print("Error opening SELL order : ",GetLastError());
return(-1);
}
GLBsellnow=false;
return(0);
}
// new order from 0 orders
if (total==0 && Seconds()==0)
{
GLBbuynow=true;
GLBsellnow=true;
return(0);
}
///////////////////////////////////////////////////////////////////////////////////////
// counter if you will
if (total>0)
{
// what's the profit made
double myprofit=0;
int xtotal=OrdersTotal();
for(cnt=0;cnt=sessionTP*Lots)
{
GLBcloseall=true;
}
// close all trades for loss cut?
if (use_sessionSL==true
&& myprofit<=(-1)*sessionSL*Lots)
{
GLBcloseall=true;
}
if (total>=maxcount)
{
return(0);
}
// do we buy or sell now?
if (Ask>=GLBmax+pipstep*Point)
{
GLBmax=Ask;
GLBsellnow=true;
return(0);
}
if (Ask<=GLBmin-pipstep*Point)
{
GLBmin=Ask;
GLBbuynow =true;
return(0);
}
} // if total
return(0);
} //-start
///////////////////////////////////////////////////////////////////////////////////////
int deinit()
{
return(0);
}
///////////////////////////////////////////////////////////////////////////////////////
// the end.