Download MetaTrader 5

Higher Time Frame Indicator

To add comments, please log in or register
Learn operation principles of Trading Signals for MetaTrader.
tparimore
112
tparimore 2014.10.15 01:22 

Can someone tell me if it is possible to add a 5 min MACD to a 1 min chart and have it look as if you where looking at it on the 5 min chart? By simply changing the timeframe to 5 with in the code yields the desired look on initialization and when I change to a higher timeframe chart and back to the M1 chart. But, on a new one minute bar it stops looking like a 5 min MACD. I know I can use  iBarShift(NULL, MA_HTF, Time[i], false) to produce a stair step MACD. But, I want it to look smooth and not have to change back and forth between timeframes.

Kind Regards,

Tom


P.S. I am talking MT4

Drazen Penic
2545
Drazen Penic 2014.10.15 03:32  

On M5 chart one bar is 5 minutes and for that bar indicator has only one value.

On M1 chart there are 5 bars in 5 minutes.

So, you have one M5 value and you have to project that value on 5 M1 bars. 

Other than just copying M5 value to those 5 bars, what would be, in your opinion,  "sensible" mapping function that will project M5 indicator value to M1?

If you can't find such function, then you will have to live with steps. 

Ernst Van Der Merwe
4736
Ernst Van Der Merwe 2014.10.15 07:44  
iBarShift(NULL,_Period,Time[i]);
Should work?
whroeder1
14543
whroeder1 2014.10.15 12:35  
tparimore: Can someone tell me if it is possible to add a 5 min MACD to a 1 min chart and have it look as if you where looking at it on the 5 min chart?
It's called a multi-timeframe indicator. (MTF) search the Code Base
tparimore
112
tparimore 2014.10.16 03:29  
WHRoeder:
tparimore: Can someone tell me if it is possible to add a 5 min MACD to a 1 min chart and have it look as if you where looking at it on the 5 min chart?
It's called a multi-timeframe indicator. (MTF) search the Code Base

I am sorry I must not have been clear. I have searched the code base and I have only been able to find how to produce a MTF indicator using iBarshift. But, that cause a stair step result. Let me include a couple of pictures. To illustrate what I am saying.


Picture 1 shows what I desire. I want a 5 min MACD on the 1 min chart as seen below. Notice that the MACD looks identical on the M1 and M5 chart. But they are only identical on initialization and after changing to another TF then back to M1. I know M1 price and histogram doesn't match and that's ok.

M5 MACD on M1 Chart


What I am trying to avoid is the stair step view as seen in picture 2.


Thanks Again,

Tom

Alain Verleyen
Moderator
30754
Alain Verleyen 2014.10.16 07:15  
tparimore:

I am sorry I must not have been clear. I have searched the code base and I have only been able to find how to produce a MTF indicator using iBarshift. But, that cause a stair step result. Let me include a couple of pictures. To illustrate what I am saying.


Picture 1 shows what I desire. I want a 5 min MACD on the 1 min chart as seen below. Notice that the MACD looks identical on the M1 and M5 chart. But they are only identical on initialization and after changing to another TF then back to M1. I know M1 price and histogram doesn't match and that's ok.


What I am trying to avoid is the stair step view as seen in picture 2.


Thanks Again,

Tom



From what we can see on your picture1, you already have it, not ?
Ernst Van Der Merwe
4736
Ernst Van Der Merwe 2014.10.16 09:11  
angevoyageur:
From what we can see on your picture1, you already have it, not ?
I think what the OP is suggesting is he doesn't want the bars from higher timeframe to shift 1 to the left when a new bar is formed on chart timeframe, only when a new bar is formed on higher timeframe, which I don't think is possible?
honest_knave
Moderator
2241
honest_knave 2014.10.16 09:55  

Is this describing what you are after?

 

tparimore
112
tparimore 2014.10.16 11:53  
honest_knave:

Is this describing what you are after?

 

Yes, exactly. However, It will only look like that (match the M5 MACD) when I     1.) first add the indicator 2.) compile on the code  or 3.) change from M1 to any other TF and back to M1. If you stay on the M1 chart the MACD deviates in appearance with each new bar. 
whroeder1
14543
whroeder1 2014.10.16 13:25  
tparimore: Can someone tell me if it is possible to add a 5 min MACD to a 1 min chart and have it look as if you where looking at it on the 5 min chart?
tparimore: What I am trying to avoid is the stair step view as seen in picture 2.

There is only one value per bar. So If you want the M5 indicator value on the M1 chart there must be a stair step. Same M5 value on 5 M1 bars.

It makes no sense to me to put M5 bar 5 (30 minutes ago) value on a M1 chart (6 minutes ago)

tparimore
112
tparimore 2014.10.16 15:48  
WHRoeder:

There is only one value per bar. So If you want the M5 indicator value on the M1 chart there must be a stair step. Same M5 value on 5 M1 bars.

It makes no sense to me to put M5 bar 5 (30 minutes ago) value on a M1 chart (6 minutes ago)

Right or Wrong, I like to see if the signal line is coming in asymptotic or at a nice angle when it approaches zero. A stair-step line always looks like a shallow angle.

 

Below is a picture of an RSI being shown across all time frames as they would appear (not stair-step). I think what I am looking to do is possible?  ---Tom

 

12
To add comments, please log in or register