Tuesday, May 19, 2009

ADX Price Oscillator hybrid. A quick update on all of Your excellent comments


J.H. wrote:

Love your work. Is there anyway you could program the price oscillator to be green when the adx is above 20 and then turn red when it is below.

Thanks for all info



Excellent suggestion J.H. ! Please keep the good comments and suggestions coming.




Here is the code:


declare lower;

input length = 14;
input price = close;
input OverBought_Value = 0.288;
input OverSold_Value = -0.288;

plot DPO = price - Average(price[length / 2 + 1], length);

DPO.AssignValueColor(if reference adx(14).adx >= 20 then CreateColor(11,166,3) else CreateColor(255, 0, 0));

plot baseline = 0;
baseline.SetDefaultColor(GetColor(5));
plot OverBought = OverBought_Value;
Overbought.SetDefaultColor(GetColor(1));

plot OverSold = OverSold_Value;
Oversold.SetDefaultColor(GetColor(1));



Go long when The Price Oscillator crosses below and then back above the oversold level.

Go short when The Price Oscillator crosses above and then back below the overbought level.
blog comments powered by Disqus