adding comments to code/orders?

 
How do I make an EA give comments so that I know how the trade was closed? (like if it was from trading condition 1, 2, 3, etc, which you coded.)
 
1mathboy1:
How do I make an EA give comments so that I know how the trade was closed? (like if it was from trading condition 1, 2, 3, etc, which you coded.)

Use the Print command to tell you what you wanted below each closing condition.
if(condition1)
 {OrderClose(...);
  Print("Closed by ",condition1);
 }

if(condition2)
 {OrderClose(...);
  Print("Closed by ",condition2);
 }

... rest of EA ...
In all fairness there may be other ways to do this, but this is what I use in my own EAs.  Hope this helps.
Reason: