Adding multiple comments
string display =""; if (close > high1){ display+= "UPWARD "; }else{ display+="NOT UPWARD "; } if (close < low1){ display+="DOWNWARD"; }else{ display+="NOT DOWNWARD"; } Comment( display );
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";
| 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
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 :)