For both resolutions I have the settings on 365 days. But the data2 is displaying much more data (see attached pictures). The 1min chart starts at 20 feb 2012 till current date. The daily chart goes back to 13 sept 2011 to current date, although also the daily chart is set to 365 days. This is not ok I think?
The second problem I am having is to get the right values from the data2. In my strategy I use the following code to get the MACD values from data2.
Code: Select all
Close_data2 = close of data2;
If date <> date[1] then begin
MyMACD_day = MACD(Close_data2, MA_Fast_length, MA_Slow_length) of data2; // this is the MACD line
MyMACD_Avg_day = XAverage(MACD(Close_data2, MA_Fast_length, MA_Slow_length), MACD_Length)of data2; // This is MACD average line.
MyMACD_Diff_day = (MyMACD_day - MyMACD_Avg_day); // This is the MACDDiff line.
The values of the data2 on the combined chart of about the first 4 months of the total of 12 months are different then the MACD values that are on the seperate daily chart. After these 4 months the values are the same (minor round differences). So the code I am using is calculating the right values except for about the first 4 months. What can be the problem with these different values.
Can it have something to do with the daily data2 that has not the same starting date (although the settings are for the same period). Or is there a problem/bug with data2. Or do I have to adjust my coding?
any help appreciated.