Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 434
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
Please tell me how to delete a graphical object. There are vertical lines whose names are constructed from variable values.
string name=="test1"; string Vertline="line_"+name; ObjectCreate(0,VertLine,OBJ_VLINE,0,time,cena); How can I delete only vertical lines with the name test1?
You may find this function useful:
Deletes all objects of the specified type by the name prefix in a subwindow.
intObjectsDeleteAll(
longchart_id,// chart ID
const stringprefix,// object name prefix
intsub_window=EMPTY,// index of the window
intobject_type=EMPTY//type of object to be deleted
);
you may find this function useful:
Deletes all objects of the specified type by the name prefix in the chart subwindow.
intObjectsDeleteAll(
longchart_id,//chart identifier
const stringprefix,// prefixobject name
intsub_window=EMPTY,// window index
intobject_type=EMPTY// object type to remove
);
Thanks, as far as I understand this function understands the prefix as the first substring in the object name, but how to delete by the second substring in the object name? Is there any way to use StringSubstr and StringFind to the object name for this purpose?
Thanks, as far as I understand, by prefix this function understands the first substring in the object name, but how to delete by the second substring in the object name? Is there any way to use StringSubstr and StringFind to the object name for this purpose?
wait,
You have specified the code:
Where you have the prefix.
That's what everyone does.
That's why I suggested you the function to delete objects by prefix.
"линия_"
If you need to delete a line by suffix, you canuse StringFind to search for all objects
for example:
Thank you Vladislav, everything works, with such help from forum members, MQL is much more interesting. Interesting site you have, thank you!
Hello. Please help me to find out why it stops trawling after positions appear.
The point is this: open two positions 1, 2. at one price the first is closed by trawl, the second trawl is activated on the condition that at the opening price of the position, the position is one.
Everything works fine, position 1 is closed, position 2 is trawled, but when two more positions 3 and 4 open at differing prices, the trawl does not move on to position 2.
Why does it stop trawling?
Hello. Please help me to find out why it stops trawling after positions appear.
The point is this: open two positions 1, 2. at one price the first is closed by trawl, the second trawl is activated on the condition that at the opening price of the position, the position is one.
Everything works fine, position 1 is closed, position 2 is trawled, but when two more positions 3 and 4 open at differing prices, the trawl does not move on to position 2.
Why does it stop trawling?
I would only point out a gross error.
You go through the orders and then run the function counting the number of positions, thereby selecting another position in theNumPosByPrice function
so the further construction
will not work correctly.
there are many ways to solve this.
For example:
Although this is fundamentally wrong, it will do for a quick understanding.
after:
add :
I'll just point out the gross error.
There are many ways to solve this.
Thank you, I see, trawl)
Can you please tell me how to reopen the alerts window in mt4? I used to have a script that created a fake signal and opened the alerts window, now after reinstalling the system I can't find it on the internet. Maybe someone has one?
Can you please tell me how to reopen the alerts window in mt4? I used to have a script that created a fake signal and opened the alerts window, now after reinstalling the system I can't find it on the internet. Maybe someone has one?
Alert(""); such a script?
Looks like it. Do you have a way of attaching it here?