Hourly Average plotted in Higher timeframe
Forums › ProRealTime English forum › ProBuilder support › Hourly Average plotted in Higher timeframe
- This topic has 28 replies, 5 voices, and was last updated 5 years ago by marcara.
-
-
05/14/2019 at 10:27 AM #98446
Hi,
I am trying to plot the 200 moving average of the hourly chart in higher timeframes; 4 hours chart for instance.
I have tried grapfhonprice as suggested in the example 2, but it is nt working; it claims:
https://www.prorealcode.com/documentation/graphonprice/
Example 212345678910111213141516171819202122232425262728293031323334timeframe(4 hours)mm7h4=average[7]mm20h4=average[20]mm50h4=average[50]boluph4=BollingerUp[20](close)boldnh4=BollingerDown[20](close)timeframe(1 hour)mm7h1=average[7]mm20h1=average[20]mm50h1=average[50]boluph1=BollingerUp[20](close)boldnh1=BollingerDown[20](close)timeframe(default)a = 0if a>0 thenbuy at marketendif// --- PLOT MTF INDICATORS ON PRICE CHART//4 hours indisgraphonprice mm7h4 coloured(200,200,0)graphonprice mm20h4 coloured(200,200,0)graphonprice mm50h4 coloured(200,200,0)graphonprice boluph4 coloured(200,200,0)graphonprice boldnh4 coloured(200,200,0)//1 hour indisgraphonprice mm7h1 coloured(0,200,0)graphonprice mm20h1 coloured(0,200,0)graphonprice mm50h1 coloured(0,200,0)graphonprice boluph1 coloured(0,200,0)graphonprice boldnh1 coloured(0,200,0)//etc.Thanks in advance for your help
05/14/2019 at 10:39 AM #98447It looks like it’s working fine on DAX, 30-minute TF.
05/14/2019 at 11:12 AM #9845005/14/2019 at 12:03 PM #9845905/14/2019 at 12:33 PM #9846405/14/2019 at 1:11 PM #9847405/14/2019 at 1:14 PM #98477It’s because you use timeframes that are not multiple of the lowest one, that on the chart.
If you use, say, a 20-minute TF on the chart, then you cannot refer TF’s like 30 minutes in your code.
What TF’s did you use?
05/14/2019 at 2:56 PM #98486Thansks
I have just copied the example 2 that it claims:
4 hours and 1 hour indicators plotted on the current chart.
I is wotking in 30 minutes and 1 hour chart but it is not working in 4 hours and daily chart.
I would like to plot the 200 hourly average in four hours chart and daily charts. What I should change?
Many thanks
05/14/2019 at 3:27 PM #98488As it has already been said, MTF requires the lowest TF on the chart!
So, in this case you can use it on any TF <= 1 hour provided 1 hours and 4 houra are multiples. You cannot launch it from a 17-minute TF, because 1 hour (60 minutes) and 4 hours (240 minutes) are NOT multiple of 17.
You CANNOT use it on any TF higher than 1 hour, since this is the lowest TF you use in your strategy.
By the way, what use it a 1-hour and 4-hour MA on a Daily TF? It’s fine the other way round.
1 user thanked author for this post.
05/15/2019 at 4:54 AM #9851805/15/2019 at 6:53 AM #98519I am not sure you understood the issue, you CANNOT use a higher TF as default.
You can plot a 4h TF’s indicators on a 1h TF, not the other way round!
Moreover, what use would be doing the other way round?
05/15/2019 at 9:41 AM #9853405/15/2019 at 10:12 AM #98540It is impossible to do, but in case you could do that, every 4 hours you would like to plot a 1-hor MA, which hour would you like to be plotted, out of for? That of the first hour, the second hour, the third or the last hour?
If you are in front of your 4-hour chart and you plot on it the 1-h MA from 2 hours before, does that make sense.
The other way round is true, if you are taking a glance at your 1-hour chart you may want to also plot the 4-hour MA to see what the price and indicators on higher TF are doing.
05/17/2019 at 4:05 AM #98667I woud like to plot the 1 hour average as it is in the 1 hour graph.
I found in another post another solution for the RSI that I do not know if it can be changed to apply to the simple average, thanks for your help.
RSI short timeframe to higher timeframe12345678910111213141516171819202122//higher timeframe minutes count//HigherTFminutes = 60//current timeframe minutes count//CurrentTFminutes = 5//RSI period to display//RSIperiod = 14if hour<>hour[1] thenc = closeendifcurrentRSI = RSI[RSIperiod](close)factor = ROUND(HigherTFminutes/CurrentTFminutes)MTFRSI = RSI[RSIperiod*factor](c)RETURN currentRSI as "current TF RSI", MTFRSI as "higher TF RSI"05/17/2019 at 7:20 AM #98672Just open the 1-hour chart, then add a moving average.
Have you found difficulties in trying?
-
AuthorPosts
Find exclusive trading pro-tools on