| / | Forum |
|
firelake
2006.06.27 10:12
Hello everybody,
I am straggling with discrepancies in values between EA and what is shown on a chart (when I do a mouse hover). Situation is very weird. I took MACD sample indicator supplied with terminal and added Print() line, so that these values will be printed in the Journal. Also, I added Print() in EA itself - MACD Sample EA supplied again with the terminal. Testing of EA was done on Open prices only. When I ran MACD Sample, it prints out correct values for both indicator and EA, and also shows correct values on charts - see numbers below. EA Journal: 2006.06.26 22:41:38 2006.06.27 04:00 Mod MACD Sample USDJPYm,H1: EA: Curr=-0.0643; Prev=-0.0695 2006.06.26 22:41:38 2006.06.27 04:00 ModMACD USDJPYm,H1: IND: Curr=-0. 0643; Prev=-0. 0695 Chart values: 3:00 -0.064, 2:00 -0.069 - Correct values In a code, I am printing values from buffer 0 at [1] and [2] (not [0] index to avoid not completed bar). Code for both MACD indicator and MACD EA attached is zip file. Now, I created my own indicator based on Fisher, and did exactly the same approach as with MACD. Result is different!!! EA Journal: 2006.06.26 22:17:22 2006.06.27 04:00 MyInd Test USDJPYm,H1: EA: Curr=-0.1242; Prev=-0.4023 2006.06.26 22:17:22 2006.06.27 04:00 MyInd USDJPYm,H1: IND: Curr=-0.1242; Prev=-0. 4023 Chart values: 3:00 -0.049, 2:00 -0.336 - NOT Correct values!! I do not understand what is going on. mql4 gurus, experts, developers - Please take a look into code and tell me what I am doing wrong! Please do not come up with generic answers like "Do you consider changes in current bar during testing?" Code is attached in zip file, so you can run it yourself, see what is going on and suggest corrections. Greatly appreciate your help, firelake |
|
The article deals with realization of charts without skipped bars. |
|
firelake
2006.07.10 00:09
Hey Guys,
So, nobody really know what's going on? MQL developers, at least you should be able to figure out what's a problem. thanks. |
5089 |
stringo
2006.07.10 11:36
your "chart values" are output with 3 digits accuracy because of
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1); but printed with 4 digits by default. Print they with 8 digits - You will be surprised. |
|
firelake
2006.07.11 07:44
Hi Stringo,
I appreciate your reply, I really do, but it does not solve the issue. Let me just say that I like MT4 terminal a lot, and think it is one of the best software on market. However, there are some things that do not work, and I'd like to get to the bottom of it. First of all, your code snippet is for MACD indicator that was working fine all alone. Let focus on MyInd.mq4 and corresponding EA (zip file with both is attached). Again, I corrected digits following your advise, simply by putting IndicatorDigits(Digits+5); in indicator itself, and changed Print() to the following Print("IND: Curr=",DoubleToStr(ExtBuffer0[1],8),"; Prev=",DoubleToStr(ExtBuffer0[2], 8)); So, 8 digits in indicator and 8 digits in Print(). Does not work! Below is a Journal entry for 7/10 2:00 (could not insert image, see in zip file). Suppose to print values for 7/10 1:00 and 7/10 00:00: 7/10 2:00 IND: Curr= -0.459329; Prev= -0.384305 (Curr is for 1:00 and Prev is for 00:00) Now, when I hoover mouse over a graph on chart, I got following chart values: for 1:00 -0.7163716 and for 00:00 -0.5773181 Again, Journal values and chart values are completely off!!! Do you see what I mean? If you have a working code on you rside, please send it to me, or attached to this thread. Thanks, and looking forward for your reply. |
5089 |
stringo
2006.07.11 12:17
There is problem with your indicator. See log: |
|
firelake
2006.07.11 19:34
Stingo,
What timeframe do you use? I am running indicator on 1H chart, and I don't see anything like that. Are you running 1 min data? Curr suppose to Print() a value from previous completed bar, if you look at the code. How is it possible that it will re-calculate value on a previous completed bar? Picture is attached and you can see only 1 calculation per hour... |
|
firelake
2006.07.11 19:37
I am running back testing with Strategy Tester and Open prices only. Are you looking
into forward testing result by attaching EA to chart?
|
|
firelake
2006.07.11 19:54
image of 1H Journal, re-attaching... Attache file does not work?!
|
5089 |
stringo
2006.07.12 11:21
See log
12:08:02 2006.07.11 10:08 MyInd Test USDJPY,H1: EA: Curr=0.20071322; Prev=0.16784360 There is testing in the model "every tick". There is some wrong if your indicator every time recalculates value on the 1-st bar (Curr=...). Attach your indicator on the chart and see results in real time |
|
firelake
2006.07.12 22:14
Stringo,
Lets narrow the issue. I am testing in Open prices mode only, and it prints exactly one line per bar (1H bar, see image in my zip file). You are testing on every tick, and of course you will have multiple lines printed for every tick. But values are NOT recalculated, it is exactly the same value. Below is extract from your previous post. 12:08:02 2006.07.11 10:06 MyInd USDJPY,H1: IND: Curr=0.20857798; Prev=0.16784360 12:08:02 2006.07.11 10:06 MyInd Test USDJPY,H1: EA: Curr=0.20857798; Prev=0. 16784360 12:08:02 2006.07.11 10:06 MyInd USDJPY,H1: IND: Curr=0.20857798; Prev=0.16784360 12:08:02 2006.07.11 10:06 MyInd Test USDJPY,H1: EA: Curr=0.20857798; Prev=0. 16784360 12:08:02 2006.07.11 10:06 MyInd USDJPY,H1: IND: Curr=0.20857798; Prev=0.16784360 12:08:02 2006.07.11 10:06 MyInd Test USDJPY,H1: EA: Curr=0.20857798; Prev=0. 16784360 12:08:02 2006.07.11 10:06 MyInd USDJPY,H1: IND: Curr=0.20857798; Prev=0.16784360 12:08:02 2006.07.11 10:06 MyInd Test USDJPY,H1: EA: Curr=0.20857798; Prev=0. 16784360 12:08:02 2006.07.11 10:06 MyInd USDJPY,H1: IND: Curr=0.20857798; Prev=0.16784360 12:08:02 2006.07.11 10:06 MyInd Test USDJPY,H1: EA: Curr=0.20857798; Prev=0. 16784360 12:08:02 2006.07.11 10:06 MyInd USDJPY,H1: IND: Curr=0.20857798; Prev=0.16784360 12:08:02 2006.07.11 10:06 MyInd Test USDJPY,H1: EA: Curr=0.20857798; Prev=0. 16784360 12:08:02 2006.07.11 10:06 MyInd USDJPY,H1: IND: Curr=0.20857798; Prev=0.16784360 12:08:02 2006.07.11 10:06 MyInd Test USDJPY,H1: EA: Curr=0.20857798; Prev=0. 16784360 12:08:02 2006.07.11 10:06 MyInd USDJPY,H1: IND: Curr=0.20857798; Prev=0.16784360 12:08:02 2006.07.11 10:06 MyInd Test USDJPY,H1: EA: Curr=0.20857798; Prev=0. 16784360 So far value is the same on ALL ticks at 10:06 - 0.20857798. Am I missing something? Indicator is very simple - 5 or 6 lines. Are there someone in MQL4 team who can suggest anything productive? |
5089 |
stringo
2006.07.13 11:25
I'll repeate my post |