for(int Q=0;Q<2500;Q++){ ObjectDelete("ZonaUp1"); }
Why are you deleting it 2500 times? Once is enoughfor(i=0;i<=5;i++){ Buffer1[i]=High[5]; Buffer2[i]=Low [5];
What use are those two buffers? They contain constants.for(i=0;i<=5;i++){ ObjectCreate("ZonaUp1",OBJ_RECTANGLE, 0, Time[0], High[5], Time[5], Low[5]);
Why are you creating it in a loop. You can only create one with the same name?- Create it in OnInit. Move it after your loop. Once per tick.
Gate 2500 times to be sure to remove all objects created in the chart, I entered the buffer for future use. I entered the rectangle in the loop to make it move along with Buffer.
I did not understand what I should do in OnInit ???
I did not understand what I should do in OnInit ???
string name="ZonaUp1"; ObjectSetDouble(0,name,OBJPROP_PRICE,0,High[5]); // set first price ObjectSetDouble(0,name,OBJPROP_PRICE,1,Low[5]); // set second price ObjectSetInteger(0,name,OBJPROP_TIME,0,Time[0]); // set first time ObjectSetInteger(0,name,OBJPROP_TIME,1,Time[5]); // set second time
Marco vd Heijden:
That's right, the problem is precisely the object update instead of elminarlo every tick I want to update the way that the rectangle follow the Buffer
Also you can use
Function but it's not advisable to delete and create all or many objects over and over on each tick since that seemed to be the issue.
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 created a simple rectangle with 2 buffer and I would like to move the object along with the buffer, with each tick i delede and recreate the object, but I do not think is correct, there is a right way?