Metatrader Error help - fix it - repost
Ngân sách $30-250 USD
Hint: the "log file" is easier read in the attachment called "ZERO DIVIDE."
I wrote a simple program, where I am finding the difference between a moving average's current value, and the closing value of the previous bar. Like this:
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: *************************************
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: New Tick On CHFJPY: ServerTime = [url removed, login to view] 06:40:40. LocalTime = [url removed, login to view] 06:40:40.
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: ************************
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: Timeframe = 5, L Ema 2, Prev 105.850 - Current 105.878, Diff = 0.028
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: Timeframe = 5, L Ema 5, Prev 105.840 - Current 105.861, Diff = 0.022
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: Timeframe = 5, L Ema 10, Prev 105.796 - Current 105.810, Diff = 0.014
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: Timeframe = 5, L Ema 20, Prev 105.779 - Current 105.783, Diff = 0.003
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: Timeframe = 5, L Ema 30, Prev 105.773 - Current 105.779, Diff = 0.006
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: Timeframe = 5, L Ema 40, Prev 105.785 - Current 105.786, Diff = 0.001
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: Timeframe = 5, L Ema 50, Prev 105.787 - Current 105.789, Diff = 0.002
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5: Timeframe = 5, S Ema 100, Prev 105.841 - Current = 105.840, Diff = 0.001
19:55:46 [url removed, login to view] 06:40 SMA CHFJPY,M5:
Now what want to do, and what I am having problems with, is I want to divide one of the "Diff" values into another. I want to find for example what is the percentage change of MA 5 vs MA 2, by dividing MA5's "Diff", by MA's 2, or .022/.028 to = .78.
Well I can't do that apparently. If I try, it always gives me the "zero divide" error. Like this:
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: *************************************
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: New Tick On CHFJPY: ServerTime = [url removed, login to view] 00:03:02. LocalTime = [url removed, login to view] 00:03:02.
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: ***********************************
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: Timeframe = 5, L Ema 10 / 5 = 0.046
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: Timeframe = 5, L Ema 20 / 5 = 0.062
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: Timeframe = 5, L Ema 30 / 5 = 0.086
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5:
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: *************************************
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: New Tick On CHFJPY: ServerTime = [url removed, login to view] 00:03:02. LocalTime = [url removed, login to view] 00:03:02.
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: ***********************************
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5: zero divide
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5:
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5:
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5:
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5:
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5:
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5:
19:45:24 [url removed, login to view] 00:03 Percent CHFJPY,M5:
Then you get nothing after that.
I mean, what is this thing's problem? What does it want from me? What the heck?! Your job, is to find out what I am doing wrong, and make it work. Attached are the two eas. I stripped them down to just these two equations.