Assuming I have created a lot of objects on the chart...
so I decided to delete all objects,
how do i use the ObjectsDeleteAll function??
I'm learning to program, if anyone can give me a tip, I'll be very happy...thanks
Before asking you could search here for "delete all objects" - I get ~1340 results and most of them will answer your question.
int ObjectsDeleteAll ( long chart_id, int sub_window = - 1 , int type = - 1 );
in case you didn't understand my question was how to use this function in my code
since I still don't know exactly how it works
Assuming I have created a lot of objects on the chart...
so I decided to delete all objects,
how do i use the ObjectsDeleteAll function??
I'm learning to program, if anyone can give me a tip, I'll be very happy...thanks
int OnInit() { //--- ObjectsDeleteAll(0,-1,-1); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- datetime itime[ 2 ]; itime[ 0 ]= iTime ( _Symbol , PERIOD_M15 , 0 ); itime[ 1 ]= TimeCurrent (); string name= "open"+string(TimeCurrent ()) ; double iprice; iprice= iOpen ( _Symbol , PERIOD_M15 , 0 ); if(ObjectFind(0,name)<0) ObjectCreate ( _Symbol ,name, OBJ_TREND , 0 ,itime[ 0 ],iprice,itime[ 1 ],iprice); name= "high"+string(TimeCurrent ()) ; iprice= iHigh ( _Symbol , PERIOD_M15 , 0 ); if(ObjectFind(0,name)<0) ObjectCreate ( _Symbol ,name, OBJ_TREND , 0 ,itime[ 0 ],iprice,itime[ 1 ],iprice); name= "low"+string(TimeCurrent ()) ; iprice= iLow ( _Symbol , PERIOD_M15 , 1 ); if(ObjectFind(0,name)<0) ObjectCreate ( _Symbol ,name, OBJ_TREND , 0 ,itime[ 0 ],iprice,itime[ 1 ],iprice); }
in case you didn't understand my question was how to use this function in my code
since I still don't know exactly how it works
So you need to learn how to read a Language Documentation.
It is pretty clear: DELETE ALL OBJECTS.
And you optionally may choose which type of objects would you like to delete. It's that it! Plain and simple.
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Assuming I have created a lot of objects on the chart...
so I decided to delete all objects,
how do i use the ObjectsDeleteAll function??
I'm learning to program, if anyone can give me a tip, I'll be very happy...thanks