In ancient history, there seems to have been considerable interest in the COG indicator - here's a link to one such thread:
https://www.forexfactory.com/showthread.php?t=187468
There are many publishers of COG indicators, no idea who was first but they all have their own author information.
The COG is an indicator that re-paints, and seems to be always written from present to past (see JB cog for a non-repainter, I haven't looked at it yet). Never-the-less, it is an 'honest' indicator - it attempts to do a form fitted curve to give you an indication of the center of the market, that is, where the market may be returning to, and redraws the form with each new bar.
Attached is a rewrite of cog that uses the updated mq4 event managers, and is broken into functional units (a good programming practice), that likely has some efficiency gains over the source code it came from.
The 2nd file is the goal of the re-write - it trails the history of the COG, so you can see 'where the ends were' for the chart's history.
--- input bool HideOld = false; // Hide old bar display
--- input bool ShowCogHistory = true; // show history of COG values at the creation of each bar
if you turn those off, you will just get a regular old COG display. It takes my laptop 8 seconds to do the 65K bar history from starting the indicator. The most entertaining thing to do is run it in the strategy tester and watch the lines trail off the COG.... Jump forward so there are enough bars to run it when the strategy tester starts.
Anyone trading using COG?
Updated COG_History to allow displaying the 'COG' at any chosen time, or run to the newest time. Fixed a display bug.
https://www.forexfactory.com/showthread.php?t=187468
There are many publishers of COG indicators, no idea who was first but they all have their own author information.
The COG is an indicator that re-paints, and seems to be always written from present to past (see JB cog for a non-repainter, I haven't looked at it yet). Never-the-less, it is an 'honest' indicator - it attempts to do a form fitted curve to give you an indication of the center of the market, that is, where the market may be returning to, and redraws the form with each new bar.
Attached is a rewrite of cog that uses the updated mq4 event managers, and is broken into functional units (a good programming practice), that likely has some efficiency gains over the source code it came from.
The 2nd file is the goal of the re-write - it trails the history of the COG, so you can see 'where the ends were' for the chart's history.
--- input bool HideOld = false; // Hide old bar display
--- input bool ShowCogHistory = true; // show history of COG values at the creation of each bar
if you turn those off, you will just get a regular old COG display. It takes my laptop 8 seconds to do the 65K bar history from starting the indicator. The most entertaining thing to do is run it in the strategy tester and watch the lines trail off the COG.... Jump forward so there are enough bars to run it when the strategy tester starts.
Anyone trading using COG?
Updated COG_History to allow displaying the 'COG' at any chosen time, or run to the newest time. Fixed a display bug.
Attached Image
Attached Image
Attached File(s)