- Search Energy EXCH
- 25 Results
- Royce replied Jan 22, 2009
I think you are just going to get the very last tick from the downloaded data. If your EA is just watching the first few array elements for a setup to march by I think it is going to miss it. In order to catch the event you'll probably need to ...
- Royce replied Sep 6, 2008
There is no hack to forcing an EA to run periodically. You just don't return from the start() call on the first tick. (You do have to wait for that first tick). The trick is that you need to check the IsStopped() flag at least every 2.5s. If the ...
- Royce replied Sep 6, 2008
When making your own DLL, you'll find that a lot of compilers will put "decorations" onto the functions names by default, and you can indeed use this program to figure out what the compiler has done. However, many compilers (C/C++ compilers at ...
- Royce replied Jun 30, 2008
init is also called if the user changes the parameters.
- Royce replied May 2, 2008
Place in ex4 in the same directory that you would place an MQ4. Then compile any other MQ4 that you do NOT have currently loaded. The compile action will stimulate the terminal client to refresh its entire list of EX4s and display them in the ...
- Royce replied Apr 24, 2008
Another technique is to take advantage of the init() call you get whenever you update the parameters in an EA. You could put the ticket number in a parameter and then add that ticket to whatever pool of controlled orders your EA might have.
- Royce replied Apr 21, 2008
I don't have any examples, but you are correct that you will need to delete and re-create objects in order to change their name from MQL4 code. The key is to use a function encapsulate this behavior and package it for re-use. The function might be: ...
- Royce replied Apr 17, 2008
I forgot the return syntax deal. I fixed it in my copy but then forget to mention it. The return argument absolutely positively has to be surrounded by parenthesis. Or, it is a syntax error. It is just an annoyance of the language caused by ...
- Royce replied Apr 17, 2008
To my knowledge there is no simple way to stop one EA from another unless the EAs were expressly designed for that behavior. You can certainly close all the orders, but if the EAs are still running they will likely trade again. A complex solution to ...
- Royce replied Apr 17, 2008
A few things: 1. You can not define a function within another function. init() is a function like any other, even though MT4 pre-defines it and tries to call a function by that name at startup. That is what the unexpected function definition error ...
- Royce replied Apr 16, 2008
The forum rules seem to frown on programmers advertising. Probably not a bad thing, really. Anyway, in addition to posting here for help you can go over to guru.com and elance.com to look for free lancer programmers.
- Royce replied Apr 15, 2008
Arrays in MQL4 have to be sequential and have to start at zero. The array is a very low level mechanism. Other languages have higher level data types called variously "map", "dictionary", "table", etc, that allow you to index array-like memory ...
- Royce replied Apr 14, 2008
I guess it also helps to understand the Trading function series. In a nutshell OrderSelect accepts a ticket number (or position index) so as to place the selection focus on to a given order. The remaining functions operate on the selected order. ...
- Royce replied Apr 14, 2008
I think the best approach for you is to store ONLY the ticket number in a single dimension array. You can use the ticket number to access other aspects of the associated order and sort the ticket numbers by those aspects. In the sorting example I ...
- Royce replied Apr 8, 2008
I think you might want to invest some time in learning arrays. The technique you appear to be attempting would result in truly massive amounts of code. I've attached a very basic EA that will pickup some orders, store them in an array and sort them ...
- Royce replied Apr 7, 2008
In an indicator or EA you may loop through all the orders like so: for(int idx=0; idx < OrdersTotal(); idx++) { if (OrderSelect(idx, SELECT_BY_POS, MODE_TRADES)) { //Test the order here using the Orderxxxxxx series of functions } }
- Royce replied Apr 3, 2008
Just for reference, while indicators run in the UI's thread and must not pause or even take too long per a tick in order not to make the system sluggish, EA's each run in their own thread. You don't have to return from start, ever. Some EA's don't. ...
- Royce replied Apr 3, 2008
I think what you might be looking for are the Time Series Access functions. Look right under the Technical Function section in the help navigator for the Time Series Access functions. You'll see iOpen, iClose, iLow, etc. These functions will get you ...
- Royce replied Apr 3, 2008
With some C or VB programming you might be able to rig something up. Toolbar buttons and menu items often have a simple number associated with them that they emit to the main window in the form of a WM_COMMAND window message. If you can use WinSpy ...
- Royce replied Apr 3, 2008
Arbitrary indicators cannot be exported from MT4, however one may certainly create an indicator of any sort (MA or whatever) that is specify designed to export the data it generates. The MQL4 code has the ability to open and write data to files. For ...