EA邦程序化交易论坛
标题:
单根K线开仓或报警一次的问题,大神有请!!!!!
[打印本页]
作者:
leoleozhao
时间:
2022-1-16 18:16
标题:
单根K线开仓或报警一次的问题,大神有请!!!!!
单根K线开仓或报警一次的问题,大神有请!!!!!
int bar=0;
void OnTick(void)
{
if(Bars<100)
{
Print("bars less than 100");
return;
}
if(bar==Bars)
{
return;
}
if(bar!=Bars)
{
if(金叉)
{
SendNotification(Symbol()+": 金叉 !!!");
SendMail(Symbol(),": 金叉!!!");
bar= Bars;
}
return;
if(死叉)
{
SendNotification(Symbol()+": 死叉 !!!");
SendMail(Symbol(),": 死叉 !!!");
bar= Bars;
}
return;
}
total=OrdersTotal();
//--- it is important to enter the market correctly, but it is more important to exit it correctly...
for(cnt=0;cnt<total;cnt++)
{
平多仓
平空仓
}
}
作者:
leoleozhao
时间:
2022-1-16 18:17
上面自己编的,但是不会报警。。。?请大神指教!!!
作者:
唐老师
时间:
2022-1-18 17:43
SendMail和SendNotification都需要设置客户端,可以看我之前写过的文章,在ea学院栏目里,关于邮件报警的。
至于其它的,你的代码不完整,而且我们不是专业教编程的,就不好说了。
欢迎光临 EA邦程序化交易论坛 (https://www.eabang.com/bbs/)
Powered by Discuz! X3.5