[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 622
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
is there any way to sort the instruments in the tabs at the bottom of the screen? because 8 instruments in 4 timeframes are scattered in a mess....
grab the tab with the name of the graph and drag it to the right place
AAAAAAAAAAAAAAAAAAAAAAAAAA great answer, thank you...
:) Now error 130 has appeared. The most confusing thing is that with wrong stops (130) it still sets correct takeoffs (calculated by ATR), but my stops were not set from the beginning...
Is there any way to understand this?
I added Limit orders (I forgot about them in previous code :)) + error #1 processing (before modification new price is compared to current one, if they are the same, then nothing happens):
It seems that modified orders moved by the trawl closer to the market lose their TakeProfit inheritance... They, once triggered, hang on the chart in positions and stupidly consume margin. They don't close in profit or loss, and there is no TakeProfit line... Although, I purposely added tp value, calculated using ATR, to the code to check it:
Both before and after my changes the modified order did not have a take line either before or after its conversion to a position...
What can be the reason?
It seems that modified orders moved by the trawl closer to the market lose their TakeProfit inheritance... They, once triggered, hang on the chart in positions and stupidly consume margin. They don't close in profit or loss, and there is no TakeProfit line... Although, I purposely added tp value, calculated using ATR, to the code to check it:
Both before and after modifications the modified order did not have a take line either before or after its conversion to a position...
What could be the reason?
Error 130 can be either the wrong stoploss or the wrong takeprofit.
When modifying pending order price, you should also modify StopLoss and TakeProfit.
Doesn't the ATR Take Profit function do that? I call it before modifying an order, get the current take value calculated by TakeProfitATR() and paste it into the order modification... This is in my example above:
....
Looks like I found a mistake while writing this... The TakeProfit function by ATR returns TakeProfit value in pips, while the price should be used.But then I don't understand why modified order was losing its takepoint value before these changes were done... Although, OrderTakeProfit() should write the value of its take point into the order being modified...
And then the question - why should I modify it (take) every time, if, say, I just want to move a pending order closer to the market without changing it, if the market has moved away from it and is ready for a reversal or correction... ???
Doesn't the ATR Take Profit function do that? I call it before modifying an order, get the current take value calculated by TakeProfitATR() and paste it into the order modification... This is in my example above:
....
It looks like I found my mistake while writing this... The TakeProfit function by ATR returns TakeProfit value in pips, while the price should be used.But then I don't understand why modified order still lost its takepoint value before these changes... Although, OrderTakeProfit() should write the value of its take point into the order being modified...
And then the question - why should I modify it (take) every time, if, say, I just want to move a pending order closer to the market without changing it, if the market has moved away from it and is ready for a reversal or correction... ???
I have added automatic stop and takeovers to my method. When you put a pending order you only have to set limiters and the method will drag everything to the right place :))
I have added automatic stop and takeovers to the method. When setting pending orders, I set limiters once and then the method itself drags everything to the right place :))
Let us imagine a situation when the market has low volatility but a steady upward trend. The price has slowly moved away from the pending SELLSTOP order upwards. An open BUY position has already been worked out and closed with a profit. We wait for the market volatility to increase, and as soon as it exceeds some threshold, we move a limit order to the price. Thus, we catch the correction that has begun and the Limiter works not as a locking position but as an additional source of income. If we had not moved it, the correction might have reached it, touched it and finished. In this case we would have a lota Sell position in an uptrend.
Such an excursion into a trend safari...
If we have dynamic TPs, then by moving a pending order to the market and taking into account strong volatility (here it will be larger than for weak volatility) we are more likely to take more profit from a correction than in case of static TPs. Anyway, if we didn't close on the take, the trawl will do its job and we will lose only the missed profit...
Ugh... It's been a long time since I clicked so much on the keyboard...
Hence, the suggestion follows by itself. To make in passing parameters of function also TimeFrame. And based on it calculate the take from ATR values.
I experimented for some time and my investigations for M5 TF led to the conclusion that the optimum take profit according to ATR is calculated with ATR*45000, and I did it for my calculations. At these values the market almost always "catches" the take in time:
Of course, the function is not finished, but it is enough for me for testing (I'm testing M5 for now)... By the way, with input value = 1 it gives quite a good distance for pending order setting.
It would be nice to see it in your function... :)
Thanks anyway - it's quite satisfying considering my modifications just to get the above...
ZS... it would be nice to add colours for modification icons... (really I have already added them)...
Here's a question: how does BC deal with a large number of trades? My Expert Advisor opens a position every 29 minutes (only one out of five strategies). Then, when equity increases by five percent, all of them are closed together. The main thing is that the balance increases by five percent every three to five days.
I wonder if BC has any claims to this kind of trading.