Page 1 of 1

Tickstory 1.9 - ATR with weekly period not working

PostPosted: Fri Oct 26, 2018 11:46 am
by peterm
My EA runs on the daily timeframe but makes a call to iATR using the weekly period PERIOD_W1. This all works fine with Tickstory 1.8.9.2, but on the latest 1.9 release, the iATR function is returning a zero value using the weekly timeframe. Please advise.

Re: Tickstory 1.9 - ATR with weekly period not working

PostPosted: Fri Oct 26, 2018 10:20 pm
by tickstory
Hi Peter,

Nothing relating to data generation that should affect indicator values between this version. To try narrow down the possible causes, did you re-generate your export again after upgrading? If so, did you re-generate a different range of data (or perhaps not enough to give you the ATR value?). Did you change Metatrader versions in-between? If you have the older version of Tickstory still available, you can try re-generate the export again (using the same date range) which should discount any differences between versions.

Thanks.

Re: Tickstory 1.9 - ATR with weekly period not working

PostPosted: Tue Oct 30, 2018 5:03 pm
by peterm
I have tried the following tests.

1. Complete download of EURUSD data using Tickstory v1.8.9.1 - EA functions correctly.

2. Complete download of EURUSD data using Tickstory v1.9.1.0 - EA does not work as iATR(NULL,PERIOD_W1,1) returns a zero value on the daily timeframe.

3. Transfer EURUSD .fxt data from v1.9.1.0 to history folder on PC with Tickstory v1.8.9.1 and retest using Tickstory v1.8.9.1 - EA functions correctly.

These tests would therefore suggest that the problem does occur with Tickstory v1.9.1.0. Please advise.

Re: Tickstory 1.9 - ATR with weekly period not working

PostPosted: Tue Oct 30, 2018 5:13 pm
by peterm
In response to your questions, I carried out the test on two separate PCs, both running MT4 build 1090, one with Tickstory 1.8.9.1 and one with Tickstory 1.9.1.0. I regenerated the data on both PCs and ran the test from 1/1/17 to 24/10/18, so there should be no problem calculating the weekly ATR. I ran a visual test with 1.9.1.0 to monitor the value of iATR(NULL,PERIOD_W1,1) on the daily timeframe and this confirmed that the value returned is zero.

Re: Tickstory 1.9 - ATR with weekly period not working

PostPosted: Tue Oct 30, 2018 10:35 pm
by tickstory
Hi Peterm,

Thanks for the further information. We have tried to reproduce your issue on Metatrader 1090 and Build 1126, by doing the following:

1) Exporting EURUSD from 1/1/2017 to 30/10/2018 using Tickstory v1.9.1.
2) Adding the following code to an EA's OnTick method:

Code: Select all
   if(Bars<10)
     {
      Print("bars less than 10");
      return;
     }
     Print("ATR:  ", iATR(NULL,PERIOD_W1,1,0));


3) Starting a Strategy Test in the 'Daily' time-frame with no Begin or End dates set.
4) Checking the 'Journal' for the output. The ATR is always non-zero in the test.

Could you please check the following:

- Ideally, if you could upgrade to Metatrader 1126 so we can discount any problems with the particular version you are using. I noticed that the ATR formula you gave will not compile without an extra ",0" at the end. This parameter denotes the 'shift' (see https://docs.mql4.com/indicators/iatr). Perhaps this was a typo?
- Are there any other differences between your 2 machines such as the EA version?
- When you say in Step 3) that you "Re-tested using Tickstory v1.8.9.1", exactly what did you do after copying the FXT file? Are you referring to launching with v1.8.9.1? If so, could you omit this step to discount any effect in Tickstory? For the record, the launch step does not change any of the back-testing calculations.

After upgrading to the latest MT4, could you please try running the above code in a new EA so we can narrow down the issue if it is still occurring?

Thanks.

Re: Tickstory 1.9 - ATR with weekly period not working

PostPosted: Thu Nov 01, 2018 9:44 pm
by peterm
Thanks for your quick response. I have now resolved this issue and have it working with Tickstory 1.9.1.0 and MT4 Build 1090. I manually deleted the raw tick data in the Tickstory folder and did a complete data download followed by an Export. After this iATR() is now returning a non-zero value. I was under the impression that a download would overwrite the data in the Tickstory folder, but it seems that this is not the case.

Re: Tickstory 1.9 - ATR with weekly period not working

PostPosted: Fri Nov 02, 2018 9:26 pm
by tickstory
Great to hear it's solved, Peterm. Tickstory does not re-download data from the internet unless it is missing.

Regards.