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 wasn't asking anyone to produce something of commercial value for me. I'm not asking for someone to "code my method FOR me", WHRoeder. I just need a starting point. I may be able to figure something out from the link you put under "search", though I really would like a bare bones "this is what is needed". I don't know what the program should actually look like. I don't know what is strictly necessary to be in it. If I try to do it myself out of the blue without any point of reference, I'm just going to get compiler errors because I'm not even going to know what it's lacking.
Look here
I am on the threshold of putting the pieces together. But I am not quite there. There are things that don't make any sense. For instance:
https://docs.mql4.com/array/ArrayCopySeries
This makes no sense. What if the array I declared isn't the same size? It's basically guaranteed NOT to be. I don't want to walk out of the end of the array so I can declare the array to be bigger than I THINK it will ever be, but what if it's ever bigger? And what if it's lower? If "array" has more entries than the currency data, then are the remaining ones filled with 0? And what happens for doubly indexed arrays? For instance, suppose I declare the array to be of size [16384][6] and the data I want to copy into [0:16383,0] is of length 3000. How would I do that? Would I need another array variable to set to the currency data, which would be a singly indexed variable (of just size 16384, not of size 16384 x 6) and then its first 3000 entries would be written with the currency data and entries 3000 through 16383 would be written with 0, and then it's up to me to move the contents of the temporary variable into the [16384][6] size array? That's the puzzle I'm at right now.
I am on the threshold of putting the pieces together. But I am not quite there. There are things that don't make any sense. For instance:
https://docs.mql4.com/array/ArrayCopySeries
This makes no sense. What if the array I declared isn't the same size? It's basically guaranteed NOT to be. I don't want to walk out of the end of the array so I can declare the array to be bigger than I THINK it will ever be, but what if it's ever bigger? And what if it's lower? If "array" has more entries than the currency data, then are the remaining ones filled with 0? And what happens for doubly indexed arrays? For instance, suppose I declare the array to be of size [16384][6] and the data I want to copy into [0:16383,0] is of length 3000. How would I do that? Would I need another array variable to set to the currency data, which would be a singly indexed variable (of just size 16384, not of size 16384 x 6) and then its first 3000 entries would be written with the currency data and entries 3000 through 16383 would be written with 0, and then it's up to me to move the contents of the temporary variable into the [16384][6] size array? That's the puzzle I'm at right now.
I think you should read the Docs again. It states and I quote "There is no real memory allocation for data array and nothing is copied."
It just sets a Reference so you do not set size on the destination Array. You just declare it. Take a look again at the example in the docs. There is no size in the declaration.
datetime daytimes[];
So I have to download the historical prices one time at a time with iclose then? https://docs.mql4.com/series/iClose The problem with that as I see it is that the data can update while I'm in the middle of downloading it. It would be very nice to download the whole thing as a block. I GUESS I can download the time with iTime and THEN use iclose and THEN use iTime again on the same index and if it has changed, then it has begun a new bar time interval and I have to go back an index number. Am I reasoning that correct or is there something I don't understand?
I do not think we are speaking the same language. First you ask about the ArrayCopySeries function, now you want to download all data via iClose.
These is no need to download all the data - it is there always available to you at any time you require it.
What is it you are trying to do?
Why do you need to copy all data in an Array into another array, if you can already access it totally from the first one?
Are you trying to pass on the information onto a external DLL for processing? If so, you should use the "CopyRates" function - https://www.mql5.com/en/docs/series/copyrates
For any other case, you do not need to download all the data. It is already accessible via the normal methods.
I decided to re-read your first post in detail to see what it is you are trying to accomplish and realised that you are going about it ALL WRONG.
You don't have to download all that data into RAM as you explained. It has already been done for you by the MetaTrader environment. All you have to do is access it in the normal way.
I suggest to take a look at the many example EA's here on the site in the codebase or the introductory book on MQL4 programming, here also on this site.
Also read the various articles explaining how one could approach the writing of an EA:
That way you can learn how it is done instead of trying to "reinvent the wheel".
No one has given me a CLUE how to do anything, they tell me to figure it out for myself or pay someone else to do it, read the first few posts of this thread and you will see that. The audacity of the people on this forum! They refuse to tell me anything and then they scoff at me for not already knowing about the "normal methods". Oh DO TELL! But that suspiciously doesn't sound ideal anyway. What I'm trying to do is to download the currency market data into my computer's RAM, perform calculations on this, and then have my computer then upload buy and sell orders to trade on the currency market. That's what I want to do. If it isn't my computer that is performing the calculations, then what would be performing the calculations anyway? Some remote computer? I can't be sending and receiving data across the internet every time I want to access a historical price, if I want to access that price 1000 different times in the process of the calculations, the time it would take to access that would slow the calculations down by a factor of thousands or millions. This is one reason why there is RAM in computer architecture, reads and writes to the hard drive take much longer. It's the same principle here, I need to store the data in an array on my computer because making a request across the internet every time I want to access a particular piece of information is bad.
What idea do you have as to what a trading robot is supposed to do?
No one has given me a CLUE how to do anything, they tell me to figure it out for myself or pay someone else to do it, read the first few posts of this thread and you will see that. The audacity of the people on this forum! They refuse to tell me anything and then they scoff at me for not already knowing about the "normal methods". Oh DO TELL! But that suspiciously doesn't sound ideal anyway. What I'm trying to do is to download the currency market data into my computer's RAM, perform calculations on this, and then have my computer then upload buy and sell orders to trade on the currency market. That's what I want to do. If it isn't my computer that is performing the calculations, then what would be performing the calculations anyway? Some remote computer? I can't be sending and receiving data across the internet every time I want to access a historical price, if I want to access that price 1000 different times in the process of the calculations, the time it would take to access that would slow the calculations down by a factor of thousands or millions. This is one reason why there is RAM in computer architecture, reads and writes to the hard drive take much longer. It's the same principle here, I need to store the data in an array on my computer because making a request across the internet every time I want to access a particular piece of information is bad.
What idea do you have as to what a trading robot is supposed to do?
That is not how the MetaTrader and MQL environment works! As I said! DON'T re-download data into RAM because it has already been done for you. Stop trying to teach us how to code in MQL4. You are the one that needs to set aside your preconceived ideas of how to write the code and first learn what tools and environment you have at hand.
If you don't want people to SCOFF at you, then don't be lazy and READ THE DOCUMENTATION (from start to finish). This site has many links for documentation and examples of code.
When I started out I did not ask for any help without first getting familiar with the environment. I took the time to read the book, the documentation, and the many, many, many examples on this site and learned how to do it.
You are not a baby and do not need to be spoon fed. Learn by reading the completely FREE documentation here and on many other sites. You can even go out and buy books on how to write an EA in MQL4 or MQL5 (for example, Expert Advisor Programming by Andrew R. Young).
If however, you are looking for a teacher, than that is different. You usually pay for the services of having a "personal trainer". Are you willing to pay? I am sure many would accept such a request at the Jobs section (https://www.mql5.com/en/job).
Also, the very first person to comment here for you was "ubzen" and the very first thing he did was recommend that you start by reading the "Introductory Book" and the "Reference Documentation" since you claimed that you were already a good programmer in other languages. VERY SOUND ADVICE!
One more thing - If you had used your little grey cells and done a search here in the Articles section, you would have found this very old but still valid article:
So, stop complaining and being lazy and do your "Research" part of R&D. You are familiar with that are you not?
No one has given me a CLUE how to do anything, they tell me to figure it out for myself or pay someone else to do it, read the first few posts of this thread and you will see that. The audacity of the people on this forum! They refuse to tell me anything and then they scoff at me for not already knowing about the "normal methods". Oh DO TELL! But that suspiciously doesn't sound ideal anyway.