Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Center of Gravity Oscillator for Amibroker (AFL)

Rating:
3 / 5 (Votes 5)
Tags:
trading system, ehler, amibroker

Trading system based on John Ehlers’ Center of Gravity Oscillator.
Cybernetic Analysis for Stocks and Futures, Wiley, 2004.

Similar Indicators / Formulas

Adaptive Price Zone (APZ)
Submitted by AndrewThomas almost 14 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 over 10 years ago
Kase CD V2batu
Submitted by batu1453 over 10 years ago
Ichimoku
Submitted by prashantrdx over 10 years ago
Pride System Modified
Submitted by niladri over 12 years ago
buy and sell two EMAS
Submitted by mundo0007 over 12 years ago

Indicator / Formula

Copy & Paste Friendly
SetTradeDelays(0,0,0,0);
BuyPrice = C;
SellPrice = C;
SetBarsRequired(200, 0);

function CGOscillator(Price, Length)
{
	Result = 0;
	for (i=length; i< BarCount; i++)
	{
		Num = 0;
		Denom = 0;
		for (j=0; j<Length; j++)
		{
			Num = Num + (1 + j) * Price[i-j];
			Denom = Denom + Price[i-j];
		}
		if (Denom != 0) Result[i]
				= 100.0 * ((-Num / Denom) + (Length + 1)/2);
}
return Result;
}

Price = (H + L) / 2;
CGOLength = Param("CGOLength", 13, 1, 250, 10);
CGO = CGOscillator(Price, CGOLength);
SmLength = Param("SmLength", 2, 1, 20, 2);
CGOSmoothed = DEMA(CGO,SmLength);

Buy = Cross(CGO,CGOSmoothed);

HoldDays = Param("HoldDays",6,1,10,1);

Sell = Cross(CGOSmoothed, CGO)
			OR (BarsSince(Buy) >= HoldDays);

Sell = ExRem (Sell,Buy);

e = Equity();
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
Plot( Close, "Price", colorBlack, styleCandle );
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),
			0, IIf( Buy, Low, High ) );
GraphXSpace = 5;

Plot(e,"Equity",colorRed,styleLine|styleOwnScale);
Plot(CGO, "CG Oscillator", colorRed,
		styleLine|styleLeftAxisScale);
Plot(CGOSmoothed, "CGO Smoothed", colorBlue,
		styleLine|styleLeftAxisScale);
//Figure 10.1 Center of Gravity

0 comments

Leave Comment

Please login here to leave a comment.

Back