Center of Gravity by John Ehlers (Page 2) - NinjaTrader | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader

Center of Gravity by John Ehlers
Started:August 18th, 2009 (01:50 AM) by Silvester17 Views / Replies:11,480 / 10
Last Reply:June 9th, 2014 (04:45 PM) Attachments:5

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Center of Gravity by John Ehlers

Old June 9th, 2014, 04:45 PM   #11 (permalink)
Elite Member
San Luis Obispo, CA USA
Futures Experience: Master
Platform: TradeStation
Favorite Futures: ES
Posts: 1 since Jul 2013
Thanks: 0 given, 1 received

Center of Gravity Description and EL Code

The Center of Gravity indicator topic came up during my webinar last week, and I did a poor job of explaining it. My COG indicator does not change over history. Once it is computed, that value is "sticky". Perhaps an analogy of a teeter-totter is best used to understand it. Rising prices drive the balance point up, and falling prices drive the balance point down. The center of gravity is the balance point of the teeter-totter. Here is the EasyLanguage code in case something has been lost in translation over the years: (don't forget that EasyLanguage uses the argument of the Cosine in degrees. You need to convert 360 to 2*Pi in other languages.
John Ehlers



//Highpass filter cyclic components whose periods are shorter than 48 bars
alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2];
//Smooth with a Super Smoother Filter from equation 3-3
a1 = expvalue(-1.414*3.14159 / Length);
b1 = 2*a1*Cosine(1.414*180 / Length);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;
Filt = c1*(Close + Close[1]) / 2 + c2*Filt[1] + c3*Filt[2];

Num = 0;
Denom = 0;
For count = 0 to Length - 1 begin
Num = Num + (1 + count)*(Filt[count]);
Denom = Denom + (Filt[count]);
If Denom <> 0 then CG = -Num/Denom + Length / 2 + .5;

Plot1(CG, "CG");

Reply With Quote
The following 4 users say Thank You to CambriaJohn for this post:

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > Center of Gravity by John Ehlers

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Corey Rosenbloom: Tips, Tactics, and Real Trades: Trading Intraday Trend Reversals

Elite only

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
anyone tried john needham's thedanielcode tradermark Vendors and Product Reviews 3 February 26th, 2015 08:37 AM
Thoughts on Ehlers indicators quasar NinjaTrader 14 January 29th, 2015 09:34 AM
Ehlers Indicators Flatlining (NT V7) ETFVoyageur NinjaTrader 3 February 20th, 2011 11:24 AM
John Ehlers Zero Lag ebtrader ThinkOrSwim Programming 0 December 25th, 2010 10:41 AM
Obama Strongly Backs Islam Center Near 9/11 Site Quick Summary News and Current Events 30 September 11th, 2010 04:48 PM

All times are GMT -4. The time now is 07:29 AM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-21 in 0.08 seconds with 20 queries on phoenix via your IP