Higher time frame candlestick on a lower time frame chart

v10.3
Higher time frame candlestick on a lower time frame chart

This indicator allows you to draw higher TF candles in the price window.The period of the high TF candles is set in minutes (1 Hour 60, 4 hours 240, one day 1440 etc.)
The high TF candle is drawn as red or green rectangle. As it is not possible to fill a rectangle with color I just added a series of segments to “fill” the body of the candle.

The Heikin Ashi version is available here: Higher time frame Heikin Ashi candles on a lower time frame chart

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. rollem • 11/19/2018 #

    Thank you!

  2. Michael1973 • 11/19/2018 #

    Great! This is exactly what I was looging for. However, it does not work. I get an error message: “The following variable is not defined: Timeframeminutes”
    What do I do wrong? Thanks!

    • pableitor • 11/19/2018 #

      The timeframeminutes variable is an external variable to define the higher TF bars . If you download the *.itf file and import it , its plug&play. If you copy the source code to your program you should add the variable Timeframeminutes as an external variable to make it work.

  3. Victor.Strand • 11/19/2018 #

    Hola Pableitor
    Tuve ocasion de ver tu indicador hace tiempo, me parecio una obra de arte, seriamente… Yo estuve intentando hacer una modificacion en el indicador, que veo que no es posible… me refiero a que si uno representa el valor de open y del close en heikin ashi y en MTF (unicamente le das un valor al heikinashiopen y heikinashiclose, y le aplicas “return heikinashiopen, heikinashiclose”), en uno te da una linea multitimefame y en otra te sale una linea discontinua y no multitimeframe
    Sabes como se puede modificar eso, para que ambas salgan como lineas multitimeframe rectas, por ejemplo, si haces un MTF diario en velas de 1hora, y hay 23h (no 24) te saldria una vela recta en 23h como representacion del dia y luego un salto y linea recta para las siguientes 23hs…
    y porque no reconoce MTF en 1minuto, si lo hace en 2min (si usas segundos)? y como harias MTF diario en velas de 1hora, dado que a veces no coincide?

  4. Victor.Strand • 11/19/2018 #

    Hello Pableitor
    It wasgreat to see your indicator a long time ago, it looked like a work of art to me … I was trying to make a modification, which I see is not possible… if one represents the value of open and close in heikin ashi and in MTF (you only give a value to heikinashiopen and heikinashiclose, and apply “return heikinashiopen, heikinashiclose” to see it plotted on teh chart), it gives you a multitimeframe straight line but also an irregular line and not a multitimeframe for each of them (heikinashiopen, heikinashiclose).

  5. pableitor • 11/19/2018 #

    Hello Victor, I think I understand what you mean.. y’know this indicator was made with PRT 10.3 before the timeframe instruction was available in PRT 11. I will check it and try to update it to PRT 11 , it should be easy

  6. pableitor • 11/19/2018 #

    If you just want to return the higher time frame (1 day) OPEN & CLOSE lines over the lower time frame (1 hour) candles, just delete the RETURN and add this block of code :

    TIMEFRAME(1DAY, updateonclose)
    ONCE HA = 1 // HA = 1 for HEIKEN ASHI CANDLES , HA = 0 for NORMAL CANDLES
    ONCE XOPEN = OPEN
    ONCE XCLOSE = OPEN
    IF BARINDEX > 1 THEN
    xClose= HA * totalprice + not(HA) * close
    xOpen = HA * ( ( xClose[ 1] + xOpen[ 1])/2 ) + not(HA) * open
    ENDIF
    TIMEFRAME(DEFAULT)
    RETURN XOPEN as “HTF OPEN”,XCLOSE AS “HTF CLOSE”

    You can use it with HA candles or regular candles by changing the HA variable to 1 or 0
    Hope it helps !

  7. Victor.Strand • 11/19/2018 #

    Hey Pableitor, thx vm for the code, I just logged in for a minute, will try it later to show you what I mean, I still dont know how to post pics here, but basically its as if one wanted to put, instead of candles, a continuous line like an average, but for heikin ashi open, and close, with its respective color, and a median made of it. thanks a lot, you are an artist, your indicator are one of the best I have seen. Cheers, mate
    https://www.prorealcode.com/prorealtime-indicators/candle-mtf-on-price/

  8. pableitor • 11/19/2018 #

    ONCE HA = 0 // HA = 1 for HEIKEN ASHI CANDLES , HA = 0 for NORMAL CANDLES

    TIMEFRAME(1DAY)

    ONCE XOPEN = OPEN
    ONCE XCLOSE = OPEN
    IF BARINDEX > 1 THEN
    xClose= HA * totalprice + not(HA) * close
    xOpen = HA * ( ( xClose[ 1] + xOpen[ 1])/2 ) + not(HA) * open
    xHigh = high
    xLow = low
    CLOSEAVG = Average[10](Xclose)
    ENDIF
    TIMEFRAME(DEFAULT)
    RETURN XOPEN as “HTF OPEN” COLOURED (0,0,255) ,XCLOSE AS “HTF CLOSE” COLOURED (0,0,0) , XHIGH as “HTF HIGH” COLOURED(0,192,0), XLOW AS “HTF LOW” COLOURED (255,0,0), CLOSEAVG COLOURED(192,0,192)

    This code will just return the DAILY OPEN, HIGH, LOW, CLOSE and a 10 period moving average of the DAILY CLOSE in the 1 hour (or lower) Time Frame chart. The only daily value which remain constant in the hourly chart line is the OPEN value, because the other daily values CLOSE, HIGH AND LOW values may change until the final hourly candle 23h candle closes , you know.
    You can change the standar or heikin ashi OHLC values by settibg the HA flag to 0 or 1 respectively.
    Rgds

  9. Victor.Strand • 11/19/2018 #

    Hi Pableitor, How are you doing mate? Hope all is well… I had to change the code (with your premission) I had the same problem, the problem is to estimate or count the hours to get the correct daily candle and get the candle data, but couldt get the xopen and xclose via return line
    All I got was this, unfortunately xopen and xclose didnt show up as a constant line, but as irregular ones; also, if i used the code on a 10second chart but putting 1 minute timeframe, it returned nothing , but did got a chart if I switched it to “TimeframeHAminutes = 2 ”
    Anyway your indicator is excellent, its a pity I cannot get the 1minute and daily data using your code, it didnt pan out
    //Higher TF HA candles by pableitor 2018

    // — settings
    TimeframeHAminutes = 60 //higher TF minutes
    // — end of settings
    //TIMEFRAME(601DAY, updateonclose)
    ONCE HA = 1 // HA = 1 for HEIKEN ASHI CANDLES , HA = 0 for NORMAL CANDLES
    ONCE XOPEN = OPEN
    ONCE XCLOSE = OPEN
    IF BARINDEX > 1 THEN
    xClose= HA * totalprice + not(HA) * close
    xOpen = HA * ( ( xClose[ 1] + xOpen[ 1])/2 ) + not(HA) * open
    ENDIF
    TIMEFRAME(DEFAULT)

    //defparam calculateonlastbars=3000 //increase this number to get more history

    opd= openday

    if (openhour = 0) then
    opd = openday + 1
    endif

    once hightf = 0
    once lowtf = close * 100
    once ha=0

    Myminutes = opd*1440 + openhour*60 + openminute //total minutes since beginning of chart

    if (myminutes MOD TimeframeHAminutes < myminutes[1] MOD TimeframeHAminutes ) then //new HA candle
    opentf = open
    hightf = 0 //fake high
    lowtf = close * 100 //fake low
    haopen =( haopen[1]+haclose[1])/2
    hastart = barindex // position of new candle

    x1=hastart[1]
    x2=barindex[1]
    y1=haopen[1]
    y2=haclose[1]

    DRAWSEGMENT(x1,y1,x2,y1)coloured(r,g,0)
    DRAWSEGMENT(x1,y1,x1,y2)coloured(r,g,0)
    DRAWSEGMENT(x1,y2,x2,y2)coloured(r,g,0)
    DRAWSEGMENT(x2,y1,x2,y2)coloured(r,g,0)

    ha=1 // flag for first HA candle

    endif
    hightf = max(hightf,high)
    lowtf= min(lowtf,low)
    if ha = 0 then
    opentf = open //fake value when theres no HA candles
    endif
    if ha=0 then
    haopen = open
    endif

    haclose=(opentf+close+lowtf+hightf)/4

    r=0
    g=200
    if haclose<haopen then
    r=200
    g=0
    endif

    //DRAWCANDLE(haopen,haopen,haclose,haclose) COLOURED(R,G,0,40) BORDERCOLOR(R,G,0,40)

    DRAWCANDLE(xopen,xopen,xclose,xclose) COLOURED(R,G,0,40) BORDERCOLOR(R,G,0,40)

    return xopen as "xopen", xclose as "xclose"

    // https://www.prorealcode.com/prorealtime-indicators/higher-time-frame-heikin-ashi-candles-on-a-lower-time-frame-chart/

    //RETURN XOPEN as "HTF OPEN", XCLOSE AS "HTF CLOSE"

  10. Victor.Strand • 11/19/2018 #

    Hi Pableitor, I tried to run the code but it didnt work out, maybe due to a new PRT version? I cannot get the code MTF on 1 minute, yes in 2min but not on 1min in case I want to use tick or charts in seconds. Cheers, VS

  11. pableitor • 11/19/2018 #

    Hi Victor,
    I tried the following code in 1 second chart to get the 1 minute OHLC and it works !

    //***** START ****//
    ONCE HA = 0 // HA = 1 for HEIKEN ASHI CANDLES , HA = 0 for NORMAL CANDLES

    TIMEFRAME(1minute) // select here the high timeframe

    ONCE XOPEN = OPEN
    ONCE XCLOSE = OPEN
    IF BARINDEX > 1 THEN
    xClose= HA * totalprice + not(HA) * close
    xOpen = HA * ( ( xClose[ 1] + xOpen[ 1])/2 ) + not(HA) * open
    xHigh = high
    xLow = low

    ENDIF
    TIMEFRAME(DEFAULT)
    RETURN XOPEN as “HTF OPEN” COLOURED (0,0,255) ,XCLOSE AS “HTF CLOSE” COLOURED (0,0,0) , XHIGH as “HTF HIGH” COLOURED(0,192,0), XLOW AS “HTF LOW” COLOURED (255,0,0)
    //*** END **** //

    You cannot get higher timeframe values in tick charts because the ticks are asynchronous y’know ( not multiples of 1 minute or anything )

  12. SteveAMR • 11/19/2018 #

    Hi Victor, If I want to change the colour or brightness of the candles , how do I do that?
    R’s Steve

  13. Victor.Strand • 11/19/2018 #

    Hi Pableitor, steve
    Pableitor, hope you are fine. The thing is that when using the drawsegment and drawcandle command, one cannot get the chart in 1min as we did in the original code, its not a continous line, i mean, if we are on 15min timeframe chart and we set the inidcator timeframe on 60mins, the darwsegment and drawdcandle shall be a straight line for 4 candles (4candles x 15min = 1 candle 60min).
    Hi Steve
    I think you can change the brightness directly in the chart, no coding is necessary, just change the features in the platform
    DRAWSEGMENT(x2,y1,x2,y2)coloured(r,g,0)
    DRAWCANDLE(xopen,xopen,xclose,xclose) COLOURED(R,G,0,40) BORDERCOLOR(R,G,0,40)

  14. pableitor • 11/19/2018 #

    Thanks Victor for your comments and suggestions ! In fact this indicator is for PRT 10.3 , which had some limitations. These days I am rewriting it to PRT 11 , with the new timeframe and graphic instructions, should be finished very soon.

  15. Victor.Strand • 11/19/2018 #

    Hi Pableitor, the code is just great; i was playing a lil bit with these factors, darwsegment and drawcandle, the problem lies in centering the candle, in making y1=haopen and y2=haclose plotting lilke y1=haopen[1] and y2=haclose[1], I think it depends on PRT kernel maybe… but what I couldnt solve was the 1 min thing… sometimes 2min is better, its a proxy for 5mins, 1min has too much volatility and opportunities, but sometimes 2min is too big for a shorter TF like 3 or 5sec that is similar to a CME MBO (Market-By-Order) chart, ideal for scalping.

  16. micky_red • 11/19/2018 #

    Hi, I have tried to use this indicator in version 12 and it doesn’t work.

    Do you know how to adapt it so that it works well, or if there is another indicator that does the same and works correctly in version 12. Thank you.

    • Victor.Strand • 11/19/2018 #

      Hey Micky, indicator works well, justpaste the code on the platform, or save it as an “itf” file, and then try it. Delete “//” before “Timeframeminutes = 60”

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+1 more likes

