This indicator is used for a sub-chart. However, when I tried to modify it to be used on other tickers it wouldn't work, only fixated to work on "TICK". I'm rather curious to do some testing on this thing. As always, your replies and help are greatly appreciated.
Code is followed as this:
Code is followed as this:
Code:
declare lower;
def MyDay;
MyDay = GetDay();
def NewDay;
NewDay = if MyDay[0] == MyDay[1] then 0 else 1;
def AccumTick;
def MyTick = close("$TICK", priceType = PriceType.LAST);
AccumTick = if NewDay == 1 then MyTick else AccumTick[1] + MyTick;
plot Diff;
Diff = AccumTick;
plot ZeroLine = 0;
Diff.SetDefaultColor(GetColor(5));
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"));
ZeroLine.SetDefaultColor(CreateColor(160, 160, 160));
Last edited by a moderator: