Converted the original code from his book "Cybernetic Analysis for Stocks and Futures"
This article describes a new oscillator that is unique because it is both smoothed and has essentially zero lag. The smoothing enables clear identification of turning points and the zero lag aspect enables action to be taken early in the move. This oscillator is the serendipitous result of my research into adaptive filters. While the filters have not yet produced the result I seek, this oscillator has substantial advantages over conventional oscillators used in technical analysis . The “CG” in the name of the oscillator stands for the Center of Gravity of the prices over the window of observation. The Center of Gravity ( CG ) of a physical object is its balance point. For example, if you balance a 12 inch ruler on your finger, the CG will be at its 6 inch point. If you change the weight distribution of the ruler by putting a paper clip on one end, then the balance point (e.g. the CG ) shifts toward the paper clip. Moving from the physical world to the trading world, we can substitute the prices over our window of observation for the units of weight along the ruler. With this analogy, we see that the CG of the window moves to the right when prices increase sharply. Correspondingly, the CG of the window moves to the left when prices decrease.