- Search Energy EXCH
-
CodeMeister replied Aug 23, 2010Try This — NormalizeDouble(Bid, 4) should do it. You may have to experiment a bit with it to ensure the rounding is acceptable. If not, you may have to come up with something you devise.
Filtering 5 decimal to work with 4 decimal bots
-
CodeMeister replied Aug 17, 2010Try This — PP, Is the value TrailingStopLoss in pips or currency amount? That is 30 or .0030? Also you might want to use Low[0] and High[0] rather than Bid/Ask.
Code adjustment for Trailing Stop Loss
-
CodeMeister replied Aug 15, 2010Try This — I haven't used pending orders for a while, so my advice may be out of date. I did find a method to avoid error 130 most of the time. I would make a call to MarketInfo to obtain the Stop Level which is the number of pips that the ...
Send Pending Orders
-
CodeMeister replied Aug 15, 2010That is Right — You cannot put it as a background object. But you can find a combination of line style, thickness and color to make it almost disappear, although that would seem to defeat the purpose of the MA.
possible to draw moving average line as background?
-
CodeMeister replied Aug 14, 2010Try This — No you can't make money from indicators. You have to write EAs and use them to make money.

Can one have good income by programming indicators??
-
CodeMeister replied Aug 13, 2010Sure — The division of ticks into bars is something that is done for organizing the data into a more understandable format for us humans to analyze. MT4 is built as a tick event handling system. In fact it takes some effort to get MT4 to ...
Programming > no tick in bar, run start()?
-
CodeMeister replied Aug 12, 2010Try This — Sure - ArrayMaximum and ArrayMinimum are the best way I have found. int nbarsOpen = iBarShift(NULL, 0, orderOpenTime); double hi = High[ArrayMaximum(High, nbarsOpen, 0)]; double lo = Low[ArrayMinimum(Low, nbarsOpen, 0)];
Get High - Low between a timeframe
-
CodeMeister replied Aug 11, 2010Try This — Did you compile it to produce an .ex4 file and put it in the experts/indicators folder?
Price pattern indicator
-
CodeMeister replied Aug 10, 2010Not Quite — As long as it isn't a predeclared variable like Time or a reserved word like "If".
Coding question about "i" variable
-
CodeMeister replied Aug 9, 2010Try This — Put them in the experts/indicators folder. Also you need the .ex4 files, the .mq4 files are source code and can't be used until they are compiled in the indicators folder.
Special 5 decimal Market Price Indicator
-
CodeMeister replied Aug 5, 2010Shared Memory — Shared memory by use of a DLL is the best way to accomplish this if you are up to writing with other languages. This article details how to do it. I am sure there are other ways, but this should work. I want to do something ...
Most efficient way to pass orders to other mt4
-
CodeMeister replied Aug 4, 2010Try This — I'm not sure why capturing the time of the event is not considered a timestamp but those are only words. The key to this is declaring a static datetime variable to store the most recent event time. Since the variable is static, it ...
Record the time when an indicator line crosses a threshold
-
CodeMeister replied Aug 4, 2010Does It Matter — I thought the exact time didn't matter and than you were interested in the relative time. By that I mean if you know the time of the event you will alsway know how long ago it happened. If you had something else in mind, you ...
Record the time when an indicator line crosses a threshold
-
CodeMeister replied Aug 4, 2010Try This — Is there something wrong with storing the value in a static datetime variable? That way you would have it accurate to the nearest second. Here's some some code: if (event) eventTime = TimeCurrent(); This assumes that only the most ...
Record the time when an indicator line crosses a threshold
-
CodeMeister replied Aug 2, 2010Can't Be Done — You have to know something about the bar to determine its index such the latest, the bar 2 weeks ago or the last bar (on the left). If you know the time of the bar, use iBarFind() to determine its index. But of course you want ...
How to know the index of the last bar on chart?
-
CodeMeister replied Aug 2, 2010Try This — The latest bar is always 0 and the indices increase moving to the left of the chart. Time[0] will contain the date of the latest bar on any chart. Time[1] will have the date of the previous bar and so on.
How to know the index of the last bar on chart?
-
CodeMeister replied Jul 30, 2010Try This — You didn't indicate whether you shut down MT4 or not. Try that - it solves most of the one time glitches.
Chart Shift Label missing
-
CodeMeister replied Jul 29, 2010Try This — If you know the name, use ObjectGet(). If you want every object, try this: for( int i=0; i<ObjectsTotal(); i++) { string name = ObjectName(i); }
how do I choose a label I selected?
-
CodeMeister replied Jul 28, 2010Try This — An array is just a collection of data elements of the same type. In the same manner that you can display strings, integers and doubles on the chart, you can display arrays as well. Here is an example I used recently. I defined an ...
function to draw array on chart?
-
CodeMeister replied Jul 28, 2010Try This — Right click anywhere on the chart and select Objects List. Make a guess at the one you think it and click "Show" or "Edit".
how do I choose a label I selected?