Mr_Wheeler
Active member
What's it suppose to look like.
How it looks now.
How it looks now.
Code:
declare lower;
#zero line
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(GetColor(0));
input Klength = 20;
input price = close;
input ATRmult = 1.5;
def vClose = close;
def nan = Double.NaN;
def bn = BarNumber();
def K = (Highest(high, Klength) + Lowest(low, Klength)) /
2 + ExpAverage(close, Klength);
plot Momo = Inertia(price - K / 2, Klength);
Momo.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Momo.SetLineWeight(3);
Momo.AssignValueColor(if Momo > Momo[1] and Momo > 0
then Color.CYAN
else if Momo > 0 and Momo < Momo[1]
then Color.BLUE
else if Momo < 0 and Momo < Momo[1]
then Color.WHITE
else Color.YELLOW);
#These code lines give & retract value
def barUp = vClose > vClose[1];
def barDown = vClose < vClose[1];
def barUpCount = CompoundValue(1, if barUp then barUpCount[1] + 1 else 0, 0);
def barDownCount = CompoundValue(1, if barDown then barDownCount[1] - 1 else 0, 0);
#asign value to colored bars
Momo.AssignValueColor(Color.CYAN);
Momo.AssignValueColor(Color.blue);
#creates label to tell you to buy or hold
AddLabel(yes, if barUpCount [+2] then "Buy!Buy!Buy!Buy!Buy!Buy!" else if barDownCount [+2] then "TAKE PROFIT NOW!_____TAKE PROFIT NOW!" else "Stand by", if barUpCount [+2] then Color.GREEN else if barDownCount[+2] then Color.WHITE else Color.ORANGE);