Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 757

 
Youri Lazurenko:

..... all orders will close at the same time (this has never failed yet).

I wrote a warning because I had such a failure in my practice... A grid of 20 or so orders was half-closed and the robot kept adding more orders according to the built-in logic. In the end, as far as I remember, the robot added a security element that checked if there was anything left in the market after the SL/TP.

As they say, forewarned is forearmed. I didn't mean to preach, I wrote purely with the best of intentions.

If you want an idea, then here is the "secret" technique: instead of TP/SL, put a pending order so that when it triggers, the grid is fully locked. And then use CloseBy() to close it at any time (you can add a check that the spread is not larger than ... ).

 
Artyom Trishkin:
Type mql4.com in the address bar. What do you get?

Well, I've already repented, so why push me? :)


 
Youri Lazurenko:

I will answer you andIgor Zakharov at the same time.

In my opinion, it is more risky to close programmatically - at the moment when you can close by default, there may be no internet, communication and light. With TP and SL set up in advance, the above reasons are not significant.

"Ifyou set TP and SL at the same price, yes. If we set a SL taking into account the spread - TP+spread for buying, TP+spread for selling (due to the difference inBid/Ask closing), all orders will close at the same time (no problems with that yet).

Oh Yuri... How misguided you are. Do not forget that the spread is mostly floating and to close the Sell on Stop is enough to move Ask without touching the Bid or to close the Buy by moving Bid without touching Ask the excuse has been prepared in advance, "This was the market situation at the moment" ...

But there is some logic. Unfortunately for many and especially for promoted brokerage companies it will happen. The similar situation I have observed with my own eyes on the real trading company. I spat on the deposit and looked as if spellbound on the chart.

 
Alexey Viktorov:

Oh Yuri... How misguided you are. Do not forget that the spread is mostly floating and to close the Sell on the stop is enough to move Ask without touching the Bid or to close the Buy by moving the Bid without touching Ask the excuse was prepared in advance, "Such was the market situation at the moment" ...

But there is some logic. Unfortunately for many and especially for promoted brokerage companies it will happen. The similar situation I have observed with my own eyes on the real trading company. I spat on the deposit and looked as if spellbound on the chart.

Thanks for the warnings, and I understand myself that anything is possible. And about the floating spread, I agree, there are doubts. But... If my EA has not worked during daytime, I would not know, I have only started working in tester, I have to choose tails before real trading, but hopefully not large daily fluctuations will not interfere.

 
Igor Zakharov:

I wrote a warning because I've had such a failure in my practice... The robot had closed half of a grid of about 20 orders, and the robot continued to increase it according to the built-in logic. In the end, as far as I remember, the robot added a security element that checked if there was anything left in the market after the SL/TP.

As they say, forewarned is forearmed. I didn't mean to preach, I wrote purely with the best of intentions.

If you want an idea, here is the "secret" technique: instead of TP/SL, put a pending order so that when it triggers, the grid is fully locked. And then use CloseBy() to close it at any time (you can add a check that the spread is not larger than ... ).

It's ok, I don't see it as a tutorial. you speak up, share your experience, just thank you.

"the grid has become fully locked" is not a grid of orders, in its literal sense. Putting out a grid is trying to impose (or second-guess) the market with its rules, which it doesn't care about. I, on the other hand, try to play by the market rules - there is a signal, we open, or lock, no - we just wait. (Not being clever, just expressing my thoughts).

"a safety element has been added that checks if there is anything left in the market after a SL/TP." - I have something like that in mind as well.

I'm not a programmer, I'm an amateur, I'm writing EAs only for myself.

Once again, thank you all very much for the advice, much appreciated.

 
Is there a more advanced development environment for mql than metaeditor? Is there any way to connect another development environment (not notepad)? The only thing I miss in metaeditor right now is collapsing lines of code
 
Ilya Prozumentov:
Is there a more advanced development environment for mql than metaeditor? Is there any way to connect another development environment (not notepad)? The only thing I miss in metaeditor right now is collapsing lines in code.

There's plenty of it. NPP for example or VS

 

how do I make a point-by-point plot of the clozes?

and then superimpose a circle of a certain radius on each point?


I tried an ellipse.

But these ellipses are a bit crooked.





I've tried an ellipse. But these ellipses are crooked.

I also try to increase the chart size vertically - the ellipse gets distorted.

How can I change the scale of the chart so that the ellipse remains a circle?

script for m1:
Files:
bbbq0c2.mq4  2 kb
 
multiplicator:
how do I make a point-by-point plot of the clozes?

and then overlay a circle of a certain radius on top of each point?

Put a larger circle on top of it and a smaller circle on top of it...

 
Alexey Viktorov:

Put a larger circle and on top of it a smaller circle...

is there a circle object? or just an ellipse?