I am trying to draw vertical lines or a single line rectangle at any given bar and I want to display different colors for different conditions. But all vertical line or rectangle is appearing in single color i.e Blue.
The code used to draaw is below, can anyone suggest why it is not showing desired color
if (!ObjectCreate(0,"TP"+seq,OBJ_RECTANGLE,0,StrToTime(from_chart_time),0,Time[limit-bar+1],2)) { ObjectDelete(0,"TP");
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I am trying to draw vertical lines or a single line rectangle at any given bar and I want to display different colors for different conditions. But all vertical line or rectangle is appearing in single color i.e Blue.
The code used to draaw is below, can anyone suggest why it is not showing desired color
if (!ObjectCreate(0,"TP"+seq,OBJ_RECTANGLE,0,StrToTime(from_chart_time),0,Time[limit-bar+1],2))
{
ObjectDelete(0,"TP");
ObjectCreate(0,"TP",OBJ_RECTANGLE,0,StrToTime(from_chart_time),0,Time[limit-bar+1],1000);
ObjectSetInteger(0,"TP",OBJPROP_FILL,true);
ObjectSetInteger(0,"TP",OBJPROP_COLOR,clrYellow);
ObjectSetInteger(0,"TP",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(0,"TP",OBJPROP_WIDTH,2);
ObjectSetInteger(0,"TP",OBJPROP_BACK,true);
}
else
{
ObjectSetInteger(0,"TP"+seq+bar_label,OBJPROP_FILL,true);
ObjectSetInteger(0,"TP"+seq+bar_label,OBJPROP_COLOR,clrYellow);
ObjectSetInteger(0,"TP"+seq+bar_label,OBJPROP_STYLE,STYLE_DASH);
ObjectSetInteger(0,"TP"+seq+bar_label,OBJPROP_WIDTH,2);
}