Why can't YOU code it?
void deleteDCC(){ for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){ string on = ObjectName(iObj); if(StringFind(on, "DCC") == 0) ObjectDelete(on); } }
Was that SO hard?
Or a general solution from my code
#define ONDA_BEGINS 0 #define ONDA_CONTAINS 1 void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY){ for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){ string on = ObjectName(iObj); if(type != EMPTY) if(ObjectType(on) != type) continue; if(name != ""){ int iPos = StringFind(on, name); if (iPos < 0) continue; if (iPos > 0 && where == ONDA_BEGINS) continue; } ObjectDelete(on); } }
all i know is to open it in metaeditor, delete some things, change colors, some values, compile, and test if it's ok.
can u tell me where exactly to put this first code? in this section
- int deinit() { ?
or somewhere else?
again thnx man!
ok, i figured it out in a few times.
now it look like this and it's working for DCC.
it's good. it dont delete text on chart and delete DCC when change timeframe. it's not a mess anymore.
but i have "engulf" "pierc" and "englf" to add in code. now i m asking what parametar i should change to add these three?
int deinit() { {for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){ string on = ObjectName(iObj); if(StringFind(on, "DCC") == 0) ObjectDelete(on); } }
i add new sentence with "Pierc" and it pass compile,
but did not erase "pierc" from chart. it stay after change TF.
int deinit() { {for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){ string on = ObjectName(iObj); if(StringFind(on, "DCC") == 0) ObjectDelete(on); if(StringFind(on, "Pierc") == 0) ObjectDelete(on); } }then make copy of whole code with "pierc"
and bunch of errors show.
its important to me to text object stay on chart with this indicator, because i learn to trade with no EA-s. i using elliott wave, previous high and low, pivots etc... so this is the reason
why i need text on chart.
so if i bothering you with my ignorance about coding, (i know this is wrong forum for me) it's ok, i will understand if i see no answer from you.
as you say: learn or pay.
int deinit() { {for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){ string on = ObjectName(iObj); if(StringFind(on, "DCC") == 0) ObjectDelete(on); } } {for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){ string on = ObjectName(iObj); if(StringFind(on, "Pierc") == 0) ObjectDelete(on);
i add new sentence with "Pierc" and it pass compile,
but did not erase "pierc" from chart. it stay after change TF.
if(StringFind(on, "DCC") == 0) ObjectDelete(on); if(StringFind(on, "Pierc") == 0) ObjectDelete(on);then make copy of whole code with "pierc"
and bunch of errors show.
int deinit() { : } // Deinit ends here. {for // This code is not in a function - error
- but i have "engulf" "pierc" and "englf" toBut you didn't try to delete "pierc" you tried to delete "Pierc". And according to your image you don't have "englf" either.
- Of course
it's working, this is the code, as you wrote to me:
int deinit() { {for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){ string on = ObjectName(iObj); if(StringFind(on, "PrcLn") == 0) ObjectDelete(on); if(StringFind(on, "DCC") == 0) ObjectDelete(on); if(StringFind(on, "Engulf") == 0) ObjectDelete(on); if(StringFind(on, "Engul") == 0) ObjectDelete(on); } } return(0);
i made some mistakes before, while edited some words in metaeditor, but now is perfect.
thanx! i wouldn't do it without your help.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi,
i have indicator candlestick pattern, and it works ok with my modifications about some patterns in it.
problem is when changing TF it delete text i entered on chart. not label text. i know this is because of this code : ObjectsDeleteAll(0, OBJ_TEXT);
when i put this code - ObjectDelete("text_object"); and change TF, my text stays on chart, that's good, but also stays text from indicator!! and become a mess, as seen on picture.
for example i want to text "DCC" or "Engulf"- from indicator, be deleted when i change TF, so i put this code- ObjectDelete("text_DCC"); compile, -and nothing. it stays on chart when changeTF. when i open object list (Ctrl+B) i see that every text "DCC" or "Engulf"on chart have much different numbers after, as seen on picture.
i try with ObjectDelete("text_DCC*");
or ObjectDelete("text_DCC+");
and still nothing after compiling. is there any code who will delete DCC + numbers after text?