Open Forex4you Account

Server รัน EA 1000 / ปี

สั่งชื้อคู่มือการโปรแรกม MQL4

Author Topic: compilewไม่ผ่าน"return' - expressions are not allowed on a global scope"  (Read 7089 times)

peach

  • Newbie
  • *
  • Posts: 1
compilewไม่ผ่าน"return' - expressions are not allowed on a global scope"
« on: กุมภาพันธ์ 07, 2017, 06:02:32 pm »
compilewไม่ผ่าน"return' - expressions are not allowed on a global scope" ไม่รู้แก้ยังไงครับ


int CountOrder(int type){
   
     int CntOrder=0;
      for(int i= 0 ;<OrdersTotal();i++;
       OrderSelect(i,SELECT_BY_POS,MODE_TRADE);
       if(OrderType()== type && OrderMagicNumber() == MagicNumber){
         if(OrderSymbol() == Symbol()){
            CntOrder++;
            }
           
           }
        }
         
  return(CntOrder);
           

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 2386
Re: compilewไม่ผ่าน"return' - expressions are not allowed on a global scope"
« Reply #1 on: กุมภาพันธ์ 08, 2017, 03:10:03 pm »
return มันอยู่นอก เครื่องหมาย }