Forex Factory (https://www.forexfactory.com/forum.php)
-   Platform Tech (https://www.forexfactory.com/forumdisplay.php?f=69)
-   -   Daily high/low histogram indicator (https://www.forexfactory.com/showthread.php?t=727439)

hanover Jan 3, 2018 2:14pm | Post# 1

Daily high/low histogram indicator
 
3 Attachment(s)
NOTE: I have left Forex Factory, so don't expect replies to your posts. You can find an index to all my indicators and posts here.

Daily high/low histogram indicator: Terms and Conditions

 All code is supplied FREE of charge. It may NOT be sold or distributed commercially. Unless otherwise shown, no source code is available.

 Software is offered on an 'as is' basis. I'm not offering a programming or troubleshooting service.

 There is no guarantee that the software is fit for purpose, or free of errors. Download and use the indicator(s) at your own risk; I accept no liability for computer damage or financial losses.
___________________________

I've finally decided to share this indicator publicly. It's not a holy grail; it simply is what it is. It looks back over as much H1 price history as you specify, ascertains during which hour(s) of the day (00-23 MT4 time) the daily high and low occurred -- both the high and low add 1 to the count for each hour -- and then plots a frequency histogram in a new chart sub-window. It's designed to work best on a M15 (or shorter TF) chart. See screenshot:Click to Enlarge

Name: PPI 781.png
Size: 52 KB
The indicator is designed to work on the 28 major currency pairs; using it on exotics, metals, indices, cryptocurrencies, etc may cause unpredictable results.

If you leave CurrencyPair blank, it defaults to the current chart's instrument.

PlotbackDays is the number of days backwards from the current date that you want the histogram to be plotted. (Obviously the same size histogram bar gets plotted for the same time each day) .

StartDate is the date from which you want the history to be searched. The earlier this date, the longer the indicator takes to perform the necessary calculation, before the histogram is initially plotted.

A numeric value can also optionally be plotted above each histogram bar. TextCalcBasis determines what this value is, as follows:
 0 = histogram bars only; no values (text) will be plotted
 1 = the actual number of highs or lows that occurred during each hour will be printed
 2 = the number of highs/lows will be converted to a percentage, for example a value of 167 means that a high or low occurred during this hour 16.7% of the time (the decimal point is omitted to save space)
 3 = the hour during which the greatest number of highs/lows occurred is set to 100, and the other values are scaled proportionally, and then rounded to the nearest whole number

Press Ctrl-Y to toggle the day separators (vertical dotted lines) on/off.

Daily H-L histogram.ex4NOTE: This indicator was written using MetaEditor/compiler build 509. If you want the .mq4 source to compile/run without errors, you'll need to do this first. Otherwise, download only the .ex4 file.Daily H-L histogram.mq4

alphadude Jan 3, 2018 2:19pm | Post# 2

interesting indicator

jmn5611 Jan 3, 2018 4:09pm | Post# 3

Daily high/low histogram indicator I've finally decided to share this indicator publicly. It's not a holy grail; it simply is what it is. It looks back over as much H1 price history as you specify, ascertains during which hour(s) of the day (00-23 MT4 time) the daily high and low occurred -- both the high and low add 1 to the count for each hour -- and then plots a frequency histogram in a new chart sub-window. It's designed to work best on a M15 (or shorter TF) chart. See screenshot:{image} The indicator is designed to work on the 28 major currency...
Thanks hanover, it confirms that the high and lows of the E/U are indeed made during the London session.

ReverseFlash Jan 3, 2018 4:33pm | Post# 4

Very interesting indeed.

Thanks for sharing!


alphadude Jan 3, 2018 5:03pm | Post# 5

Hi hanover; how do you recommend trading this indicator?

i assume from the indy description is you take a mean reversion trade of daily high/low at the hours with highest frequency of occurrences.

best

hanover Jan 3, 2018 5:13pm | Post# 6

1 Attachment(s)
it confirms that the high and lows of the E/U are indeed made during the London session.
I think it's actually the US session, the percentages are shown in the screenshot:
Click to Enlarge

Name: PPI 782.png
Size: 50 KB

alphadude Jan 3, 2018 5:20pm | Post# 7

2 Attachment(s)
a while back; I did create a report of daily High/Low of any instrument; and statistically when it is likely that the daily High or Low would have been made; using probabilities.

attached is an example; for EURUSD, from 2012 to 2018; where it is showing that by GMT 15:00; the daily High or Low for EURUSD would have been made already with 98% probability. indicating you could potentially do some reversal trades within the daily range; especially if the price was nearing the edge of the daily range.

the second chart; showing the occurrence of High or Low frequency of each hour of day (pretty much the same as Hanover indicator).
Note that either GMT 00:00-01:00 or GMT 14:00-15:00 have the highest frequency
Click to Enlarge

Name: eurusd-daily-high-low.png
Size: 19 KB
Click to Enlarge

Name: eurusd-daily-high-low2.png
Size: 15 KB

hanover Jan 3, 2018 5:48pm | Post# 8

how do you recommend trading this indicator? i assume from the indy description is you take a mean reversion trade of daily high/low at the hours with highest frequency of occurrences.
When I was trading intraday I used it as perhaps a lesser piece of a total puzzle, combining it with S/D zones/orderflow, M15 climax volume candles, current daily move so far with respect to ADR i.e. 'overbought/sold', some basic PA (engulfing, pinbar, pclose(x)**, etc), recent D1 candles for overall trend/sentiment, and news considerations. Confluence of a few of those frequently gave a lowish risk entry.

[**pclose(x) is simply a candle close higher than the last x candle highs in a downmove, confirming a possible reversal; mirror image for upmove.]

a while back; I did create a report of daily High/Low of any instrument; ....
Indeed, these kind of statistics can be helpful.

hanover Jan 3, 2018 6:55pm | Post# 9

This is what I saw.
I'm running Pepperstone MT4 rather than Oanda. I'm not sure that it should make a big difference, but I expect there would be some variations in the historical data.

The numbers on your histogram bars (3, 4, 4, 3,...) are much lower than mine (71, 33, 26, 40,...), I don't know if they are somehow being truncated, or if it reflects a lack of historical H1 data. If I zoom out on my chart, the numbers tend to squash together and overlap unreadably, rather than reduce to single digits.

I guess it's also possible that there's a bug in the code, but I've been running the indicator for several months now, and I did test it fairly thoroughly when I first wrote it.

jmn5611 Jan 3, 2018 10:15pm | Post# 10

1 Attachment(s)
{quote}I'm running Pepperstone MT4 rather than Oanda. I'm not sure that it should make a big difference, but I expect there would be some variations in the historical data. The numbers on your histogram bars (3, 4, 4, 3,...) are much lower than mine (71, 33, 26, 40,...), I don't know if they are somehow being truncated, or if it reflects a lack of historical H1 data. If I zoom out on my chart, the numbers tend to squash together and overlap unreadably, rather than reduce to single digits. I guess it's also possible that there's a bug in the code,...
Okay, I compressed the chart. And I deleted my original post. I'm paranoid.
Click to Enlarge

Name: EURUSDM15.png
Size: 66 KB

Hmsr Jan 3, 2018 10:23pm | Post# 11

{quote} I think it's actually the US session, the percentages are shown in the screenshot: {image}

Hello Hanover, that's a really nice sessions indicator you have on the bottom window. Would it possible for you to share that indicator?

hanover Jan 3, 2018 11:04pm | Post# 12

1 Attachment(s)
Okay, I compressed the chart.....
I've reinstated and enhanced the code that outputs the histogram data to a file. If you set the new WriteDataToFile parameter to true, the indicator will now write the history data to a text file named Daily H-L distribution [symbol_id].txt into your .../MQL4/Files folder. The file content looks something like this:
Inserted Code
EURUSD
           Date  000000000011111111112222  Lo.Hr   Price  Hi.Hr   Price
---------------  012345678901234567890123  -------------  -------------
Fri 15 Dec 2017  000000000000000000000001  23    1.17497  23    1.17562
Mon 18 Dec 2017  111111111111111111111111   0    1.17376  17    1.18344
Tue 19 Dec 2017  111111111111111111111111   3    1.17764  20    1.18488
Wed 20 Dec 2017  111111111111111111111111   9    1.18289  17    1.19018
Thu 21 Dec 2017  111111111111111111111111  16    1.18493  12    1.18896
Fri 22 Dec 2017  111111111111111111111111   2    1.18171   0    1.18755
Tue 26 Dec 2017  111111111111111111111111  14    1.18466  17    1.18788
Wed 27 Dec 2017  111111111111111111111111   2    1.18550  17    1.19103
Thu 28 Dec 2017  111111111111111111111111   0    1.18862  20    1.19591
Fri 29 Dec 2017  111111111111111111111111   0    1.19361  19    1.20255
Tue 02 Jan 2018  111111111111111111111111   0    1.20011  12    1.20814
Wed 03 Jan 2018  111111111111111111111111  21    1.20012   1    1.20662
 
Hour  Count
----- -----
00:00    5
01:00    1
02:00    2
03:00    1
04:00    0
05:00    0
06:00    0
07:00    0
08:00    0
09:00    1
10:00    0
11:00    0
12:00    2
13:00    0
14:00    1
15:00    0
16:00    1
17:00    4
18:00    0
19:00    1
20:00    2
21:00    1
22:00    0
23:00    0
The above is a sample I ran with a StartDate of 2017.12.16, to give me a small enough sample to be checked manageably. Each row in the file shows the date, followed by a 24 character string of 0s and 1s, which represent whether or not a H1 candle exists at hours 00 thru 23 for that day. Any '0' means that there's bad or missing data for the H1 candle at that hour, and that entire day is excluded from the totals (Dec 15 is an example above). The columns on the right show the hour where the low and high prices for the day were made. You can easily verify their correctness by looking at the candles on the chart. And then you can count the number of occurrences of each hour, and verify that the totals in the final section (which should be the same totals showing in the plotted histogram) are correct. See screenshot:Click to Enlarge

Name: PPI 784.png
Size: 26 KBI have uploaded the latest version of the indicator to post #1.

hanover Jan 3, 2018 11:32pm | Post# 13

3 Attachment(s)
that's a really nice sessions indicator you have on the bottom window. Would it possible for you to share that indicator?
Indicator (TimeZones.ex4) is attached.

If I recall correctly....... for the indicator to work properly, you also need to download the MQH file into both the ..../MQL4/Include and .../MQL4/Experts/include folders; and the DLL file into both the ..../MQL4/Libraries and ..../MQL4/Experts/libraries folders. (Create any of these folders if they don't exist). FF wouldn't let me upload these files, hence I was forced to upload them in the attached ZIP file.

The indicator has a couple of known bugs. If the data that it prints disappears for whatever reason, you need to refresh the indicator (toggle between chart timeframes is easiest), and the data should return. Also, it must be the bottommost sub-window on the chart, otherwise the data doesn't print. I will fix these issues if/when I get some spare time.

You also need to enable DLLs when you attach the indicator. See screenshot:Attachment 2619843More info about the indicator, and how the TZ database operates here (but DON'T download any indicators from that post, as they are all outdated).
TimeZones.ex4
TZDBHelper.zip

Hmsr Jan 4, 2018 1:35am | Post# 14

{quote} Indicator (TimeZones.ex4) is attached. If I recall correctly....... for the indicator to work properly, you also need to download the MQH file into both the ..../MQL4/Include and .../MQL4/Experts/include folders; and the DLL file into both the ..../MQL4/Libraries and ..../MQL4/Experts/libraries folders. (Create any of these folders if they don't exist). FF wouldn't let me upload these files, hence I was forced to upload them in the attached ZIP file. The indicator has a couple of known bugs. If the data that it prints disappears for whatever...
Hello Hanover, thankyou for the indicator.
Also Congrats on your "38 out of 38 profitable months".
It's a great feat.

goodways100 Jan 4, 2018 1:48am | Post# 15

Subs. Thanks and
Regards

jmn5611 Jan 4, 2018 2:11am | Post# 16

{quote} I've reinstated and enhanced the code that outputs the histogram data to a file. If you set the new WriteDataToFile parameter to true, the indicator will now write the history data to a text file named Daily H-L distribution [symbol_id].txt into your .../MQL4/Files folder. The file content looks something like this: EURUSD Date 000000000011111111112222 Lo.Hr Price Hi.Hr Price --------------- 012345678901234567890123 ------------- ------------- Fri 15 Dec 2017 000000000000000000000001 23 1.17497 23 1.17562 Mon 18 Dec 2017 111111111111111111111111...
I have big gaping holes in my data!

Sesamstrasse Jan 4, 2018 3:01am | Post# 17

A loud THANK YOU Hanover,

super intresting aproach for intraday swingtrading--

Well done!

Guido

ramzam Jan 4, 2018 3:34am | Post# 18

can it be used for single equity or commodity

hanover Jan 4, 2018 9:06am | Post# 19

4 Attachment(s)
I have big gaping holes in my data!
We're both using the same version of the same indicator. Hence issues would logically be caused by something else that's different between our respective computers, e.g. different brokers, different data, different MT4 or Windows versions, other software running in the background, etc etc. In this case it was the data.
_____________________________
can it be used for single equity or commodity
I ran it for gold (XAUUSD) on my broker and got an empty sub-window. Then I looked at the generated output file, and found that there are no H1 candles for 00 hours:Click to Enlarge

Name: PPI 796.png
Size: 20 KBBut this could easily differ from broker to broker. You can test the indicator on any instrument you wish, and then pinpoint the cause of any irregularity by using the process described in post #12.
_____________________________
When I was trading intraday I used it as perhaps a lesser piece of a total puzzle.....
As an example, to demonstrate what I mean by confluence, here's an interesting scenario developing on EU. We have climax volume, supply zone, some obvious absorption, price has reached 100% of the ADR (dashed horiz white line -- 71 pips), and we have a 64 score (out of 100) for a possible daily H/L during the 08:00 candle (New York time -- the 10:00 candle scores 100). And at some point there 'must' be some profit taking from the upmove. However, I almost certainly wouldn't have taken this trade because the climax volume has been caused by ADP and employment data, making it too risky. But just for fun, let's see how it develops!Click to Enlarge

Name: PPI 795.png
Size: 54 KBNote that today's low (so far) on EU occurred during the early Asian session (24 out of 100), a relatively low probability occurrence.

Also note that this type of trading is countertrend, i.e. top/bottom picking. Not my personal favorite (I prefer to use S/W analysis backed by macro to trade in the direction of the strongest trends). But this can still produce some good low risk entries to compensate you for the times when the intraday move continues, and blows your stoploss away. So you either use tight(ish) SLs enough to keep your losses small, and then try entering repeatedly on each confluence; or very wide SLs (more risky!) to cover several potential confluences in the one position.
________________________________
[EDIT]
Blown away, LOL. So now we wait for another possible confluence during the 10:00 (NY time) candle....... but I'm going back to bed now, it's 4am here in NZ.

[EDIT]
Darned insomnia! Now we have engulfing body at the next supply at the highest probability (scoring 100 out of 100) hour, with price at 120% of ADR -- will this be the day's high? Ah, the joys of discretionary top-picking! Working against this is the flipover SR (the thick blue lines -- trapped traders?; easy to see in hindsight!).Click to Enlarge

Name: PPI 798.png
Size: 50 KB

[EDIT]
Looks like today's EU high will indeed fall inside the highest probability 100-score histogram bar, while the low fell inside the 24-score bar (an infrequent occurrence). Whether profit was attained during the 25 pip move from the high down to the 'demand zone' ((1) in the screenshot) depends on the details of one's entry/exit strategy. As is frequently typical for this time of the day, price is now moving in ever decreasing circles. Anyway, enough for now, I have other things to get on with. I'll leave it for the reader to decide whether the high/low histogram is a worthwhile adjunct to a PVSRA-based intraday strategy.Click to Enlarge

Name: PPI 800.png
Size: 55 KB

fx1990 Feb 1, 2018 12:53pm | Post# 20

1 Attachment(s)
{quote} Indicator (TimeZones.ex4) is attached. If I recall correctly....... for the indicator to work properly, you also need to download the MQH file into both the ..../MQL4/Include and .../MQL4/Experts/include folders; and the DLL file into both the ..../MQL4/Libraries and ..../MQL4/Experts/libraries folders. (Create any of these folders if they don't exist). FF wouldn't let me upload these files, hence I was forced to upload them in the attached ZIP file. The indicator has a couple of known bugs. If the data that it prints disappears for whatever...
hellow hanover

why your are timezone indicator use?
can you more little explain it
Click to Enlarge

Name: Picture21.jpg
Size: 173 KB


© Forex Factory