- Search Metals Mine
-
7bit replied Jul 21, 2010The magic number (and the name for the corresponding equity chart) is auto-generated from short name and the pair it is running on. (Its using a hash function on the string name + Symbol() to generate the MN). You could make the short name (the ...
Trading the anti-grid with the snowball EA
-
7bit replied Jul 15, 2010I have not yet succeeded in writing computer programs that run without a computer but i keep trying. This would be a breakthrough and greatly reduce hardware costs. The trades all have stoplosses attached to them, so the worst case after a black out ...
Snowballs and the anti-grid
-
7bit replied Jul 14, 2010I am only saying: calculate the total all-time equity at every tick and simply subtract the all-time equity that it had shown at the beginning of your cycle. the difference will be the profit of this cycle. And the result of doing it this way will ...
Keeping Track of Equity by Pair
-
7bit replied Jul 14, 2010It is counting up to OrdersTotal() because of the <= and as I have already explained the last position number is always one less because the numbering starts at 0 and not at 1. It might not produce an error or a wrong result in this specific case ...
Keeping Track of Equity by Pair
-
7bit replied Jul 14, 2010I have written my ideas already and your problem has been solved already in even more than one possible variant, there is even ready to use code available for free and has been posted into this thread in posting #13, why are you still asking the ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010the history will be cached, so it will only do the big loop when the history has changed, between that it will only sum up the running trades and add this to the cached realized value. It is supposed to be called on every tick, therefore all the ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010This does not look like clean code. What are you trying to do? Why don't you just do the two loops as shown in the example and sum up all the profit? What is wrong with them? you can add an additional if (OrderCloseTime() > some_time_inthe_past) in ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010You would in the last iteration have selected a position that is beyond the last order. This *might* lead to surprising results in some cases when you then try to use the Order*() functions on the not existing and not selected order. Example: Say ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010There is no way around using two loops. You can never select open and closed orders at the same time, they are in two different lists. Although you can directly select by ticket instead of position, ignoring in which of the two lists it is, which is ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010It might be possible to implement something like this by overlaying histogram bars on top of each other in the same indicator window: 3 or 4 buffers would be needed: one that plots red bars pointing from the zero line upwards, containing only ...
MT4 navigational tips and techniques
-
7bit replied Jul 13, 2010I have also written an article at mql4 com about this: url Please don't download the .mqh from there, its outdated and probably buggy, always use the latest version from my own website.
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010Wrong! right: double o_profit=0; cnt=0; for(cnt=0; cnt<OrdersHistoryTotal(); cnt++) { OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY);
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010/** * loop through all trades (historic and currently open) and * sum up all profits (including swap and commission). */ double getAllProfitFiltered(int magic=-1, string comment=""){ int cnt, total; double floating = 0; double realized = 0; static ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010It is EA independent. And you also don't need OrderCloseTime(). You simply add up every OrderProfit() you can find in the complete history and in all open trades and you know what the EA has done so far. Do this on every tick and plot these values ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010offline charts are the charts that are available if you go to the file menu and click on "open offline". You should at least have read the user manual of metatrader if you want to write software for it. And this is exactly what this library does. I ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010This is too complicated. Simply loop through the order history to sum up all the realized profit belonging to this EA and then in a second loop go through all open trades and sum up the floating profit for this EA. Then simply add realized + ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010You do not need to change the name of the EA. You simply have to make up a 5 letter short name for the function call to use it as a prefix for the equity chart name to be able to find it later in all the many offline charts. If you look into the ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010Yes there is an easy way: On the website in my signature you will find the include file offline_charts.mqh. Amongst other functions for managing offline charts this contains a function recordEquity() that lets you record the partial equity belonging ...
Keeping Track of Equity by Pair
-
7bit replied Jul 13, 2010As with anything they do it seems microsoft has once again sucessfully managed to build more than one bug into such a seemingly simple mechanism: url But you might be lucky and your client only accidentally set the "allow dll" and "confirm dll ...
Better alternative for Print() for debugging
-
7bit replied Jul 12, 2010Yes, this is is how it looks like. Btw: there is also a toolbar button where you can change the time format into something better readable. And you can log up to 8 values with one call to log() and mix strings and numbers like in my example above if ...
Better alternative for Print() for debugging