Hello,
I'm trying to create a histogram for the difference between the VWAP & X EMA, with 4 different colors (dark & light green , dark & light red) for positive rising, positive declining, negative declining and negative rising, but to no avail.
I've tried to copy the script from a similar histogram script I created for the difference between 2 EMA's but I can't seem to make it.
Here's the script for the difference between 2 EMA's I created.
If anyone could help me out with this, it would be GREATLY appreciated!
Thanks,
Wolf
I'm trying to create a histogram for the difference between the VWAP & X EMA, with 4 different colors (dark & light green , dark & light red) for positive rising, positive declining, negative declining and negative rising, but to no avail.
I've tried to copy the script from a similar histogram script I created for the difference between 2 EMA's but I can't seem to make it.
Here's the script for the difference between 2 EMA's I created.
If anyone could help me out with this, it would be GREATLY appreciated!
Thanks,
Wolf
Code:
declare lower;
input fastLength = 12;
input slowLength = 26;
input averageType = AverageType.EXPONENTIAL;
input showBreakoutSignals = no;
plot Value = MovingAverage(averageType, close, fastLength) - MovingAverage(averageType, close, slowLength);
plot Diff = Value;
plot ZeroLine = 0;
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));