• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:50am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:50am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Center of Gravity Daily Trend Trade 63 replies

What is the best settings for "center of gravity" indicator 14 replies

Platforms with an integrated Center of Gravity indi? 26 replies

Modified Center of Gravity 8 replies

Center of Gravity 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 13
Attachments: Center of Gravity (COG) Indicator
Exit Attachments

Center of Gravity (COG) Indicator

  • Last Post
  •  
  • Page 1 2
  • Page 1 2
  •  
  • Post #1
  • Quote
  • First Post: Edited Mar 29, 2017 10:41pm Mar 26, 2017 3:00pm | Edited Mar 29, 2017 10:41pm
  •  lukeb
  • Joined Dec 2009 | Status: Member | 250 Posts
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.
Attached Image
Attached Image
Attached Files
File Type: mq4 COG_History.mq4   21 KB | 1,834 download | Uploaded Mar 29, 2017 10:39pm
File Type: mq4 Center_Of_Gravity.mq4   12 KB | 2,948 downloads | Uploaded Mar 29, 2017 10:40pm
  • Post #2
  • Quote
  • Mar 26, 2017 3:36pm Mar 26, 2017 3:36pm
  •  mladen
  • Joined Apr 2007 | Status: ... | 663 Posts
That is no "center of gravity"
That is regression channel. You can find more info on it here : https://en.wikipedia.org/wiki/Regression_analysis
Regression analysis as is exists for a couple of centuries but it seems that mt renamers succeeded to hide that fact quite well Better to use it's real name in order to avoid confusion of what it is and what it never was- and when search is done using the real name, a lot more results can be found
3
  • Post #3
  • Quote
  • Mar 26, 2017 4:12pm Mar 26, 2017 4:12pm
  •  shaileshm
  • | Joined Oct 2016 | Status: Junior Member | 4 Posts
how can you use this indicator to trade reversals?
What are the things you would watch out for once the price touches the outer bands?
  • Post #4
  • Quote
  • Mar 28, 2017 11:54pm Mar 28, 2017 11:54pm
  •  lukeb
  • Joined Dec 2009 | Status: Member | 250 Posts
Quoting mladen
Disliked
That is no "center of gravity" That is regression channel.
Ignored
I don't see that naming a 'bars_back' regression channel made in a particular way a 'COG' is inappropriate, as long as there is no deception involved.
Anyway it was easy for me to break the code up into 'work units' and put each into its own function to see its dependencies, but would take much longer and be a lot of work to figure out the why and what is accomplished to properly comment each of those functions. From what I've seen, you have the background to be able to make those comments in the source file - would you mind doing that?

If you have a different regression tool that you think is better and more deserving of attention, I'd really be interested in your opinion.
  • Post #5
  • Quote
  • Mar 28, 2017 11:55pm Mar 28, 2017 11:55pm
  •  lukeb
  • Joined Dec 2009 | Status: Member | 250 Posts
Quoting shaileshm
Disliked
how can you use this indicator to trade reversals? What are the things you would watch out for once the price touches the outer bands?
Ignored
I'd just have to refer you to some of the other discussions on trading with 'the COG', like the one here: https://www.forexfactory.com/showthread.php?t=187468. I'd certainly be interested in any ideas anyone has or good discussions someone wants to point me to.
  • Post #6
  • Quote
  • Mar 29, 2017 2:13am Mar 29, 2017 2:13am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,081 Posts
