If some body want to check his/her idea using historical data, this mtf indicators does not help at all. It is better to improve MTF codes, so that in a certain time frame we got the MTF value according to his candel value.
If any body can modify the above code in order to get the real MTF value and his real drawing by each candel please share it.What are you talking about. The above code is fine. Does EXACTLY what you want.
Except:
- You MUST have history for that time frame
- You can't get bar zero data in the tester
What are you talking about. The above code is fine. Does EXACTLY what you want.
Except:
- You MUST have history for that time frame
- You can't get bar zero data in the tester
Hi WHRoeder,
Actualy i do not want to see the backtest results because of limited options in MT4. In the above code you will get only the last value of MTF indicator and if you like to compare other indicators with MTF indicator, you could not realize your strategy in the past. For example in the above picture by 9. August. In real time MTF RSI will give you various values relative to its last bar but if the higher time frame candles ( in this example is Period_D1) closed you will see only the value of the last closed bar of higher time frame. But i would like to modify the above code so that could record each bar value by MTF indicator. For this purpose i give you an advise.
" if your higher time frame is 1440 and your current timeframe is 60, so you have iClose(symbol(), 60, 0) = iClose (symbol(),1440, 0) but after closing of current time frame bar you do not have iClose(symbol(), 60,1) = iClose (symbol(),1440, 0). It means a frequency of values in a MTF indicator that must be redraw.
I have tried to modify it but i could only get this values for last day using the traditional RSI definition for MTF RSI with period 2 and Time frame 1440 on current time frame. see the below code. Unfortunately i could not make a serial code for making a MTF indicator like the above code. And the other days values mismatched.
while(k>=i) { rel_D1=(iClose(symbol(),1440 , 1)-iClose(symbol(),1440 , 2); if(rel_D1>0) sump_D1+=rel_D1; else sumn_D1-=rel_D1; rel=Close[k]-rel_D1 ; if(rel>0) sump+=rel; else sumn-=rel; k--; } positive=sump/RSIPeriod; negative=sumn/RSIPeriod; }
Hi there hmrt135
BB MTF.
Thank you very much, i will try your code. I hope it is what i am looking for.
hmrt135:
" if your higher time frame is 1440 and your current timeframe is 60, so you have iClose(symbol(), 60, 0) = iClose (symbol(),1440, 0) but after closing of current time frame bar you do not have iClose(symbol(), 60,1) = iClose (symbol(),1440, 0). It means a frequency of values in a MTF indicator that must be redraw.
I still don't understand your problem.
When the M60 bar closes iClose(NULL,1440,0) does not equal iClose(NULL,60,1).
When the M60 bar closes iClose(NULL,1440,0) equals iClose(NULL,60,0). STILL. And will be until the end of the day.
The D1 MTF indicator is still on the same D1 bar until midnight.
A D1 MTF indicator does NOT compute it's values based on the high/low of the last 24 H1 bars. It computes it's value on the D1 bars. The MTF indicator must NOT redraw after every H1 bar.
I suggest you bring up the indicator on a D1 chart and compare the D1 chart indicator values with the MTF indicator using D1 TF. They MUST match.
I still don't understand your problem.
When the M60 bar closes iClose(NULL,1440,0) does not equal iClose(NULL,60,1).
When the M60 bar closes iClose(NULL,1440,0) equals iClose(NULL,60,0). STILL. And will be until the end of the day.
The D1 MTF indicator is still on the same D1 bar until midnight.
A D1 MTF indicator does NOT compute it's values based on the high/low of the last 24 H1 bars. It computes it's value on the D1 bars. The MTF indicator must NOT redraw after every H1 bar.
I suggest you bring up the indicator on a D1 chart and compare the D1 chart indicator values with the MTF indicator using D1 TF. They MUST match.
Ok it is simple but difficult. So take a look at the above picture again. The last close price of current bar in H1 time frame is equal to last close price of current bar in D1. So in H1 time frame by Time[0] we have the value " 9.0875" for our MTF RSI indicator and this value will be changed until the end of current D1 bar and we see this value for the whole past H1 bar constant. But in the real it is not constant. Better to explain is the previous bar in H1 time frame. The value of MTF RSI indicator by previous bar in H1 is not the same value of the current bar in both H1 and D1. Also I want to modifiy the above code, so that the value of MTF RSI indicator by previous bar in the lower ( current ) time frame will be record and visible in history. I hope you understand what i mean. For Example the value of MTF RSI indicator by current bar in H1 time frame is " 9.0875" but this value for MTF RSI by the previous bar in H1 time frame is "8.9806". I want to get this values and not the last value of MTF indicator for entire of a day.
- last close price of current bar in H1 time frame is equal to last close price of current bar in D1Agreed
- The value of MTF RSI indicator by previous bar in H1 is not the same value of the current bar in both H1 and D1.
Wrong. The value of the MTF indicator will NOT change from the previous h1 bar to the current h1 one bar until the D1 bar is done. Your image shows the current H1 bar is at "10 Aug 16:00" and that is 8 hours before the end of the day.
- I hope you understand what i mean.I don't. The MTF bar should not change until the end of the day.
- RSI indicator by current bar in H1 time frame is " 9.0875" but this value for MTF RSI by the previous bar in H1 time frame is "8.9806"Your image shows that the RSI MFT value for the current bar AND the previous var is ~7.087. The value at 10 Aug 01:00, one H1 bar into the day is the same 7.087
- I don't know what you're talking about. Do what I previous said. post the RSI on the D1 chart and the MTF side by side and show the difference. There shouldn't be any on a live chart. There will be for the D1 zero bar in the tester as already referenced.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I like to discuss about Multi time frame indicators. There are many kinds of MTF indicators in WEB. By all of known MTF indicators we got the last available value in each time frame(see the picture) and the value will be constant until before last bars.
If some body want to check his/her idea using historical data, this mtf indicators does not help at all. It is better to improve MTF codes, so that in a certain time frame we got the MTF value according to his candel value.
The above picture shows the value of MTF RSI with period 2 and Daily time frame. The code of this indicator is below:
If any body can modify the above code in order to get the real MTF value and his real drawing by each candel please share it.
Many thanks