I was looking at Drum Rocker's strategy, and when I went to your thread on the Ultra MACD, which is part of his strategy, and noticed that my indicator plots the same exact curve (the one that turns green or red as the case may be) as yours does. My intent was to do away with the problem of trying to compare the MACD of different stocks that have widely different price levels. So I converted the difference between the fast and slow ema into a percentage difference. The idea being that while the stocks may have greatly different prices, the percentage difference between the averages are comparable. A 5% spread between the 12 and 26 ema is the same relative difference by percentage regardless of the price differences between stocks. Here's my script...will be studying yours intently to see what the other curves represent.
Code:
declare lower;
input FastLength = 12; # Faster of the two moving averages
input SlowLength = 26; # Slower of the two moving averages
input FastAvgSmoothingLength = 9;
input FastEMA_Length = 8;
def FastEMAavg = ExpAverage(close,FastEMA_Length);
def P1L = 1;
def PP5L = 0.5;
def ZL = 0;
def MP5L = -0.5;
def M1L = -1;
def SlowAvg = ExpAverage(close,SlowLength); # ema of the slow moving average
def FastAvg = ExpAverage(close,FastLength); # ema of the fast moving average
plot FastSlowPctDiff = ((FastAvg-SlowAvg)/SlowAvg) * 100; # Percent difference between FastAvg and SlowAvg
def FastPctDiff = ((FastAvg - FastAvg[1])/FastAvg[1]) * 100; # Percent difference betwee current and previous bar
plot FastPctDiffAvg = ExpAverage(FastPctDiff,FastAvgSmoothingLength);
FastPctDiffAvg.SetDefaultColor(color.cyan);
def PDGTP = if FastSlowPctDiff > FastSlowPctDiff[1] then 1 else 0;
def PDLTP = if FastSlowPctDiff < FastSlowPctDiff[1] then 1 else 0;
FastSlowPctDiff.AssignValueColor(if PDGTP then Color.GREEN else if PDLTP then Color.RED else Color.YELLOW);
FastSlowPctDiff.SetLineWeight(2);
plot ZLine = ZL;
ZLine.SetDefaultColor(Color.white);
plot P1Line = P1L;
P1Line.SetDefaultColor(color.green);
Plot M1Line = M1L;
M1Line.SetDefaultColor(color.red);
Plot PP5Line = PP5L;
PP5Line.SetDefaultColor(Color.yellow);
PP5Line.SetPaintingStrategy(PaintingStrategy.DASHES);
Plot MP5Line = MP5L;
MP5Line.SetDefaultColor(color.yellow);
MP5Line.SetPaintingStrategy(PaintingStrategy.DASHES);
plot FastEMAImproving = if FastEMAavg > FastEMAavg[1] then 1 else 0;
FastEMAImproving.Hide();
AddLabel(yes,FastEMA_Length + " EMA Improving", if FastEMAImproving then color.green else if FastEMAavg == FastEMAavg[1] then color.gray else color.red);
AddLabel(yes,FastLength + " EMA Improving",if FastAvg > FastAvg[1] then color.green else color.red);
def BullConditionGo = if FastPctDiffAvg > FastPctDiffAvg[1] and FastSlowPctDiff > FastSlowPctDiff[1] and FastAvg > FastAvg[1] then 1 else 0;
AddLabel(yes, if BullConditionGo then " Bull Go " else "Bull No Go",if BullConditionGo then color.green else color.red);
def BullConditionGoPlus = if BullConditionGo and FastSlowPctDiff > 0 then 1 else 0;
AddLabel(yes,if BullConditionGoPlus then "Bull Go Plus" else " ", if BullConditionGoPlus then color.green else color.gray);
def BearConditionGo = if FastPctDiffAvg < FastPctDiffAvg[1] and FastSlowPctDiff < FastSlowPctDiff[1] and FastAvg < FastAvg[1] then 1 else 0;
AddLabel(yes, if BearConditionGo then " Bear Go " else "Bear No Go",if BearConditionGo then color.green else color.red);
def BearConditionGoPlus = if BearConditionGo and FastSlowPctDiff < 0 then 1 else 0;
AddLabel(yes,if BearConditionGoPlus then "Bear Go Plus" else " ", if BearConditionGoPlus then color.green else color.gray);
# Conditions for scanning
plot BullGoPlus = if BullConditionGoPlus then 1 else 0;
BullGoPlus.Hide();
plot BearGoPlus = if BearConditionGoPlus then 1 else 0;
BearGoPlus.Hide();
plot highestPos = if Highest(FastSlowPctDiff,5) <= 1 then 1 else 0;
highestPos.Hide();
plot lowestPos = if Highest(FastSlowPctDiff,5) >= 0 then 1 else 0;
lowestPos.Hide();
def TanAngle = ATan(close);
AddLabel(yes,"'Angle Improving'", if (TanAngle > TanAngle[1]) then color.green else color.red);
AddLabel(yes,"Previous 'Angle': " + TanAngle[1],color.gray);
AddLabel(yes,"Current 'Angle': " + TanAngle,color.gray);