Comment not working

 

Hi all,

I'm looking to get in comment the value of TotalOrderProfit from the code following code, but it doesn't work.

 

string SettingsComment = "Profit Protected: "+TotalOrderProfit;
  Comment(SettingsComment); 

 

void EAOrderProfit()
       {//0
        int TotalOrders;
        TotalOrderProfit = 0;       
               
        for(int Orders = OrdersTotal()-1; Orders >= 0; Orders--)       
          {//1
          if(!OrderSelect(Orders,SELECT_BY_POS,MODE_TRADES))continue;
            {//2
            if(OrderSymbol() == Symbol()&& OrderMagicNumber() == MagicNumber)            
              {//3
               TotalOrders++;
               TotalOrderProfit += OrderProfit() + OrderCommission() + OrderSwap();                                       
              }//3          
            }//2
          }//1                                             
        if(TotalOrderProfit>= MinimumProfit*pips2dbl)StartToProtect();                        
       }//0 

Is that possible to get from you some help ?

Thank you in advance for any support provided.

Luis 

 
luisneves: but it doesn't work.
  1. "it doesn't work" is meaningless to us. We are not mind readers.
  2. Print your TotalOrderProfit when you calculate it and your comment string and find out why.
Reason: