This project has changed its purpose. Make sure to read the text below the red line. The part above is history.
Hello everyone.
At the moment I do a lot of visual backtesting on different instruments. I thought it would be nice to have something that would show me the HGI status and signal for history bars in multiple timeframes. As no such tool was available (or I was to stupid to find it), I wrote one. And now share it with you.
The attached indicator shows 4 lines in a subwindow, the upper line for the actual timeframe and the others for the next three higher timeframes. M30 can be disabled as higher timeframe to keep the timeframes more or less equidistant.
The colors of the bars represent the last known HGI signal on the respective timeframe. Green for up trend arrows or blue wavys below, red for the opposite and black for yellow range wavys. Range or Rad arrows are ignored. The different types of wavys can be disabled.
The exact signals are also (optionally) shown on the bars. You may choose between two display types. One with colored arrows and wavys, the other with color-coded dots only.
The number of bars to calculate is also configurable. Please obey the warning in the input window. Choosing to many bars will mean a huge number of HGI calculations at every initialization and time frame change.
This code may still have bugs, please report them.
Have fun.
EDIT: I forgot to mention that this indi needs the latest HGI library (hgi_lib.ex4) in your "Libraries" folder. You can download it from this post: http://www.stevehopwoodforex.com/phpBB3 ... 64#p105044
EDIT 23.10.17: I have streamlined some code and added some features:
As Rozmer supposed, you can now nail the indi timeframes to a fixed value so they dont change when you switch chart timeframes.
The indi now refreshes its whole history every minute at the opening of a new M1 bar, even if you are on higher timeframes. That makes observation of changes in the HGI signals more fun. If you spot differences between HGI and indi signals, simply refresh your HGI (switch timeframes). This indi doesnt show signals that appear and disappear again as well as signals that were relocated until it refreshes itself.
Due to the changed inputs, you should save your settings (if you have changed them) or you will have to input them again. I have changed the default signal display style to "dots". I like its sleekness.
EDIT 25.10.17: Some more code improvements and additions:
The HGI calls for refreshing are reduced by nearly 99% . This allows much higher refresh rates. You can set your own refresh rate in "RefreshSeconds". On reasonable machines, setting it to a few seconds now is no problem. The default of 60 seconds should be fine for most users though.
Apparently there is some confusion with the "manual/fixed" timeframes. This indi is not supposed to display timeframes that are lower than the current chart timeframe. It doesnt make any sense trying to display a number of signals from a lower timeframe in one bar. I have added some code to make sure that only timeframes equal or higher than the actual one are displayed.
EDIT 30.10.17: Even more additions:
The indi now can evaluate two multi-bar strategies (user selectable "AllBarsAgree" and "MoreBarsAgree") and display the result as entry and exit points in the main chart. Looks simple, but somehow was a logical challenge due to the cyclical partial refreshing of the last bars. Thomasmore, if you dont see the signals, its because their colour default is white. You can change that in the input section.
Thomasmore has also proposed to make the size of the symbols in the subwindow changeable. This addition is also included.
==========================================================================
EDIT 1.11.17: A new mindset
Explanation: VISUAL backtesting doesnt have anything to do with using the backtester in Crapperquotes terminal. It simply means going through a history chart with your eyes and see how you would have taken trades based on whatever your strategy might be.
My initial goal to have a tool for visual backtesting has failed. Although I was warned and knew of the weakness of HGI, I had this idea of HGI an multiple timeframes and wanted to see where it ends. It ended in total disillusionment because I had no idea of the problem magnitude.
HGI and HGI library cant show you anything but the final position of historical signals. They are great tools for trading in realtime, but are totally misleading when it comes to visual backtesting. They dont tell you where those signals had been before they were at the point you see them now. And this can be a difference I never dreamed of. Especially dealing with higher timeframes.
So what merit has my first attempt (MTF HGI Bars)? Absolutely none as far as visual backtesting is concerned. Dont ever dream of trusting any signal that is prior in time than the start of the indicator. You may mark this point in time using the input "ShowRealtimeStartLine". And then dont trust any signal that is more than one bar away from current time. You will see why.
The indi still has some merits: First, it can give you realtime signals (and now also alerts, see inputs) for the MTF HGI trading strategy I intended. Second, I have added inputs to show "ghost signals" (courtesy of Halloween). These are signals that were initially valid and then disappeared or were relocated. They have no use other than to be a didactic play that may help most of us to understand better how HGI works. And hereby reduce the always same questions in this forum.
So is it impossible to track the performance of HGI at all? No. You cant track it by history bars, but you can track it in realtime. As we all know, realtime becomes history after a while.
I have written a second attempt (MTF HGI tracker) for this purpose. It works like master Steve´s EA that was inspired by my idea. It has the same realtime trading support like chart signals and alerts. Every minute it looks back in time on all 4 timeframes to find the last valid signal. And then protocols that status on the timeframe bars. Now you can see where you really would have entered and exited trades. Let it run for a while and you get a meaningful history. Dont change timeframes or instruments, the history will not be saved. I could add that feature, but probably will not.
If you have both indis running side by side for a while, you will acquire a better understanding of HGI. At least I did. And isnt learning a divine thing? I have set the defaults to values that will create a picture like the attached one. Coloured signals are the ones of "MTF HGI Tracker" that you would have had in realtime. Gray and white ones are the ghost and final signals of "MTF HGI Bars".
Have fun.
Under the hood of HGI (was: New HGI MTF history indicator)
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
Under the hood of HGI (was: New HGI MTF history indicator)
You do not have the required permissions to view the files attached to this post.
Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
New HGI MTF history indicator
Hi again.
Shortly after finishing post 1, a solution for eliminating 2/3 of the HGI calls popped up in my mind. I have rewritten the code and uploaded a new version.
For the now much quicker indi the new default for bars to calculate is 5000. This avoids missing signals on the highest timeframe.
The one early adopter may please redownload it.
Shortly after finishing post 1, a solution for eliminating 2/3 of the HGI calls popped up in my mind. I have rewritten the code and uploaded a new version.
For the now much quicker indi the new default for bars to calculate is 5000. This avoids missing signals on the highest timeframe.
The one early adopter may please redownload it.
Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
-
mastercool
- Trader
- Posts: 20
- Joined: Thu Jan 05, 2017 9:44 am
Thank you!
Redownloading now.
Amazing idea. I will backtest it because I do a lot of visual backtesting too.
Amazing idea. I will backtest it because I do a lot of visual backtesting too.
-
drakoh
- Posts: 6
- Joined: Fri Nov 13, 2015 8:36 pm
New HGI MTF history indicator
thank you ! let me have a look, I like the visual so far.
what kind of entry signal would you use ?
htf all green for example, and wait for current tf buy signal ?
Or wait for highest htf entry signal, and then wait for each lower tf to align ?
Thanks for your work !
what kind of entry signal would you use ?
htf all green for example, and wait for current tf buy signal ?
Or wait for highest htf entry signal, and then wait for each lower tf to align ?
Thanks for your work !
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
New HGI MTF history indicator
Hi.
I am looking at three strategies:
- The three upper bars must align
- The three lower bars must align
- 3 of 4 bars must align
I am looking at three strategies:
- The three upper bars must align
- The three lower bars must align
- 3 of 4 bars must align
Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
- Weyk
- Trader
- Posts: 42
- Joined: Mon Apr 10, 2017 3:53 pm
New HGI MTF history indicator
Thanks Thomas,
This indi helps to see chart depth. Also now i can understand better Awesome BW hgi inputs.
Best wishes and thank you for your generosity!
This indi helps to see chart depth. Also now i can understand better Awesome BW hgi inputs.
Best wishes and thank you for your generosity!
If you put your mind onto something sooner or later it will come up with the solution.
- Wavegarrick
- Trader
- Posts: 1172
- Joined: Sun Dec 30, 2012 11:21 am
- Location: South Africa
New HGI MTF history indicator
Hi Thomas,
This is briliant and I believe will take trading Hgi to a whole new level. A complete trading system on its own.
Many thanks
Leon
This is briliant and I believe will take trading Hgi to a whole new level. A complete trading system on its own.
Many thanks
Leon
-
thomasmore
- Trader
- Posts: 275
- Joined: Tue Nov 15, 2011 10:35 pm
- Location: Knokke, Belgium
New HGI MTF history indicator
Thanks Thomas for this great tool!
thomasmore
thomasmore
- Eamonn
- Trader
- Posts: 87
- Joined: Wed Nov 16, 2011 6:45 am
New HGI MTF history indicator
Looks like this could be a monster

-
rozmer
- Trader
- Posts: 42
- Joined: Sun Mar 13, 2016 2:55 pm
New HGI MTF history indicator
Thank you Thomas,!!!!!
I fully agree with Leon -A NEW LEVEL
Rozmer
I fully agree with Leon -A NEW LEVEL
Rozmer