MULTI TIME FRAMES : 5min candles on 1min chart
Forums › ProRealTime English forum › ProBuilder support › MULTI TIME FRAMES : 5min candles on 1min chart
- This topic has 12 replies, 2 voices, and was last updated 2 years ago by financier.
-
-
03/08/2018 at 12:47 PM #64789
Hi,
Here is my attempt to overpass PRT’s unability to deal with MultiTimeFrame strategies.
I started by simply coding the 5min candles on a 1min chart (ie. : here on DAX).
The code could probably be optimized but it works as far as I can see.
I will be happy to hear your comments, questions and thoughts.
BR,
Diplaying 5 min candles on 1 min chart12345678910111213141516171819202122232425262728293031323334353637383940414243HORSSECONDE=100*(round(time/100))MUNITE=((HORSSECONDE/10000 - round(HORSSECONDE/10000))*100)-1if MUNITE<0 thenMUNITE=((HORSSECONDE/10000 - (round(HORSSECONDE/10000)-1))*100)-1endifif MUNITE=99 thenMUNITE=59endifRESTE=5*(MUNITE/5 - (round(MUNITE/5)-1))if reste>=5 thenreste=reste-5endifif reste=0 thenouverture=opencloture=closehaut=highbas=lowelsif reste=1 thenouverture=open[1]cloture=closehaut=max(haut,high)bas=min(bas,low)elsif reste=2 thenouverture=open[2]cloture=closehaut=max(haut,high)bas=min(bas,low)elsif reste=3 thenouverture=open[3]cloture=closehaut=max(haut,high)bas=min(bas,low)elsif reste=4 thenouverture=open[4]cloture=closehaut=max(haut,high)bas=min(bas,low)endifreturn ouverture as "OPEN", cloture as "CLOSE",haut as "HIGH",bas as "LOW"5 users thanked author for this post.
03/08/2018 at 1:49 PM #64795Nice approach. I do not tested yet. It is possible to draw box and lines in the chart. Nicolas has made it somewhere with renkt candles.
1 user thanked author for this post.
03/08/2018 at 1:56 PM #64796Thanks a lot toto!
Or you can also draw a candlestick updated, each minute, example with your code:
123456789101112131415161718192021222324252627282930313233343536373839404142434445HORSSECONDE=100*(round(time/100))MUNITE=((HORSSECONDE/10000 - round(HORSSECONDE/10000))*100)-1if MUNITE<0 thenMUNITE=((HORSSECONDE/10000 - (round(HORSSECONDE/10000)-1))*100)-1endifif MUNITE=99 thenMUNITE=59endifRESTE=5*(MUNITE/5 - (round(MUNITE/5)-1))if reste>=5 thenreste=reste-5endifif reste=0 thenouverture=opencloture=closehaut=highbas=lowelsif reste=1 thenouverture=open[1]cloture=closehaut=max(haut,high)bas=min(bas,low)elsif reste=2 thenouverture=open[2]cloture=closehaut=max(haut,high)bas=min(bas,low)elsif reste=3 thenouverture=open[3]cloture=closehaut=max(haut,high)bas=min(bas,low)elsif reste=4 thenouverture=open[4]cloture=closehaut=max(haut,high)bas=min(bas,low)endifdrawcandle(ouverture,haut,bas,cloture)return3 users thanked author for this post.
03/08/2018 at 7:57 PM #64847Would it be possible to have more explanation on the composition of the code? Because visually it’s very clean, but I do not see any correlation with the actual range of candles 1 Minute …
Some tracks for its use would be welcome!Good night
03/08/2018 at 8:30 PM #6484803/08/2018 at 11:04 PM #64859I’m struggling a little bit to understand the code because I am a stupid Englishman who speaks only a tiny little bit of each language (I can order a beer)! Could someone adapt this to show weekly candles on a daily chart and save me a lot of effort doing Google translate? Sorry but I am a lazy Englishman as well as a monolingual Englishman!
03/09/2018 at 9:18 AM #6488103/09/2018 at 3:16 PM #64911Thanks for your comments.
Code could be simplified as the function “MINUTE” exists in PRT.
Code is just here to show that even if MTF is not available yet on PRT, there are ways to overpass this… I am rather scalper than day trader so that I do not need weekly/daily charts in general. But it might not be so difficult to code as well.
07/26/2018 at 9:17 PM #76843Hello,
Can you please tell me how I would set an alert for when the ‘candlesticks’ go bullish to bearish and vice versa.
I am using the indicator that has the slightly modified code from Nicolas
drawcandle1drawcandle(ouverture,haut,bas,cloture)Grateful for any replies, thank you.
Kat
07/27/2018 at 8:57 AM #76858Hello,I take back my question, I see how to add the alert using the original code.KatHello,
Can you please tell me how I would set an alert for when the ‘candlesticks’ go bullish to bearish and vice versa.
I am using the indicator that has the slightly modified code from Nicolas
drawcandle
1drawcandle(ouverture,haut,bas,cloture)Grateful for any replies, thank you.
Kat
11/14/2022 at 1:35 PM #204144Thank you for your very useful code Toto.
I scalp the Nasdaq futures and was wondering if it was possible to adapt it, or create something similar, for use on a 1 second chart with 5 or 15 second candles.
I have been trying to do so, but with no success.
Thank you.
11/14/2022 at 4:12 PM #204158Hi @financier
You can now use the different time frames…
When you want to have 10 second candles in a graph with a time frame of 1 second:
TimeFrame(10 seconds, UpdateOnClose)
DrawCandle(Open, High, Low, Close)
Return
(So, open this indicator in a graph with a time frame of 1 second…)
1 user thanked author for this post.
11/15/2022 at 1:53 PM #204213 -
AuthorPosts
Find exclusive trading pro-tools on