RickK
Active member
Hey All,
I'm trying to design a lower indicator that has the day's open as a zeroline and the current price either above or below the zeroline as a histogram that measures from the zeroline and up (if price is currently above the day's open) or from the zeroline and down (if price is currently below the day's open). Hoping someone can help...or direct me to relevant education.
I can plot the price line (red line on top indicator shown below), but when I change the line to a histogram it starts from the bottom of the display. I'm hoping to get it to start from the zeroline and project downward or upward (looking like a MACD histogram does).
Thanks!
Here's the current code:
I also tried the following code, to no avail.
I'm trying to design a lower indicator that has the day's open as a zeroline and the current price either above or below the zeroline as a histogram that measures from the zeroline and up (if price is currently above the day's open) or from the zeroline and down (if price is currently below the day's open). Hoping someone can help...or direct me to relevant education.
I can plot the price line (red line on top indicator shown below), but when I change the line to a histogram it starts from the bottom of the display. I'm hoping to get it to start from the zeroline and project downward or upward (looking like a MACD histogram does).
Thanks!
Here's the current code:
Code:
declare lower;
input period_day = AggregationPeriod.DAY;
def begin = open(period = period_day);
def end = close(period = period_day);
def NetChg = end - begin;
def NetChgRatio = NetChg;
plot OpenLine = begin;
plot value = close;
AddLabel(yes, "Net NQ " + NetChgRatio , if NetChgRatio > 0 then Color.GREEN else if NetChgRatio < 0 then color.RED else color.LIGHT_GRAY);
I also tried the following code, to no avail.
Code:
declare lower;
input period_day = AggregationPeriod.DAY;
def begin = open(period = period_day);
def end = close(period = period_day);
def NetChg = end - begin;
def NetChgRatio = NetChg;
plot OpenLine = begin;
plot value = begin + NetChg;
#plot value = close; commented out this line to replace with line above
AddLabel(yes, "Net NQ " + NetChgRatio , if NetChgRatio > 0 then Color.GREEN else if NetChgRatio < 0 then color.RED else color.LIGHT_GRAY);
Last edited: