請教Mql語言的問題,請幫忙糾正錯誤

 

各位好,小弟想請教一下以下的程序是否有錯誤呢 ?

最後的total++; 我不太懂,因為前面沒有定義total的函式和範圍,請問它要做什麼樣的++呢?


int ordercount()                        // we counting our order here

{

   int total=0;                         // total of our order 

   int i;                               // pos of our order 

   for(i=0; i<OrdersTotal(); i++)       // looping to count our order 

                                        // from pos 0 until last pos

   {

       OrderSelect(i,SELECT_BY_POS,MODE_TRADES);  // is it right our order?

       if(OrderSymbol()!=Symbol() ||    // if symbol of order didn't match 

       OrderMagicNumber()!=MagicNumber) // with current chart symbol 

       continue;                        // or the magic numb of order 

                                        // didn't match with our magic

                                        // number, don't count it

       total++;                         // count if all criteria matched

   }

   return(total);                       // this function returned total of

                                        // our opened order 

原因: