My variable loses significance in the operator where.

 

Here's a where. Lower "Print" prints "1.loss 1" and the upper 0 . Who can help ...

while(1)
  {
   Print(" 1.loss ",loss,
  " profit ",profit);
.......................
.......................
       if(profit>0)
          {
           loss=0;
          }
        else
          {
           loss++;
          }
        Print(" ");
       Print(" Ord: ",OrderTicket(),
             " profit: ",profit,
             " comment: ",OrderComment(),
             " loss ",loss);
       }
 
reuvenb: .Who can help ...

  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. No one can because there are no mind readers here:
    • You don't show all the code. We have no idea what the data type of profit and loss is, or whether you initialized them and to what. We have no idea whether you selected an order before using OrderTicket and OrderComment.
    • We have no idea why you're in an infinite loop.
    • We have no idea what your problem is because "upper 0" is meaningless and you don't state what you wanted and what it does.
Reason: