编码帮助 - 页 421

 
mrtools:
NWFstudent 如果alertsonCurrent=false,它还会在开盘时报警吗?

哦,我确定那是指对当前的一对进行警告。还没有试过,今天会试一下。

谢谢

 
Su407:
亲爱的Meta Coder

我可以在这里提出一个请求吗?(如果错了地方,请原谅)

我想麻烦你把这两个指标的垂直线混合在一起,并且每小时增加一条可以改变颜色和风格的垂直线。(如附图中的黄线,这是我手动画的)。

感谢你的大力帮助。

谢谢你的帮助,感谢你的时间奉献。

最好的问候

苏407

根据我的经验,把这样的任务分开来做几乎总是更好的。这样你就可以有更多的组合和更容易使用的指标(更少的参数--有时参数太多,就很难找到某些参数的作用)。

 
mladen:
Su407 根据我的经验,把这样的任务分开几乎总是更好的。这样你就可以有更多的组合和更容易使用的指标(更少的参数--有时当有太多的参数时,很难找到一些参数的作用)。

谢谢你的建议mladen。

你有单独的小时垂直线 的指标吗?

 

hello house....

我希望有人能帮助我,我一直在使用下面所附的EA,尤其是在Demo上。我对这个EA进行了编码,使其总是最多进行5次交易,但尽管我对代码进行了编辑和修正,这个EA仍将继续进行超过所述数量的交易......请帮助我。谁能真正告诉我这个EA的问题所在

附加的文件:
 

嗨,MQL Pro-Coders。

我想知道是否有人可以帮助我。我正在围绕 "Hull moving average 2 strict nmc "指标开发一个EA。

我发现只有参数"3"(趋势)在第三根蜡烛形成后才起作用,是否有可能

能否将第二根蜡烛也作为信号蜡烛?

能否在HMA速度参数中设置信号蜡烛?

extern string TimeFrame = "Current time frame";

extern int HMAPeriod = 35;

extern int HMAPrice = PRICE_CLOSE;

extern double HMASpeed = 2.0;

extern bool alertsOn = false;

extern bool alertsOnCurrent = true;

extern bool alertsMessage = true;

extern bool alertsSound = false;

extern bool alertsEmail = false;

[/CODE]

CODE to open the trades:

I want also implement an "just one trade per running trend function" to avoid the system open trades

after the profit target was reached on the current trend, because the trend may change afterwards.

Could a coder please review my code?

[CODE]

extern double maxshorttrades = 1;

extern double maxlongtrades = 1;

extern int HMA_Period=21;

extern int HMA_Price=0; //PRICE_CLOSE;

extern double HMA_Speed= 2;

//+----------------------------------------------------------------+

//| ORDER Logic / Indicators |

//+----------------------------------------------------------------+

if(openedOrders<=0)

{

double CCIFilter = iCCI(NULL,0,CCIPeriod,CCIMethod,0);

double trendc = iCustom(Symbol(),0,"Hull moving average 2 strict nmc", "", HMA_Period, HMA_Price, HMA_Speed,0,3,1); // 3 is working 2 is not 1 is not

double trendp = iCustom(Symbol(),0,"Hull moving average 2 strict nmc", "", HMA_Period, HMA_Price, HMA_Speed,0,3,2); // 3 is working 2 is not 1 is not

//+-----------------------------------------------------------------+

//| BUY |

//+-----------------------------------------------------------------+

for (i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_BUY && OP_BUY<maxlongtrades) break; // Check Traded Positions.

{

if(trendc!=trendp)

{

if(trendc==1 && (CCIFilter<50)) // code for buy

OpenBuy();

return(0);

}

openedOrders++;

}

//+----------------------------------------------------------------+

//| SELL |

//+----------------------------------------------------------------+

for (i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_SELL && OP_SELL<maxshorttrades) break; // Check Traded Positions.

{

if(trendc==-1 && (CCIFilter>50)) // code for sell

{

OpenSell();

return(0);

}

openedOrders++;

}

}

谢谢您的建议。

谨此致意。

TFI

 
tfi_markets:
嗨,MQL Pro-Codeers。

我想知道是否有人能帮助我。我正在围绕 "Hull moving average 2 strict nmc "指标开发一个EA。

我发现只有参数 "3"(趋势)在第三根蜡烛形成后才起作用,是否有可能

