Yearly Quarterly Monthly Weekly Daily H4 H1 OHLC Lines

Yearly Quarterly Monthly Weekly Daily H4 H1 OHLC Lines

This indicator displays yearly, quarterly, monthly, weekly, daily, 4 hourly and 1 hourly OHLC (open, high, low and close) values on a price chart.

You can choose which OHLC values you want to display and also display just the high and low values or just the open and close values or all of them.

By changing the LookBack period you can display the OHLC values from any previous year, month week etc. When LookBack = 1 it displays on each candle values from the previous year, previous month, previous week etc. When LookBack = 2 it displays the values from two years ago, two months ago etc. With this feature if you add the indicator multiple times to your price chart you can for example display lines representing the last three months OHLC values.

The daily values are calculated starting at the open of the Monday candle to remove the issue of having Sunday OHLC values throughout Monday. You actually get the OHLC of Friday and Sunday combined shown on a Monday. The weekly values are calculated from the opening of the Sunday candle. If there is no Sunday or Monday candles then the week OHLC starts on whichever is the first trading day of that week.

The indicator can be used on any time frame chart but you have to have enough candles on a chart to display the values. The indicator has to be able to see a complete previous year from Jan 1st to Dec 31st before it can display any OHLC values for a year. The same for a month – it needs a whole month before it can display anything. Same for a week etc. It is not possible to display faster time frame OHLC values on a slower time frame chart. So you can’t have daily OHLC on a weekly chart for example.

It can be slow to draw if you want everything displayed on a lot of bars!

I suggest downloading the ITF file and importing it rather than cutting and pasting to ensure that you get full functionality.

Code written following the request made here: https://www.prorealcode.com/topic/conversion-tradingview-to-prorealtime-previous-ohlc/

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?

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

  1. vetrader • 187 days ago #

    Looks great. Thank you very much. I will test it during the next days!

  2. Vonasi • 185 days ago #

    Please note that there is a small bug in the indicator caused by a typo. Please delete ‘and openday[1] 7’ on line 75 (I’m not sure how it got there except for a cut and paste error!) Hopefully Nicolas will update the library post soon to remove this.

  3. vetrader • 184 days ago #

    Everything seems to work very well. But I would still recommend to pre-check everything if you change the timeframe in your chart. This is the best and most reliable code for previous OHLC….Thanks again!

  4. Vonasi • 184 days ago #

    The typo on line 75 has now been corrected in this library post and a new v1.1 ITF file attached. Thanks for doing that Nicolas.

  5. Balmora74 • 176 days ago #

    Thanks for this code but there is 4 different versions and i don’t know wich is the good one ?

  6. Vonasi • 176 days ago #

    I don’t understand. There is only one ITF file here not four. Download and import it. You might want to change line 75 to if opendayofweek opendayofweek[1] and opendayofweek 0 then as this means that small range Sunday bars are included in with Friday bars as per the description.

  7. Balmora74 • 174 days ago #

    Ok i understand now… I make a confusion with a other code… Thanks Vonasi.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Matriciel Well done Vonasi ! You have a lot of ideas. Personally, I work with Moving Averages only. ...
Bard Very interesting approach Vonasi! I'm getting a 404 error when trying to download though?
Vonasi I just tested and I was able to download with no error.
Vonasi Thanks for the compliments Maxime Baudin.
JJ Tec Muy interesante ¡¡¡... gracias X el aporte.
HStrader Thank you for your nice indicator
swapping Hello Thomas, good modification that improves the initial program ;)
Thomas Thanks swapping. That´s Teamwork ;-)
Jesper This looks very interesting. I'm getting an error though when trying to launch it - A positi...
Dari when I put the indicator does not put it on the price, sn in a new box like many indicators....
Nicolas by adding it on price instead. Use the wrench on the left upper side of your price chart.
Vonasi Change line 76 to if opendayofweek opendayofweek[1] and opendayofweek 0 then if ...
Vonasi I just noticed that the above post makes no sense as the symbols have been removed. Here in ...
dario ti Excellent, i was looking for something like that, but could be great if you add the option t...
DaxRider Thank U for ur sharing Vonasi
jandehaas Hello Vonasi, I tried it but it does not seem to work,any idea why ? Thanks,Jan defp...
dario ti Thank you!
Razz Hello Vonasi super indicator! is it possible to extend the indicator by the time scales M10 ...
Razz Hello Vonasi I found out myself how I can change it. Thanks again for the indicator
SL Hi, Fer666 Thank you for sharing. If I want to show daily ST on a 10_min intraday chart...
SL correction above... system had remove"not equal" signs Line 19 : change to if WeekNo "Not...
SL OK... I had figured out... need more than that. Thank you anyway.
Nicolas That's not possible because the code uses ZigZag instruction from the platform which is not ...
MrMUCKIE Thanks Nicolas. Do you have any idea of how I could generate support/resistance figures for ...
Nicolas Try fractals, swing high/low points, donchian channel, ..
Vonasi There is another version of this indicator that can plot the same lines but onto an indicato...
Martin35 Hello Vonasi, do you think it is possible with PRT to code with the same principle as on thi...
abhay I am getting a shading between the lines, how can I avoid that. I just want to see lines as ...
Vonasi Delete the 'Color Zone' in the indicator settings window.
Vonasi I can't help in Spanish! Maybe it is better to start a topic in the forums with your questions.
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...
Nicolas Bene, perché no, trovi che sia affidabile a lungo termine?
Billy Ray Valentine Non saprei, che ne dici di provare?
Steffen Schmauch hello Nicolas, can I change the indicator that I only get the time of 8-9 clock displayed? a...
s00071609 How would it be possible to call the Last Support Price and the Resistance Price from strategy?
robertogozzi Replace RETURN with RETURN SupportPrice,ResistancePrice. When you CALL they will be returne...
s00071609 Great thank you
Vonasi No problem pableitor - I'm glad you like it.
pableitor Hi Vonasi, I was checking a few random weeks with your indicator and sometimes it seems to ...
Vonasi I have not checked your query on a chart but my guess is that you are reading the indicator ...
Nicolas Peut-être à cause du manque d'historique. Celle-ci est utile pour limiter la quantité de ret...
s00071609 Would it be possible to use 2 or 3 points to do the calculations done in this case using zig...
Nicolas Sure, I suggest you open a new topic in the forum to discuss about your ideas.
Gianluca ok i fixed it i hope is ok like this: //TAC trader zone 10.2 | indicator //01.01.2018 //R...
TAC Bolsa Hello try this new version or view the blog with the new indicators .. https://www.t...
TAC Bolsa Sorry, TAC Trader Zone V2 https://www.tiburonesdealetacorta.com/2018/11/indicador-tac-tr...

Top