Just for the record, mladen (post #2) is correct, the indy plots a polynomial regression channel.
It was originally released as iRegr, but somebody apparently changed the name at some point.
Just a warning note: for better or worse, regression channels tend to repaint.
2
  • Post #7
  • Quote
  • Mar 29, 2017 10:45pm Mar 29, 2017 10:45pm
  •  lukeb
  • Joined Dec 2009 | Status: Member | 250 Posts
Quoting hanover
Disliked
Just for the record, mladen (post #2) is correct, the indy plots a polynomial regression channel. It was originally released as iRegr, but somebody apparently changed the name at some point. Just a warning note: for better or worse, regression channels tend to repaint.
Ignored
Thanks - I updated the files to show the original code came from iRegr.
As far as repaints - A regression curve must redraw with each new data point added, or that's not what it would be. That's why I added the dotted lines to show the history of 'what it was'. That way, the user can see the history of what the indicator was at when each bar opened (when a new data point added - the close of the previous bar).
  • Post #8
  • Quote
  • Mar 30, 2017 1:13am Mar 30, 2017 1:13am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,081 Posts
Quoting lukeb
Disliked
As far as repaints - A regression curve must redraw with each new data point added, or that's not what it would be.
Ignored
Yes, exactly.
Quote
Disliked
That's why I added the dotted lines to show the history of 'what it was'. That way, the user can see the history of what the indicator was at when each bar opened (when a new data point added - the close of the previous bar).
Nice work!
  • Post #9
  • Quote
  • Edited at 4:00am Mar 30, 2017 3:45am | Edited at 4:00am
  •  mladen
  • Joined Apr 2007 | Status: ... | 663 Posts
Just some additional words from me too (probably needed)

Regression analysis is probably one of the most widely used methods in all sorts of analysis (I would like to see an EEG without being filtered by regression analysis, or a simplest PC without the same thing done : I guess we would still shout from one hill to another without it, and so on, and soo on, we could show thousands of examples here ...) and nobody can dispute the usefulness of it - least of all me. It recalculates but fitting/estimating calculations must do that in order to produce the results expected from the underlying mathematical model, but that does not change the fact that it is one of the best mathematical models for filtering and estimation (extrapolation)
__________________________________

What I wanted to point out that the "center of gravity" name has nothing to do with what it actually is. And yes, it was renamed on purpose : to the extent that the "author" (not going to name him, but ...) claims copyright and was even awarded some awards at some Paris IT fairs "for breaks in technological advance" (whatever that means) - and all that for a stolen/renamed code

The story of "center of gravity" is all the usual that we all have seen so many times and is, after all, rather sad, than anything else
__________________________________

PS: I really would like to make a distinction between "repainting" and recalculating : recalculating is a perfectly valid calculating method usually based on a solid mathematical models. "Repainting" is nothing but a coding error and should be treated like that.
5
  • Post #10
  • Quote
  • Apr 2, 2017 12:25am Apr 2, 2017 12:25am
  •  shaileshm
  • | Joined Oct 2016 | Status: Junior Member | 4 Posts
i did some test with the COG indicator this. It is only as best as any other regression channel. Trading reversal blindly when price touches the boundary does not work. but since its a reainting, the past always looks perfect. I wouldnt recommend using this indicator. I real time the price touching the boundary means nothing at all.
  • Post #11
  • Quote
  • Edited at 9:25am Jul 26, 2018 9:08am | Edited at 9:25am
  •  ramzam
  • Joined Nov 2015 | Status: Member | 2,877 Posts
is this center of gravity is diff from extreambinary channal
Attached Files
File Type: ex4 xtreme_binary_robot_channel.ex4   78 KB | 598 downloads
File Type: mq4 xtreme_binary_robot_channel.mq4   35 KB | 751 downloads
Success is a Journey Not a Destination....... kind regards ramzam
  • Post #12
  • Quote
  • Jul 28, 2018 11:23am Jul 28, 2018 11:23am
  •  sunny2way
  • | Commercial Member | Joined Sep 2015 | 95 Posts
Quoting ramzam
Disliked
is this center of gravity is diff from extreambinary channal {file} {file}
Ignored
Love this your extreambinary channel on my platform please does it repaint and how does it work ?
  • Post #13
  • Quote
  • Jul 28, 2018 12:22pm Jul 28, 2018 12:22pm
  •  saidi123
  • | Joined Apr 2018 | Status: Member | 9 Posts
Please, If anyone could help me to change the colors between levels in the MACD like I did it with triangles, I would be so thankful and grateful
Attached Image (click to enlarge)
Click to Enlarge

Name: 112223.JPG
Size: 139 KB
  • Post #14
  • Quote
  • Jul 28, 2018 12:34pm Jul 28, 2018 12:34pm
  •  Namor
  • | Joined Sep 2012 | Status: Member | 108 Posts
Quoting sunny2way
Disliked
{quote} Love this your extreambinary channel on my platform please does it repaint and how does it work ?
Ignored
It repaints.
  • Post #15
  • Quote
  • Jul 28, 2018 6:03pm Jul 28, 2018 6:03pm
  •  sunny2way
  • | Commercial Member | Joined Sep 2015 | 95 Posts
Quoting Namor
Disliked
{quote} It repaints.
Ignored
Thanks
  • Post #16
  • Quote
  • Jul 29, 2018 2:58am Jul 29, 2018 2:58am
  •  mrtools
  • Joined Nov 2006 | Status: Member | 273 Posts
This is a real Ehlers center of gravity, or at least closer to it.
Attached Image (click to enlarge)
Click to Enlarge

Name: ehlers center of gravity.png
Size: 35 KB
Attached File
File Type: mq4 Ehlers center of gravity.mq4   2 KB | 1,059 download
4
  • Post #17
  • Quote
  • Oct 21, 2019 5:06am Oct 21, 2019 5:06am
  •  SanghoonKim
  • | Joined Oct 2019 | Status: Junior Member | 1 Post
Hi ! lukeb


Teach me how to run on a strategy tester and track lines in COG! Bars will continue to be zero.
Can't you teach me with screen capture?
Teach me how to run on a strategy tester and track lines in COG! Bars will continue to be zero. Can't you teach me with screen capture?
  • Post #18
  • Quote
  • Edited Jul 11, 2020 12:29am Jul 10, 2020 1:10pm | Edited Jul 11, 2020 12:29am
  •  ramonrly
  • | Joined Jul 2020 | Status: Member | 5 Posts
Hi

Please, somebody could add arrow and alert on this Center Of Gravity indicator, it is very good if you use in combination with support and resistence after the green lines. it does not repaint, if you add arrow and alert will be very handle to backtest too.
Attached File
File Type: mq4 JB_Center_of_Gravity.mq4   6 KB | 237 downloads
  • Post #19
  • Quote
  • Oct 7, 2020 11:38pm Oct 7, 2020 11:38pm
  •  foodaa
  • | Joined Oct 2020 | Status: Junior Member | 1 Post
Quoting ramonrly
Disliked
Hi Please, somebody could add arrow and alert on this Center Of Gravity indicator, it is very good if you use in combination with support and resistence after the green lines. it does not repaint, if you add arrow and alert will be very handle to backtest too. {file}
Ignored
here for you arrows for directions
Attached File
File Type: zip Belkhayate system.zip   14 KB | 183 downloads
  • Post #20
  • Quote
  • Nov 3, 2020 12:50pm Nov 3, 2020 12:50pm
  •  mrtools
  • Joined Nov 2006 | Status: Member | 273 Posts
This is a fisher stochastic center of gravity arrows, alerts and mtf, the alerts, arrows, and coloring are on signal cross.
Attached Image (click to enlarge)
Click to Enlarge

Name: EURUSDM15.png
Size: 60 KB
Attached File
File Type: ex4 fisher stochastic cg (mtf + alerts + arrows).ex4   54 KB | 119 downloads
4
  • Platform Tech
  • /
  • Center of Gravity (COG) Indicator
  • Reply to Thread
    • Page 1 2
    • Page 1 2
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2021