Related users ' posts
ARNAUD20 J'ai, télécharger le logiciel : falling-and-rising-3-methods.itf : rien se passe sur le grap...
DeathMetal C'est un modèle assez rare, essayez-le sur un petit laps de temps, par exemple 5 minutes et ...
kats Bonjour, J'ai une question etes vous trader? Je m'explique , j'ai téléchargé tous les indi...
Alai-n Cela fonctionne très bien !!! Super Merci
andreabarbuscia Ciao Nicolas, molto bello questo indicatore, l'ho apprezzato molto. Lo sto testando insieme...
Alai-n Je poste ici un lien afin de mieux appréhender le CVD-Cumulative Volume Delta : https://www....
Nicolas
3 years ago
ipbvba Quelqu'un a t il pu créer un screener pour cet indicateur, cela serait très utile. Merci bea...
Nicolas Je pense que le code ci-dessous doit fonctionner pour un screener: //PRC_Wick Pressure | i...
Nicolas la dernière ligne doit être: screener[signal>0 or signal<0](signal)
Paris On est bien d accord que l indicateur repeint ....
Nicolas naturellement si la bougie du timeframe supérieur n'est pas terminé
ThePenntChemist Does this show 5min time frame?
Vinks_o_7 Hi Bruno Could you tell me where I can find more info about Laguerre candlesick please ?
Vinks_o_7 oops sorry did not see that one had to untick the standard Price to see your candle...
avatar
Anonymous This is very useful, look forward to testing it out. Thank you very much
IV Mcm Good job !
idunnomuch IS this working in the latest version of prorealtime? I get the indicator, but not over my c...
bernardmorel egalement apparait en dessous du graphique mais vide
bernardmorel Bonjour est t il possible de remettre en ligne the strat car il y a une indication qui d...
bibifricotin Je pense avoir compris dans la première colonne exemple 92 le 9 indique la période et le 2 ...
Leo_da_Pisa It seems to work very well. Good for confirmation. Thanks for sharing Vivien.
rama what is oohline
Vonasi From the indicator description above: 'The space between sessions can be either blank or hav...
amitoverseas40 Hi Vonasi, would you be kind enough to provide an indicator to only displays the wicks i.e. ...
denmar Awesome. Thank you.
Sapo Thank you very much. as always your indicators are extremely effective. kind regards Vonasi.
mitsu21 Hi, it looks nice. I'll try it tomorrow thank you for your share kind regards bruno
kj1988 Thank you Vonasi for sharing this indicator. Very useful as a comfirmation to the price act...
Wolf I don't know why the indicator does not work for me. It gives me an error about RETURN... ...
sergibilbo Great job thanks!!!
druby I was glancing through the code and noticed that the variable name, Middle' has been used. I...
Pablo Carmona del Moral hola juanjo, muchas gracias por este screener que nos has compartido. creo que lo voy a util...
Pablo Carmona del Moral para el volumen he cambiado: // Volumen significativo VS=volume>2*(average[10](volume[1...
Juanjo Muchas Gracias Pablo, ...Tengo varios screener, uno lo tengo adaptado para operar intradía, ...
RGKP Hi Vonasi, great work! But what I do not understand is that the statistics change according ...
mr_delta Hi https://www.prorealcode.com/user/vonasi/ I am interested in in scanning for a similar set...
Vonasi Minor Bug Fix Please download an updated version with a minor bug fix from here: https://www...
Jesper Great share!

Top