能否将第二根蜡烛也作为信号蜡烛?

信号蜡烛可以在HMA速度参数中设置吗?

extern string TimeFrame = "Current time frame";

extern int HMAPeriod = 35;

extern int HMAPrice = PRICE_CLOSE;

extern double HMASpeed = 2.0;

extern bool alertsOn = false;

extern bool alertsOnCurrent = true;

extern bool alertsMessage = true;

extern bool alertsSound = false;

extern bool alertsEmail = false;

[/CODE]

CODE to open the trades:

I want also implement an "just one trade per running trend function" to avoid the system open trades

after the profit target was reached on the current trend, because the trend may change afterwards.

Could a coder please review my code?

[CODE]

extern double maxshorttrades = 1;

extern double maxlongtrades = 1;

extern int HMA_Period=21;

extern int HMA_Price=0; //PRICE_CLOSE;

extern double HMA_Speed= 2;

//+----------------------------------------------------------------+

//| ORDER Logic / Indicators |

//+----------------------------------------------------------------+

if(openedOrders<=0)

{

double CCIFilter = iCCI(NULL,0,CCIPeriod,CCIMethod,0);

double trendc = iCustom(Symbol(),0,"Hull moving average 2 strict nmc", "", HMA_Period, HMA_Price, HMA_Speed,0,3,1); // 3 is working 2 is not 1 is not

double trendp = iCustom(Symbol(),0,"Hull moving average 2 strict nmc", "", HMA_Period, HMA_Price, HMA_Speed,0,3,2); // 3 is working 2 is not 1 is not

//+-----------------------------------------------------------------+

//| BUY |

//+-----------------------------------------------------------------+

for (i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_BUY && OP_BUY<maxlongtrades) break; // Check Traded Positions.

{

if(trendc!=trendp)

{

if(trendc==1 && (CCIFilter<50)) // code for buy

OpenBuy();

return(0);

}

openedOrders++;

}

//+----------------------------------------------------------------+

//| SELL |

//+----------------------------------------------------------------+

for (i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_SELL && OP_SELL<maxshorttrades) break; // Check Traded Positions.

{

if(trendc==-1 && (CCIFilter>50)) // code for sell

{

OpenSell();

return(0);

}

openedOrders++;

}

}

谢谢您的建议。

谨此致意。

TFI

TFI

缓冲区3是正确的(即 "趋势 "缓冲区,其值为1表示向上倾斜,-1表示向下倾斜)。你使用的是移位1和移位2,因此它测试的是第一个闭合的柱子。

购买部分的代码是正确的。

你漏掉了

if(trendc!=trendp)

这可能会给你带来问题。

 

嗨,Mladen,

几个月前,您为我创建了这个用于MT5的CARBON指标,该指标显示与SMA15的距离(%)。

现在,请您创建同样的指标,但以点为单位显示距离?

谢谢

p.s.抱歉,今天我在这个论坛上传有困难.....,我不能打开MT5论坛会话.....,如果你有碳。好的。否则我以后会试着上传。

最后我在MT5会议上写道:.....,对这个帖子感到抱歉。

 

你好,Mladen...

我希望有人能帮助我,我一直在使用下面所附的EA,特别是在Demo上。我对这个EA进行了编码,使其总是最多进行5次交易,但尽管我对代码进行了编辑和修正,这个EA仍会继续进行超过规定数量的交易......请帮助我,谁能真正告诉我这个EA的问题所在

附加的文件:
 
Mastercash:
你好,Mladen......我希望有人能帮助我,我一直在使用下面附上的EA,尤其是在Demo上。我对这个EA进行了编码,使其总是最多进行5次交易,但尽管我对代码进行了编辑和修正,这个EA仍会继续进行超过规定数量的交易......请帮助我,谁能真正告诉我这个EA的问题所在

你是否尝试将Lotsparameter 设置为5,UseMoneyManagement 设置为false?

 

我将使用资金管理设置为false....,但关于Lots参数,它不是关于Lots,而是关于未结订单的数量。我不希望EA在给定时间内开出超过5个订单......,这就是为什么我在输入参数上将NumberofTrades参数设置为5,但它仍然敢于我,并采取超过5个订单,从而威胁到我的资金管理!

mladen:
你是否尝试将Lotsparameter 设置为5,UseMoneyManagement 设置为false?
原因: