| / | Forum |
|
foxmor
2006.05.08 15:46
Hello,
I've been learning MQL for about around a month or so and trying to set up a system that will go long on a cross of the ADX(4) DI plus/minus within the indicator on EURUSD currency. I programmed in some back testing code and had the system running nicely so wanted to produce an Expert Advisor but wasn't getting the same results. I narrowed it down to find the error produced after checking the Strategy Tester log data produced found that the days DI+ or DI- number is incorrect. The code attached is a cut down version of the EA and if you view the Strategy Tester log file you will see that either the DI+ or DI- is incorrect and the correct data is displayed in the previous days figures, also in the log on the previous line. I've emailed Metaquotes about this but haven't, as yet, had a reply and wondered if I'm doing something wrong. Not every days data is incorrect but a large percentage, if you view the data window within MetaTrader charts and place the mouse over the chart data you can see the chart prices and ADX figures that dont tally with the Strategy Tester log file below it, if you dont close the strategy journal of course. Any help would be very much appreciated here. I think the MQL4 system is incredible and would love to get this fixed. You can see a cut down version of my EA below....
|
|
One of the servers, on which the client terminals and Expert Advisors of the Championship Participants are working, failed last Saturday. For this reason 20 Expert Advisors did not work on Monday. All Expert Advisors have become able to continue their competition by 12 a.m. on Tuesday. |
|
foxmor
2006.05.08 21:23
Well I've had a response from Metaquotes and they tell me to adjust the shift on
the iADX to 1-2 from 0-1... anybody have an idea how to make that work now as the correct
ADX data is being displayed but a day behind... how can that work if my expert
advisor is running in realtime?
Any help would be appreciated. Thanks |
|
ququr
2006.05.08 22:08
Hi foxmor, -matt |
|
foxmor
2006.05.08 22:29
ququr wrote:
Hi foxmor, -matt |
|
foxmor
2006.05.08 22:52
Hi Matt,
A great reply and thanks very much for that bit of insight.... sometimes things aren't as clear as they seem. I take it then if I wait until daily bar close, after 12pm(GMT), so its actually the next day and run my EA then it would give me accurate entry points based on my EA and it would be effectively 20 minutes behind realtime if for example I ran the EA at between 00:00 and 00:20am but with accurate iADX data from bar 1?? And the data wouldn't be as inaccurate as a whole day behind or as unreliable if trying to find entry points on bar 0? Regards Harry |
|
ququr
2006.05.08 23:33
Hi Harry,
...sometimes things aren't as clear as they seem. LOL, so true! I take it then if I wait until daily bar close, after 12pm(GMT), so its actually
the next day and run my EA then it would give me accurate entry points based on
my EA and it would be effectively 20 minutes behind realtime if for example I ran
the EA at between 00:00 and 00:20am but with accurate iADX data from bar 1?? And the data wouldn't be as inaccurate as a whole day behind
or as unreliable if trying to find entry points on bar 0?
In what you describe above, using the 2-1 as MetaQuotes suggested will give you a nice fresh signal for the first tik of the new days bar. And you can sit out the rest of the day. And get some sleep instead of getting up at 00:00 to turn the EA on for 20 minutes ;-). The effect is the same, so you can use 1-2 and then let it trade only that first tik, and let it be automatic. you could even restrict the runtime of the EA to some part of the day, using that finished bar, so first tik or later, it'll be the same signal, but the price might be at a different place than that first quiet tik of the day. Another approach is to define rules for the current signal. For example, if the fear of using "0" is that you'll end up with a bad signal, you can decide what will make that regret unlikely. For example, if the 0 bar gives you a signal, then wait until it is a certain strength/value etc or after price has moved a certain distance from the signal point or some other method that will make you confident that you won't get a false signal if you take the trade now. So, you still get in on this day, you improve the chance your signal will be valid, and you give up less profit than if you'd waited for a new bar. So, for my moving average example touched on earlier, I could let it trade on a cross, plus 5 pips. or a cross with fast ma slope > some steepness, or, value of difference between the mas that are crossing be some threshold value (another strength-of-cross filter). Many ways to skin the cat. Having said all that, if you want your trades to match history perfectly, then take MQ's advice and use the 1-2 bars. Good luck! --Matt |