Page 1 of 1
Issue Technical Indicator Functions
Posted: Fri Dec 13, 2019 10:29 am
by TienDuong
Hi there .
All group of Technical Indicator Functions not work when i change "timeframe paremeter" of function.
I have exported data from tickstory symbol "EURUSD" timeframe only "H1" .
Then I backtest in Model : Everyticks , timeframe : H1 .
Funtions iMA with timeframe paremeter = PERIOD_H1 went well .
But when i change paremeter to other example : PERIOD_D1 , PERIOD_W1 ... funtion return value = 0 .
I need get value of indicator on mutil timeframe . How to solve this. Thank you .
Code: Select all
double maH1 = iMA ( NULL , PERIOD_H1 , 20 , 0 , MODE_EMA , PRICE_CLOSE , 1 ) ;
double maD1 = iMA ( NULL , PERIOD_D1 , 20 , 0 , MODE_EMA , PRICE_CLOSE , 1 ) ;
Print (maH1 , " " ,maD1 ) ;
Re: Issue Technical Indicator Functions
Posted: Fri Dec 13, 2019 9:36 pm
by tickstory
Hi TienDuong,
If the lower time-frames work (<= H1) but the greater time-frames do not, it is possible that you haven't exported enough data to calculate the MA for that time-frame. For a 20-day moving average, you will obviously need at least 20 days of prior data before the average can be calculated. For example, if you are printing the MA for 1st Jan and your exported data starts at 1st Jan, the MA cannot be calculated. It should start printing iMA values after the 20th of Jan.
Hope this helps.
Re: Issue Technical Indicator Functions
Posted: Sat Dec 14, 2019 3:00 am
by TienDuong
Thank for your help .
I have export data from 2003.05.05 to 2019.12.03 . Then backtest started on 2004.01.01 , so i think prior data before is enough to caculator MA . I also wait backtest to 2004.01.23 and it still return same value .
I also have tried lower time-frames but it not worked . Do you have any idea in this case ?. Thank for help .
Code: Select all
maM5 = iMA ( NULL , PERIOD_M5 , 20 , 0 , MODE_EMA , PRICE_CLOSE , 1 ) ;
maH1 = iMA ( NULL , PERIOD_H1 , 20 , 0 , MODE_EMA , PRICE_CLOSE , 1 ) ;
maD1 = iMA ( NULL , PERIOD_D1 , 20 , 0 , MODE_EMA , PRICE_CLOSE , 1 ) ;
Print ("maM5 = " , maM5, " maH1 = " , maH1 , " maD1 = " ,maD1);
Code: Select all
2019.12.14 09:16:03.972 2004.01.02 16:03:23 test-ea USDJPY,H1: maM5 = 0 maH1 = 107.0101 maD1 = 0
2019.12.14 09:16:03.972 2004.01.02 16:03:22 test-ea USDJPY,H1: maM5 = 0 maH1 = 107.0101 maD1 = 0
2019.12.14 09:16:03.972 2004.01.02 16:03:22 test-ea USDJPY,H1: maM5 = 0 maH1 = 107.0101 maD1 = 0
2019.12.14 09:16:01.774 2004.01.01 00:00:00 test-ea test started
2019.12.14 09:16:01.641 TestGenerator: server "FxPro.com-Demo04" differs from "SimpleFX-DemoUK" terminal connected to
2019.12.14 09:16:01.641 TestGenerator: symbol USDJPY period 60 model 0 from 2003.05.05 to 2019.12.03
2019.12.14 09:16:01.640 TestGenerator: file "C:\Users\Admin\AppData\Roaming\MetaQuotes\Terminal\E5A4E68F1B7E15DF3B06ED6AF0EC4859\tester\history\USDJPY60_0.fxt" is read-only
2019.12.14 09:15:38.691 TestGenerator: no history data 'USDJPY60' from 2004.01.01 to 2019.01.01
2019.12.14 09:15:36.638 Expert test-ea USDJPY,H1: loaded successfully
2019.12.14 09:15:36.627 Expert test-ea USDJPY,H1: removed
Code: Select all
2019.12.14 09:16:05.728 2004.01.27 19:32:13 test-ea USDJPY,H1: maM5 = 0 maH1 = 105.8748 maD1 = 0
2019.12.14 09:16:05.728 2004.01.27 19:32:13 test-ea USDJPY,H1: maM5 = 0 maH1 = 105.8748 maD1 = 0
2019.12.14 09:16:05.728 2004.01.27 19:32:08 test-ea USDJPY,H1: maM5 = 0 maH1 = 105.8748 maD1 = 0
2019.12.14 09:16:05.728 2004.01.27 19:32:05 test-ea USDJPY,H1: maM5 = 0 maH1 = 105.8748 maD1 = 0
2019.12.14 09:16:05.478 2004.01.23 16:02:37 test-ea USDJPY,H1: maM5 = 0 maH1 = 106.0579 maD1 = 0
2019.12.14 09:16:05.478 2004.01.23 16:02:36 test-ea USDJPY,H1: maM5 = 0 maH1 = 106.0579 maD1 = 0
2019.12.14 09:16:05.478 2004.01.23 16:02:36 test-ea USDJPY,H1: maM5 = 0 maH1 = 106.0579 maD1 = 0
2019.12.14 09:16:05.478 2004.01.23 16:02:35 test-ea USDJPY,H1: maM5 = 0 maH1 = 106.0579 maD1 = 0
Re: Issue Technical Indicator Functions
Posted: Sat Dec 14, 2019 9:11 am
by TienDuong
I have discovered one thing .
If I export data with short time about 1 year or 2 year , Indicator Functions works
But when I export bigger data about 10 year , it doesn't word.
This error executed on a data more than 2 years or 5 years.
How to solve this. Thank you .
Re: Issue Technical Indicator Functions
Posted: Sun Dec 15, 2019 2:20 am
by tickstory
Hi TienDuong,
You could be coming across a limitation that on the amount of data that the MT4 Strategy Tester can handle in one go. Could you please try keep your FXT (tick data) files under 4GB and see if this resolves the issue for you?
Thanks.