[求助]平保的ea不会自动执行
各位大神麻烦看看下面的ea,在写完平保的指令之后,根本不会执行,在图表中能正常下单,止盈止损都没有问题,就是不会自动设置平保,而且没有任何反应是为什么?
int start()
{
//---检查Ma的状态,可以用void
if (IsNewCandle()) CheckForMaTrade();
if (UseMoveToBreakeven) MoveToBreakeven();
return(0);
}
//+-------------------------------------------------- ----------------+
void MoveToBreakeven()
{
for(int b=OrdersTotal()-1; b >=0; b--)
{
if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES))
if(OrderMagicNumber()== MagicNumber)//continue means run another function of the for loop,if "break", it will stop
//if(!OrderSelect(b,SELECT_BY_POS,MODE_TRADES)||OrderMagicNumber()!=MagicNumber||OrderType()!=OP_BUY)continue;
if(OrderSymbol()==Symbol())
if(OrderType()==OP_BUY)
if(Bid-OrderOpenPrice()>WhenToMoveToBE)
if(OrderOpenPrice()>OrderStopLoss())
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+PipsToLockIn,OrderTakeProfit(),0,Red);///结束的地方要加分号
}
for(int s=OrdersTotal()-1; s >=0; s--)
{
if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES))
if(OrderMagicNumber()==MagicNumber)
if(OrderSymbol()==Symbol())
if(OrderType()==OP_SELL)
if(OrderOpenPrice()-Ask>WhenToMoveToBE*pips)
if(OrderOpenPrice()CurrentSlow)OrderEntry(0);
if(PreviouseFast>PreviousSlow && CurrentFast