Concatenate(add) all comments to a string, then output that comment
The above can also be performed with stringconcatenate() function. Look it up in the reference guide.
string display =""; if (close > high1){ display+= "UPWARD "; }else{ display+="NOT UPWARD "; } if (close < low1){ display+="DOWNWARD"; }else{ display+="NOT DOWNWARD"; } Comment( display );
Rami Khattab #:
it worked thank you very much ;)
one more question if possible, the comments are shown in the same line,ex: UPWARD NOT DOWNARD
Can i show them on vertical line,ex : UPWARD
NOT DOWNARD
Sure, use "\n" == New line. Google escape sequences for better understanding.
// Therefore having something like display += "UPWARDS \n";
William Roeder #:
Simplified | string display = (close > high1 ? "UPWARD " : "NOT UPWARD ") + close < low1 ? "DOWNWARD" : "NOT DOWNWARD"; Comment( display ); |
nice simplification, but I feel it is easier for someone with some experience, the OP, registered not quite long

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
HELLO,
IM LEARNING MQL5, BELOW IS SIMPLE SCRIPT THAT SHOWS IF CANDLE (1) CLOSE {ABOVE/BELOW} THE {HIGH/LOW} OF CANDLE(2).
HOWEVER IT IS SHOWING ONLY ONE COMMENT ON CHART, IT IS SUPPOSED TO COMMENT 2 ORDERS.
MUCH APPRECIATED FOR ANYHELP :)