who can help me ~~~('for' - expressions are not allowed on a global scope) 新评论 zero3489 2014.04.12 08:56 What went wrong, I am looking for a long time or have no clue who can help me ~~~ thank ~~//+------------------------------------------------------------------+//| Martingale.mq4 //| Copyright2014s //| //+------------------------------------------------------------------+string ea="zero"; extern string separator0 = "------ Normal settings ------";extern double TP =20;extern double maxspread =0;extern double magicNumber =7788999;extern string separator1 = "------ Martingale settings ------";extern int MartingaleType =0;extern double LotMultiplier =2;extern int MaxMartingale =15;extern double BaseLotSize =0.1;extern double LoopPoint =30;int WinCount=0;int LossCount=0;/////////////////////////////////////////////////////////////////////////////////////////////Martingale settingsfor(int Count=OrdersHistoryTotal()=i,Count--) { { { OrderSelect(Count,SELECT_BY_POS,MODE_HISTORY); if(OrderSymbol() = Symbol() && OrderMagicNumber() == magicNumber); } { { if(OrderProfit() > 0 && LossCount == 0) WinCount ++; else if(OrderProfit() < 0 && WinCount = 0) LossCount ++; } { if(MartingaleType == 0) int LoopPoint = LossCount; // lot size calculation else if(MartingaleType == 1) LoopPoint = WinCount; // lot size calculation } { if(LoopPoint > MaxMartingale) LoopPoint = MaxMartingale; // lot size calculation double LotSize = BaseLotSize * MathPow(LotMultiplier,LoopPoint); // lot size calculation } else break; } } /////////////////////////////////////////////////////////////////////////////////////////////Normal settingsint start() { if(OrdersTotal()==0) { OrderSend(Symbol(),OP_BUY,BaseLotSize,Ask, maxspread,Ask-LoopPoint*Point,Ask+TP*Point,""+ea+"",magicNumber,0,Green); } return(0); }}/////////////////////////////////////////////////////////////////////////////////////////////end [Archive!] I will write any expert or indicator for free. [WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. 哪位高人可以把这个EA的每一句代表什么意思做个翻译!你会有意想不到的收获! enbo lu 2014.04.15 15:18 #1 I think you should learn to code from the very begining... 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
What went wrong, I am looking for a long time or have no clue
who can help me ~~~
thank ~~
//+------------------------------------------------------------------+
//| Martingale.mq4
//| Copyright2014s
//|
//+------------------------------------------------------------------+
string ea="zero";
extern string separator0 = "------ Normal settings ------";
extern double TP =20;
extern double maxspread =0;
extern double magicNumber =7788999;
extern string separator1 = "------ Martingale settings ------";
extern int MartingaleType =0;
extern double LotMultiplier =2;
extern int MaxMartingale =15;
extern double BaseLotSize =0.1;
extern double LoopPoint =30;
int WinCount=0;
int LossCount=0;
/////////////////////////////////////////////////////////////////////////////////////////////Martingale settings
for(int Count=OrdersHistoryTotal()=i,Count--)
{
{
{
OrderSelect(Count,SELECT_BY_POS,MODE_HISTORY);
if(OrderSymbol() = Symbol() && OrderMagicNumber() == magicNumber);
}
{
{
if(OrderProfit() > 0 && LossCount == 0) WinCount ++;
else if(OrderProfit() < 0 && WinCount = 0) LossCount ++;
}
{
if(MartingaleType == 0) int LoopPoint = LossCount; // lot size calculation
else if(MartingaleType == 1) LoopPoint = WinCount; // lot size calculation
}
{
if(LoopPoint > MaxMartingale) LoopPoint = MaxMartingale; // lot size calculation
double LotSize = BaseLotSize * MathPow(LotMultiplier,LoopPoint); // lot size calculation
}
else break;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////Normal settings
int start()
{
if(OrdersTotal()==0)
{
OrderSend(Symbol(),OP_BUY,BaseLotSize,Ask, maxspread,Ask-LoopPoint*Point,Ask+TP*Point,""+ea+"",magicNumber,0,Green);
}
return(0);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////end