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
Hello Igor!
I'm trying to learn MQL4 and due to lack of description of the language operators one problem has left me stumped. I have an indicator with 8 buffers of accumulated data. I need it to be displayed with the period of the next timeframe at a timeframe I have chosen. For this purpose, it uses iCustom() operator. But it returns a double value and I don't know how and whether iCustom can and should be used in this case.
I really hope for your help.
Hello, Alexey!
You should make a new indicator that would use the iCustom() function. Assign the values returned by this function to the buffers of the new indicator.
Hello Igor! And good afternoon to all!
I am interested in the code which should be entered so that the Expert Advisor does not make any more trades on that day when it closes a trade...
I've found it but it does not work in the strategy tester, I want to test it, what code should I use instead?
Then I should add it in the entry condition.
Hello, Sergiy!
I do not even see why the use of my function given by you cannot work in the strategy tester. If it is still relevant to you, I suggest that you post the entire code of the EA. Let's try to figure it out...
There are questions about differences and peculiarities of SetOrder() and OpenPosition() functions in error handling.
SetOrder():
OpenPositions(): Errors 8 (ERR_TOO_FREQUENT_REQUESTS), 138 (ERR_REQUOTE) and 139 (ERR_ORDER_LOCKED) are not handled, unlike SetOrder():
In SetOrder() error 130 (ERR_INVALID_STOPS) is handled by stop correction, but in OpenPositions() it is not handled in any way.
In OpenPositions() processing 145 (ERR_TRADE_MODIFY_DENIED) is present. The sense of processing it here is not clear.
Besides, on the first page of this discussion there is a mention of errors handling of which is missing in both functions:
На паузу 7.7 секунды нарвутся ошибки 129 (Неправильная цена bid или ask), 130 (Неправильные стопы), 134 (Недостаточно денег), 136 (Нет цен).
Also, there is no processing of other (probably, important in this case) errors, for example, 3 (ERR_INVALID_TRADE_PARAMETERS), 6 (ERR_NO_CONNECTION), 7 (ERR_NOT_ENOUGH_RIGHTS), 9 ERR_MALFUNCTIONAL_TRADE, 137 (ERR_BROKER_BUSY), 144(!), 4067 (ERR_TRADE_ERROR), 4106 (ERR_UNKNOWN_SYMBOL), 4107 (ERR_INVALID_PRICE_PARAM)
Igor, please comment on the described points.
The SetOrder() and OpenPositions() functions I have mentioned are taken from b-Orders library of 05.11.2008 and b-Positions of 29.10.2008 from kimiv.ru site.
I would like to add. If error 5 ERR_OLD_VERSION occurs, it can be handled in the same way as 2, 64, 65, 133; 4109 ERR_TRADE_NOT_ALLOWED in the same way as 4110, 4111
What does error 142 mean? I didn't find it in error codes.
https://docs.mql4.com/ru/trading/errors
142 An order has been queued up. This is not an error, but one of the communication codes between the client terminal and the trading server. This code can be received in a rare case, when during trading operation performance there was a break in connection and the connection was restored afterwards. It must be handled in the same way as error 128.
I am interested in a question about GEPs, they are not described in the book, and there is a lot new in this topic. I would like to know how to make a trade open every time a GEP appears. I want to know how to open orders when GEP appears. I have it, but for some reason this algorithm fails to work, what is the error here?
In the first condition the first sub-condition is redundant, the second condition on sale is impossible. Is one point a gap? Your slippage is 2 and the stop is 2.
Thank you, but why is the first preface superfluous? You want a buy position to open when a new bar is above the close of the previous one and vice versa. >> Is that the right way?
As far as I understand the first condition automatically implies that the closing price is greater than the opening price. In the second, it is the other way round??????