Pending Orders "LOT SIZE" on chart coments

 

I can't seem to get the chart comments to respond to what the pending orders lot sizes are.
Any idea what I could be doing wrong?
Thanks for the help.

Here is my code:

   double pendLotshort,pendLotlong;
 
 
   pendLotshort =0;
   pendLotlong =0;
 
   for(i = totalorders-1;i>= 0;i--)
     { OrderSelect(i, SELECT_BY_POS);
       if ( OrderSymbol()==Symbol() ) 
         {  if ( OrderType() == OP_BUYSTOP )  {pendLotlong = pendLotlong+ OrderLots();}
           if ( OrderType() == OP_SELLSTOP )  {pendLotshort = pendLotshort+OrderLots();}
         } 
      }



Reason: