Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1962
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
I posted a question earlier, but it seems to have been deleted, and I don't know why.
Is there a way to code an EA to determine whether or not the Market is Closed (or Open) without having to submit an OrderSend() or OrderModify() instruction to the broker's server? I am trying to avoid constant error codes (132 = "market is closed").
Thanks
Trader Mike
It was removed because you did not search before you posted. However, you should have received an automated private message (see below) with the reason as well as a link to answer your question.
Did you not read your messages?
Is there any way to have elements automatically added to a dynamic array in mql4?
No. Obviously your code has to add them.
I am looking for the code that will add elements automatically in the array.
My aim is to place multiple buystop and sellstop orders in mt4. With each successfully placed order, I want to have the order price stored in an array automatically (one array for buystop prices and another array for sellstop prices) After this I want the code to access the array and get the price that is closest to ASK (probably this will be something like: MyArray [0] - to refer to the zero index within the array) sso that every time the ASK price moves below the price at index zero by a certain distance, then the code will automatically place additional orders to fill that gap. I want to do this for both sell orders and buy orders
My main challenge with all of this is to get the code that will automatically add elements (in this case order prices) into my array automatically; so that it will be possible to refer to the price that is closest to ASK (in order to place more buy orders) or access the price that is closest to BID price (in order to place more sell orders)
Somebody please advise!
I am looking for the code that will add elements automatically in the array.
My aim is to place multiple buystop and sellstop orders in mt4. With each successfully placed order, I want to have the order price stored in an array automatically (one array for buystop prices and another array for sellstop prices) After this I want the code to access the array and get the price that is closest to ASK (probably this will be something like: MyArray [0] - to refer to the zero index within the array) sso that every time the ASK price moves below the price at index zero by a certain distance, then the code will automatically place additional orders to fill that gap. I want to do this for both sell orders and buy orders
My main challenge with all of this is to get the code that will automatically add elements (in this case order prices) into my array automatically; so that it will be possible to refer to the price that is closest to ASK (in order to place more buy orders) or access the price that is closest to BID price (in order to place more sell orders)
Somebody please advise!
As I already stated, you have to program it to that. That is the purpose of the MQL programming language, for you to make the code that will automate a task.
You have to code a function or a method to read the trade data and store it in an array. There is no "automatic" way. You have to program it yourself in MQL code.
So I have to ask ... do you know how to code?
If not then here is the usual message ...
As I already stated, you have to program it to that. That is the purpose of the MQL programming language, for you to make the code that will automate a task.
You have to code a function or a method to read the trade data and store it in an array. There is no "automatic" way. You have to program it yourself in MQL code.
So I have to ask ... do you know how to code?
If not then here is the usual message ...
I have been learning from scratch how to code. Now I want to attempt my 1st EA. Am not very good yet buy I know I will get there. I was only hoping to get a small help on the forum.
How to implement a table for MT4?
Hello, I'm currently developing a utility for MT4. It uses a table where it presents data about various symbols (instruments). I need the utility to be able to update the table values and sort them as the prices for the various symbols change. It should be possible for the user to select which column the table shall be sorted on.
So far I have used graphical objects such as OBJ_EDIT and OBJ_BUTTON to implement the table on a chart, but as the table has grown too large for my window, I will need a way to scroll the table. As it seems overly complex to implement a scroll functionality as well, I'm looking for alternative, easier, ways to implement this table.
I've found some interesting articles on how to implement tables for MT5, such as the following:
https://www.mql5.com/en/articles/2500
https://www.mql5.com/en/articles/3104
However, I don't know if it's possible to use this library for MT4/MQL4. Does anyone here have experience with using these classes for MT4/MQL4, and is it even possible?
Are there more appropriate ways to implement tables in MT4/MQL4? I'd appreciate some advice from more experienced MQL4 programmers. Thanks!
PS. Below I've attached a screenshot of the table in my utility. DS.
What am I doing wrong? The logic is opening a single long or single short at a specified time when the macd conditions are met. It keeps opening duplicates. One of the duplicate orders respects the desired TP and SL. The other order is not needed and never closes. It happens in the tester and on a live account. I'm not using a VPS or attaching it to multiple charts to justify the duplicate orders. Here is the script. I also attached the report. Help will be much appreciated.