iMA() does not appear to work on diff TF than chart TF.

 

Running iMA with a TF of 60 min. on 15 min chart, something seemed not right . Plot values returned from it and values were scattered all over the chart.

Changed TF of chart to 60 mins, agreeing with value passed to iMA and dots were right on the iMA.

Plotted one of the values from the 15min chart on the 60 min chart and it was no where close to being correct.

In fact the value was outside of the Low[x] going back 2 days.

Has anyone run into this?

 
EnigmaTrader:

Running iMA with a TF of 60 min. on 15 min chart, something seemed not right . Plot values returned from it and values were scattered all over the chart.

Changed TF of chart to 60 mins, agreeing with value passed to iMA and dots were right on the iMA.

Plotted one of the values from the 15min chart on the 60 min chart and it was no where close to being correct.

In fact the value was outside of the Low[x] going back 2 days.

Has anyone run into this?

Were the other charts up to date? If the chart is not being displayed the data is not automatically updated. Some functions will cause the data to get updated, but I do not know if/where that is documented. It is safer to have all the required charts running in the same profile if you want data from them.
 

I find it hard to believe that I have to keep the other charts displayed, even minimized.

In the example i gave was 1 hour, I am running 4 hour time frame for iMA() on 15 min chart.

--------------------

Just checked the 4hr history is updating and the only reference to it is the iMA.

I would not think the data in there is bogus. No, does no look to be.

--------------------

I do not see how it can be running off the 4hr history. Had just assumed that MT4 would combine the bars to 4hr and walk it using the 15min incrememts.

 
EnigmaTrader:

I do not see how it can be running off the 4hr history. Had just assumed that MT4 would combine the bars to 4hr and walk it using the 15min increments.

If you look in the history folder, mine is C:\Program Files\MetaTrader\history\AlpariUK-Micro-1 for example, each chart has its own history file.
 
dabbler:
If you look in the history folder, mine is C:\Program Files\MetaTrader\history\AlpariUK-Micro-1 for example, each chart has its own history file.


Yes, i am well aware of that.

You miss read what i wrote.

 
EnigmaTrader:

Running iMA with a TF of 60 min. on 15 min chart, something seemed not right . Plot values returned from it and values were scattered all over the chart.

Changed TF of chart to 60 mins, agreeing with value passed to iMA and dots were right on the iMA.

Plotted one of the values from the 15min chart on the 60 min chart and it was no where close to being correct.

In fact the value was outside of the Low[x] going back 2 days.

Has anyone run into this?

Hi EnigmaTrader,

Here's Bollinger Band MTF, it looks like staircase, coz it does not take data from plotted chart

:D

Files:
bandkmtf.mq4  6 kb
 
for(i=limit; i>=0; i--)
{
  buffer1[i] = iMA(NULL,PERIOD_H1,14,0,MODE_EMA,PRICE_MEDIAN,i)

If you use iMA in a regular indicator loop as above you need to pay attention to what i is doing when the indicator is drawing the chart history.

For example when i=48: indicator draws at bar 48 on your 15 minute chart, which is 12 hours ago, at that time your indicator is also the same i=48 to get its values from the hourly chart .... MA calculated from 48 hours old values plotted on price bars only 12 hours old doesnt work too well.

Reason: