Pouring the object - page 3

 
5211845:
I got it. Are you there?

continue

 
this is the function you told me it worked. I added it
ObjectSetInteger(0,Name,OBJPROP_BACK,back);

I put false instead of back and it worked.

P.S.

This documentation is a kind of "Rebus", you constantly have to guess and search for something. No comments, no explanations.

How was I supposed to understand that function OBJPROP_BACK ??????? should be used together with function OBJPROP_FILL?

 

ok

Never mind, webmasters have a lot of work to do.

Your question will still be read and polished over time
 

Thank you Renat!

This code worked:

#property indicator_chart_window

int start()
{
long current_chart_id=ChartID();
string obj_name1="Rectangle1";

double Price_Level_1 = 1296;
double Price_Level_2 = 1293;

datetime Left_Side_1 = Time[9];
datetime Right_Side_1 = Time[0] + PeriodSeconds() * 7;

color clr = clrRed;
ENUM_LINE_STYLE style = STYLE_SOLID;
int width = 2;
bool fill = false;

ObjectCreate (current_chart_id, obj_name1, OBJ_RECTANGLE, 0, Left_Side_1, Price_Level_1, Right_Side_1, Price_Level_2);


ObjectSetInteger (current_chart_id, obj_name1, OBJPROP_COLOR, clr);
ObjectSetInteger (current_chart_id, obj_name1, OBJPROP_STYLE, style);
ObjectSetInteger (current_chart_id, obj_name1, OBJPROP_WIDTH, width);
ObjectSetInteger (current_chart_id,obj_name1,OBJPROP_BACK,false); // WITHOUT THIS STROKE THE FILL IS NOT REACTIVE
ObjectSetInteger (current_chart_id,obj_name1,OBJPROP_FILL,fill);


return(0);
}

 
You're welcome!
 
Renat Akhtyamov:

Agreed

first find

but if the object is deleted and recreated on every tick with the same name, searching for a known object is redundant
It is redundant to recreate on every tick.
 
Artyom Trishkin:
It's unnecessary to recreate on every tick.
Right again. It all depends on the algorithm that calls the function...
 
Renat Akhtyamov:
Right again. It all depends on the algorithm.
You originally suggested an algorithm with re-creation. This is unnecessary.
No more than that.
 
Artyom Trishkin:
You originally suggested an algorithm with a re-creation. That's redundant.
No more than that.

Let's put it this way.

My profits are not affected by your comment to me and let's leave it at that.

 
Renat Akhtyamov:

Let's put it this way.

My profits are not affected by your comment to me and let's leave it at that.

Your hints to a beginner with a sub-optimal algorithm for constantly deleting and creating an object only hurt him. And it is his "profit" that suffers from it.
That's what gave me the right to correct you. No more.
Reason: