Update: the chart must always be one rectangle and one vertical line?
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
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);
}