单根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++)
{
平多仓
平空仓
}
}
|