Yearly Quarterly Monthly Weekly Daily H4 H1 OHLC Lines – Last Bar Only Version

v10.3
Yearly Quarterly Monthly Weekly Daily H4 H1 OHLC Lines – Last Bar Only Version

This is an alternative version of the ‘Yearly Quarterly Monthly Weekly Daily H4 H1 OHLC Lines’ indicator that can be found here:

https://www.prorealcode.com/prorealtime-indicators/candlesticks-ohlc-yearly-quarterly-monthly-weekly-daily-h4-h1/

This version only draws the latest open, high, low and close lines and labels them so that you know which period they are drawn from and what price they are at.

As with the first version you can turn off any periods that you don’t want to see. You can also select whether you see just open and close lines or just high and low lines or all of them. You can also turn off the displayed price by using the ‘Values’ setting.

As with the first version you can set a look back period so that you can see the OHLC from any period. So you can plot lines from 2 months ago or 2 days ago or 3 weeks ago etc. By applying the indicator multiple times to a chart with different look back settings you can have for example the OHLC values from the last three months on the chart.

All lines are labelled with price first followed by the period in [ ] and then the look back period. The lines are colour coded as follows:

  • Open = light blue
  • High =  green
  • Low = red
  • Close = dark blue

So for example:

  • 1029.5 [D] 2 in green = the high from 2 days ago which was at a price of 1029.5
  • 1054.2 [H1] 1 in red = the low from the last hour which was at a price of 1054.2

This indicator can be used to recognize possible support and resistance levels and for breakout trading.

I recommend using this indicator alongside my ‘Last Two Highest High and Lowest Low as Horizontal Lines – Yearly Quarterly, Monthly, Weekly, Daily, 4 Hour and 1 Hour’ indicator. This will give you lines representing the extension of connecting the last two highs and last two lows of each period. The two indicators plotted on the same chart can show you levels that others may be looking at.  The labels in this indicator are not in [ ] so you can know whether you are looking at a horizontal OHLC line or the extension of a line connecting highs or lows when both indicators are on the same chart. That indicator can be found here:

https://www.prorealcode.com/prorealtime-indicators/last-two-highest-high-and-lowest-low-as-horizontal-lines-yearly-quarterly-monthly-weekly-daily-4-hour-and-1-hour/

I advise downloading and importing the ITF file to get full functionality.

 

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. Vonasi • 04/15/2019 #

    Change line 76 to if opendayofweek opendayofweek[1] and opendayofweek 0 then if you want Sunday data to be included with Friday data. This avoids Monday the lines being based on the normally small Sunday candle OHLC.

  2. Vonasi • 04/15/2019 #

    I just noticed that the above post makes no sense as the symbols have been removed. Here in English is what the conditions should be: IF opendayofweek is different to opendayofweek[1] AND opendayofweek is different to 0 THEN

  3. crolakstrading • 04/15/2019 #

    Hi Vonasi,
    Hope you are well.
    Above coding all works fine but on 4hr chart, 4hr lines don’t work.. this is only the 4hr chart.. any reason for that??

    • Vonasi • 04/15/2019 #

      It is a long time since I coded this. You may have found a coding error. At a glance I think the OPENHOUR settings might be wrong in line 48. Try changing OPENHOUR to HOUR and if that does not work I will check it tomorrow.

    • Vonasi • 04/15/2019 #

      Yes that was the issue. I have posted an updated ITF file here: https://www.prorealcode.com/topic/ohlc-y-m-w-d-h4-h1-last-bar-indicator-minor-fix/

  4. crolakstrading • 04/15/2019 #

    @vonasi Thank you for fixing the issue! This is a great indicator.

  5. gregoire • 04/15/2019 #

    good evening vonasi , I had made the request to create this indicator a few years ago and I gave up because I did not have the level nevertheless I use it since and I would like to take advantage of it. j would like to change the top preceding above higherhigh[1] and precede low by preceding lower lowerlow[1] on all ut !…it’s much more efficient… I do not use the 4H and 1H but instead I would like the 15MN and in the end we added little yh-yl,qh-ql,th-tl,mh-ml,dh-dl,15h-15l, it is better on the graph for colors if you could set them without entering the code as everyone does what he wants, I have an option to trace fibo that I little activated or not , I personally do not use it, on the other hand can we added a signal like an arrow when the candle closes above or below the set up 15 minutes?, and finally if you want to complete this indicator a scrrenner on the same basis having the choice of research C would be very effective.you do great work I would like to have your level for code that I like , I continue to learn every day thanks to the forum member… Thank you…

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Dave Hi, I'm new to coding and have been trying to modify the code a little to backtest an idea I...
Nicolas Better use the forums for coding assistance please. You'll get more results there for sure.
Dave Apologies - only just learning the site layout. Maybe you could delete the post?
Nicolas You can try this code for buy and hold curve line: capital = 10000 mylot = 2 i1 = capi...
soukenson Bonjour Nicolas, Je ne comprends pas où ajouter le code que tu as a donné dans le code initi...
Nicolas Tu veux parler du code pour comparer avec le "buy and hold" ? Si oui, tu as tout ce qu'il fa...
Nicolas FR/Bonjour Steftonio, non pas de frais overnight calculé sur la durée du backtest, c'est une...
avatar
Anonymous Any reason why in 2016 this system is doing very bad respect the previous years?
Nicolas "very bad" is relative to the account equity. I do not forward test this strategy since I po...
EAxelsson Hi, shouldn´t it be or instead of and? if FiftyTwoWeekHigh = FiftyTwoWeekHigh[1] OR FiftyTwo...
qigley Line 4 has a redundant term "Close>EMA2." is not necessary as EMA2 will always be less t...
Mike.44 Thanks It a good job !
Wisko But the BUY-trigger is below the High of the first two 15min-candels?
Nicolas That's right, because what we want is to enter the market quickly and not wait for the next ...
Wisko Then I don't understand the backtest data. Yesterday (28.9.) range was from ~ 4410,5 - 4450,...

Top