myeatrade

社区

版主进来帮忙看你一下,这个EA仓小不开单,开单只有0.01 0.02,在哪里改限制?谢谢。

xuehui xuehui 2012-12-12 14:45
string gs_76 = \"SteadyWinner V2\";
int gi_84 = 0;
double gd_88 = 200.0;
double gd_96 = 200.0;
double gd_104 = 50.0;
double gd_112 = 50.0;
double gd_120 = 20.0;
double gd_128 = 20.0;
double gd_136 = 0.0;
double gd_144 = 0.01;
double gd_152;
int gi_160 = 3;
bool gi_164 = TRUE;
int gi_168 = 0;
int gi_172 = 23;
bool gi_176 = TRUE;
string gs_180 = \"alert.wav\";
int gi_188 = Blue;
int gi_192 = Aqua;
int gi_196 = Red;
int gi_200 = Aqua;
string gs_204 = \"0\";
string gs_212;

void init() {
if (Digits == 3 || Digits == 5) gd_136 = 10.0 * Point;
else gd_136 = Point;
ObjectCreate(\"ObjName\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName\", \"SteadyWinner(V2) for small accounts (trading 0.02 and 0.0.05)\", 9, \"Verdana\", White);
ObjectSet(\"ObjName\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName\", OBJPROP_YDISTANCE, 20);
ObjectCreate(\"ObjName1\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName1\", \"Use this EA on EURUSD, any time frame.\", 9, \"Verdana\", White);
ObjectSet(\"ObjName1\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName1\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName1\", OBJPROP_YDISTANCE, 40);
ObjectCreate(\"ObjName2\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName2\", \"This EA is a shareware. If you like it,\", 9, \"Verdana\", White);
ObjectSet(\"ObjName2\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName2\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName2\", OBJPROP_YDISTANCE, 60);
ObjectCreate(\"ObjName3\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName3\", \"please visit http://steadywinner.mipropia.com\", 9, \"Verdana\", White);
ObjectSet(\"ObjName3\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName3\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName3\", OBJPROP_YDISTANCE, 80);
ObjectCreate(\"ObjName4\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName4\", \"or write to steadywinner@gmail.com to get the latest version.\", 9, \"Verdana\", White);
ObjectSet(\"ObjName4\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName4\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName4\", OBJPROP_YDISTANCE, 100);
if (Symbol() != \"EURUSD\") Alert(\"Put this EA on EURUSD chart. Any time frame.\");
}

void deinit() {
ObjectCreate(\"ObjName\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName\", \"\", 10, \"Verdana\", White);
ObjectSet(\"ObjName\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName\", OBJPROP_YDISTANCE, 20);
ObjectCreate(\"ObjName1\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName1\", \"\", 10, \"Verdana\", White);
ObjectSet(\"ObjName1\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName1\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName1\", OBJPROP_YDISTANCE, 20);
ObjectCreate(\"ObjName2\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName2\", \"\", 10, \"Verdana\", White);
ObjectSet(\"ObjName2\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName2\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName2\", OBJPROP_YDISTANCE, 20);
ObjectCreate(\"ObjName3\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName3\", \"\", 10, \"Verdana\", White);
ObjectSet(\"ObjName3\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName3\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName3\", OBJPROP_YDISTANCE, 20);
ObjectCreate(\"ObjName4\", OBJ_LABEL, 0, 0, 0);
ObjectSetText(\"ObjName4\", \"\", 10, \"Verdana\", White);
ObjectSet(\"ObjName4\", OBJPROP_CORNER, 0);
ObjectSet(\"ObjName4\", OBJPROP_XDISTANCE, 20);
ObjectSet(\"ObjName4\", OBJPROP_YDISTANCE, 20);
}

int start() {
int li_0;
int li_4;
bool li_8;
if (gi_164) {
if (!(Hour() >= gi_168 && Hour() <= gi_172)) {
Comment(\"Time for trade has not come else!\");
return (0);
}
}
if (Bars < 100) {
Print(\"bars less than 100\");
return (0);
}
if (gi_84 > 0 && gi_84 != AccountNumber()) {
Comment(\"Trade on account :\" + AccountNumber() + \" FORBIDDEN!\");
return (0);
}
if ((gd_88 > 0.0 && gd_88 < 3.0) || (gd_96 > 0.0 && gd_96 < 3.0)) {
Print(\"StopLoss less than \" + 3);
return (0);
}
if ((gd_104 > 0.0 && gd_104 < 3.0) || (gd_112 > 0.0 && gd_112 < 3.0)) {
Print(\"TakeProfit less than \" + 3);
return (0);
}
double ld_12 = iWPR(NULL, PERIOD_M1, 155, 0);
double ld_20 = iWPR(NULL, PERIOD_M5, 155, 0);
double ld_28 = iWPR(NULL, PERIOD_M15, 155, 0);
double ld_36 = iWPR(NULL, PERIOD_M30, 155, 0);
double ld_44 = iWPR(NULL, PERIOD_H1, 155, 0);
double ld_52 = iWPR(NULL, PERIOD_H4, 155, 0);
double ld_60 = iWPR(NULL, PERIOD_D1, 155, 0);
double ld_68 = iWPR(NULL, PERIOD_M1, 150, 0);
double ld_76 = iWPR(NULL, PERIOD_M1, 155, 0);
double ld_84 = iWPR(NULL, PERIOD_M1, 160, 0);
double ld_92 = iBands(NULL, PERIOD_M1, 45, 2, 0, PRICE_CLOSE, MODE_UPPER, 0);
double ld_100 = iEnvelopes(NULL, PERIOD_M1, 45, MODE_SMA, 0, PRICE_CLOSE, 0.12, MODE_UPPER, 0);
double ld_108 = iBands(NULL, PERIOD_M1, 45, 2, 0, PRICE_CLOSE, MODE_LOWER, 0);
double ld_116 = iEnvelopes(NULL, PERIOD_M1, 45, MODE_SMA, 0, PRICE_CLOSE, 0.12, MODE_LOWER, 0);
double ld_124 = iClose(NULL, PERIOD_M1, 0);
double ld_132 = iWPR(NULL, PERIOD_M1, 155, 0);
double ld_140 = iMA(NULL, PERIOD_M1, 700, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_148 = iMA(NULL, PERIOD_M5, 700, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_156 = iMA(NULL, PERIOD_M15, 700, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_164 = iMA(NULL, PERIOD_M30, 700, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_172 = iMA(NULL, PERIOD_H1, 700, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_180 = iStochastic(NULL, PERIOD_M1, 200, 75, 50, MODE_SMA, 0, MODE_SIGNAL, 0);
double ld_188 = iStochastic(NULL, PERIOD_M1, 200, 75, 50, MODE_SMA, 0, MODE_MAIN, 0);
double ld_196 = iWPR(NULL, PERIOD_M1, 155, 0);
double ld_204 = iWPR(NULL, PERIOD_M5, 155, 0);
double ld_212 = iWPR(NULL, PERIOD_M15, 155, 0);
double ld_220 = iMA(NULL, PERIOD_M1, 300, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_228 = iMA(NULL, PERIOD_M1, 450, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_236 = iMA(NULL, PERIOD_M1, 100, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_244 = iMA(NULL, PERIOD_M1, 250, 0, MODE_EMA, PRICE_CLOSE, 0);
double ld_252 = iClose(NULL, PERIOD_M1, 0);
double ld_260 = iSAR(NULL, PERIOD_M1, 0.002, 0.2, 0);
double ld_268 = iMomentum(NULL, PERIOD_M1, 2, PRICE_HIGH, 0);
double ld_276 = iATR(NULL, PERIOD_M1, 600, 0);
double ld_284 = iATR(NULL, PERIOD_M1, 1200, 0);
double ld_292 = iBands(NULL, PERIOD_M1, 5, 3, 0, PRICE_CLOSE, MODE_UPPER, 0);
double ld_300 = iBands(NULL, PERIOD_M1, 5, 3, 0, PRICE_CLOSE, MODE_LOWER, 0);
if (OrderProfit() > 0.001 && OrderComment() == \"SteadyWinner2\" && MarketInfo(Symbol(), MODE_MINLOT) == 0.01) gd_152 = 1;
if (OrderProfit() == 0.0 && MarketInfo(Symbol(), MODE_MINLOT) == 0.01) gd_144 = 0.01;
if (OrderProfit() > 0.001 && MarketInfo(Symbol(), MODE_MINLOT) == 0.01) gd_144 = 0.02;
if (OrderProfit() < 0.0 && OrderComment() == \"SteadyWinner2\" && MarketInfo(Symbol(), MODE_MINLOT) == 0.01) gd_152 = 0;
if (gd_152 == 0.0 && MarketInfo(Symbol(), MODE_MINLOT) == 0.01) gd_144 = 0.01;
if (gd_144 < 0.01 && MarketInfo(Symbol(), MODE_MINLOT) == 0.01) gd_144 = 0.01;
if (gd_144 > 50.0 && MarketInfo(Symbol(), MODE_MINLOT) == 0.01) gd_144 = 50;
if (Month() == 12 && MarketInfo(Symbol(), MODE_MINLOT) == 0.01) gd_144 = 0.01;
if (OrderProfit() > 0.001 && OrderComment() == \"SteadyWinner2\" && MarketInfo(Symbol(), MODE_MINLOT) == 0.1) gd_152 = 1;
if (OrderProfit() == 0.0 && MarketInfo(Symbol(), MODE_MINLOT) == 0.1) gd_144 = 0.1;
if (OrderProfit() > 0.001 && MarketInfo(Symbol(), MODE_MINLOT) == 0.1) gd_144 = 0.2;
if (OrderProfit() < 0.0 && OrderComment() == \"SteadyWinner2\" && MarketInfo(Symbol(), MODE_MINLOT) == 0.1) gd_152 = 0;
if (gd_152 == 0.0 && MarketInfo(Symbol(), MODE_MINLOT) == 0.1) gd_144 = 0.1;
if (gd_144 < 0.1 && MarketInfo(Symbol(), MODE_MINLOT) == 0.1) gd_144 = 0.1;
if (gd_144 > 50.0 && MarketInfo(Symbol(), MODE_MINLOT) == 0.1) gd_144 = 50;
if (Month() == 12 && MarketInfo(Symbol(), MODE_MINLOT) == 0.1) gd_144 = 0.1;
if (OrderProfit() > 0.001 && OrderComment() == \"SteadyWinner2\" && MarketInfo(Symbol(), MODE_MINLOT) == 1.0) gd_152 = 1;
if (OrderProfit() == 0.0 && MarketInfo(Symbol(), MODE_MINLOT) == 1.0) gd_144 = 1.0;
if (OrderProfit() > 0.001 && MarketInfo(Symbol(), MODE_MINLOT) == 1.0) gd_144 = 2.0;
if (OrderProfit() < 0.0 && OrderComment() == \"SteadyWinner2\" && MarketInfo(Symbol(), MODE_MINLOT) == 1.0) gd_152 = 0;
if (gd_152 == 0.0 && MarketInfo(Symbol(), MODE_MINLOT) == 1.0) gd_144 = 1.0;
if (gd_144 < 0.1 && MarketInfo(Symbol(), MODE_MINLOT) == 1.0) gd_144 = 1.0;
if (gd_144 > 50.0 && MarketInfo(Symbol(), MODE_MINLOT) == 1.0) gd_144 = 50;
if (Month() == 12 && MarketInfo(Symbol(), MODE_MINLOT) == 1.0) gd_144 = 1.0;
if (AccountFreeMargin() < 1000.0) {
Print(\"We have no money. Free Margin = \" + AccountFreeMargin());
return (0);
}
bool li_308 = FALSE;
bool li_312 = FALSE;
bool li_316 = FALSE;
bool li_320 = FALSE;
li_308 = ld_276 > 0.0003 || ld_284 > 0.0003 && ld_140 < ld_124 && ld_148 < ld_124 && ld_156 < ld_124 && ld_164 < ld_124 && ld_172 < ld_124 && ld_12 < -99.999;
li_312 = ld_276 > 0.0003 || ld_284 > 0.0003 && ld_140 > ld_124 && ld_148 > ld_124 && ld_156 > ld_124 && ld_164 > ld_124 && ld_172 > ld_124 && ld_12 > -0.001;
li_316 = ld_276 > 0.0002 && (OrderMagicNumber() == 988889 && TimeCurrent() - OrderOpenTime() > 60) && ld_12 > -25.0 && ld_20 > -35.0 && ld_28 > -50.0;
li_320 = ld_276 > 0.0002 && (OrderMagicNumber() == 988889 && TimeCurrent() - OrderOpenTime() > 60) && ld_12 < -75.0 && ld_20 < -65.0 && ld_28 < -50.0;
if (!ExistPositions()) {
if (li_308) {
OpenBuy();
return (0);
}
if (li_312) {
OpenSell();
return (0);
}
}
if (ExistPositions()) {
if (OrderType() == OP_BUY) {
if (li_316) {
li_0 = OrderClose(OrderTicket(), OrderLots(), Bid, gi_160, gi_192);
if (!(li_0 && gi_176)) return (0);
PlaySound(gs_180);
return (0);
}
}
if (OrderType() == OP_SELL) {
if (li_320) {
li_4 = OrderClose(OrderTicket(), OrderLots(), Ask, gi_160, gi_200);
if (!(li_4 && gi_176)) return (0);
PlaySound(gs_180);
return (0);
}
}
}
if (gd_120 > 0.0 || gd_128 > 0.0) {
for (int li_324 = 0; li_324 < OrdersTotal(); li_324++) {
if (OrderSelect(li_324, SELECT_BY_POS, MODE_TRADES)) {
li_8 = TRUE;
if (OrderMagicNumber() != 988889 && 1) li_8 = FALSE;
if (OrderSymbol() == Symbol() && li_8) {
if (OrderType() == OP_BUY && gd_120 > 0.0) {
if (Bid - OrderOpenPrice() > gd_120 * gd_136)
if (OrderStopLoss() < Bid - gd_120 * gd_136) ModifyStopLoss(Bid - gd_120 * gd_136);
}
if (OrderType() == OP_SELL) {
if (OrderOpenPrice() - Ask > gd_128 * gd_136)
if (OrderStopLoss() > Ask + gd_128 * gd_136 || OrderStopLoss() == 0.0) ModifyStopLoss(Ask + gd_128 * gd_136);
}
}
}
}
}
return (0);
}

bool ExistPositions() {
bool li_0;
for (int li_4 = 0; li_4 < OrdersTotal(); li_4++) {
if (OrderSelect(li_4, SELECT_BY_POS, MODE_TRADES)) {
li_0 = TRUE;
if (OrderMagicNumber() != 988889 && 1) li_0 = FALSE;
if (OrderSymbol() == Symbol() && li_0) return (TRUE);
}
}
return (FALSE);
}

void ModifyStopLoss(double ad_0) {
bool li_8 = OrderModify(OrderTicket(), OrderOpenPrice(), ad_0, OrderTakeProfit(), 0, CLR_NONE);
if (li_8 && gi_176) PlaySound(gs_180);
}

void OpenBuy() {
double ld_0 = 0;
double ld_8 = 0;
if (gd_88 > 0.0) ld_0 = Bid - gd_88 * gd_136;
if (gd_104 > 0.0) ld_8 = Bid + gd_104 * gd_136;
int li_16 = OrderSend(Symbol(), OP_BUY, gd_144, Ask, gi_160, ld_0, ld_8, \"SteadyWinner2\", 988889, 0, gi_188);
if (li_16 > -1 && gi_176) PlaySound(gs_180);
}

void OpenSell() {
double ld_0 = 0;
double ld_8 = 0;
if (gd_96 > 0.0) ld_0 = Ask + gd_96 * gd_136;
if (gd_112 > 0.0) ld_8 = Ask - gd_112 * gd_136;
int li_16 = OrderSend(Symbol(), OP_SELL, gd_144, Bid, gi_160, ld_0, ld_8, \"SteadyWinner2\", 988889, 0, gi_196);
if (li_16 > -1 && gi_176) PlaySound(gs_180);
}


xuehui xuehui 2012-12-12 14:49
复盘中,仓位小不开单, 用大点的仓复盘,自能下0.01或0.02,不能有最大的复利,老大帮忙看看对仓位的限制和开仓单量的限制在哪改动,谢谢。
myeatrade myeatrade 2012-12-12 20:08
请用附件上传,我们论坛会对一些字符做特殊处理,上面代码已经无法编译和使用
xuehui xuehui 2012-12-13 00:06
版主费心了,谢谢!
附件: 欧元 稳定ea~.mq4
myeatrade myeatrade 2012-12-13 19:22
已修改,增加可设置参数lots,可以进行修改手数
附件: 欧元 稳定ea modify.mq4
xuehui xuehui 2012-12-13 20:06
老大,仓位小于10000还是不开仓,仓量倒是能改了,仓位限制还是没去掉,这个EA我复盘却是能稳定盈利,但不是很暴力,
我好不容易碰到一个,就麻烦老大在帮忙改改,我一定在别的论坛多多推广咱们网站,谢谢老大!
myeatrade myeatrade 2012-12-14 00:11
仓位小于10000还是不开仓? 是什么意思,上面修改过的,下单的手数已经有参数可以自己调整了
xuehui xuehui 2012-12-14 00:39
就是作者搞得两个限制,下一个是仓最小10000,开仓只有0.02,这样就只能复盘测试,实盘就没什么意义了。
myeatrade myeatrade 2012-12-14 11:03
已经添加了lots参数,可以自由更改下仓手数的
xuehui xuehui 2012-12-14 17:14
是仓位的大小,是说最小10000的仓才开单,10000美金以下的仓不开单。
Page 1 of 2 1 2

请登录后发表回复,如果你还没有账户你可以 免费注册

回到 通常讨论
menu image pre-loadermenu image pre-loadermenu image pre-loadermenu image pre-loadermenu image pre-loadermenu image pre-loadermenu image pre-loader