Indicator showing Opening, high. low, Close, Range

LLP

Member
VIP
Can anyone point out if there is any indicator can show at the CHART top part (circle in blue) with BOX with color changes, for the value on the top line showing :
O:37.93 H:39.12 L:37.93 C:38.9 R:1.19

 
Can anyone point out if there is any indicator can show at the CHART top part (circle in blue) with BOX with color changes, for the value on the top line showing :
O:37.93 H:39.12 L:37.93 C:38.9 R:1.19


This is a script I posted elsewhere here that is modified to include heiken ashi candles.

Set the input offset to 0 (zero) to track the current bar. Set it to 1 to track the previous bar, etc.
Set the input type to the chart type showing on your chart.
There are various options that you can turn on/off.

Ruby:
input offset  = 0;
input type    = {default candle, heikenashi};

def h;
def l;
def o;
def c;
def r;

switch (type){
case candle:
    h = high;
    l = low;
    o = open;
    c = close;
    r = h - l;
case heikenashi:
    c = ohlc4;
    o = CompoundValue(1, (o[1] + c[1]) / 2, (open[1] + close[1]) / 2);
    h = Max(Max(high, o), c);
    l = Min(Min(low, o), c);
    r = h - l;
}
def HAclose = ohlc4;
def HAopen = CompoundValue(1, (HAopen[1] + HAclose[1]) / 2, (o[1] + c[1]) / 2);
def haopen_ = if haopen>haclose then HAopen + 0 else double.nan;
def HAhigh = if haopen>haclose then Max(Max(h, HAopen), HAclose) else double.nan;
def HAlow = if haopen>haclose then Min(Min(l, HAopen), HAclose) else double.nan;

def lastopen  = if IsNaN(close[-1]) and !IsNaN(close) then o[offset] else lastopen[1];
def lasthigh  = if IsNaN(close[-1]) and !IsNaN(close) then h[offset] else lasthigh[1];
def lastclose = if IsNaN(close[-1]) and !IsNaN(close) then c[offset] else lastclose[1];
def lastlow   = if IsNaN(close[-1]) and !IsNaN(close) then l[offset]  else lastlow[1];

input showlines = yes;
plot lopen   = if !showlines then Double.NaN else lastopen;
plot lhigh   = if !showlines then Double.NaN else lasthigh;
plot lclose  = if !showlines then Double.NaN else  lastclose;
plot llow    = if !showlines then Double.NaN else  lastlow;

lopen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
lhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
lclose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
llow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

lhigh.SetDefaultColor(Color.GREEN);
lclose.SetDefaultColor(Color.YELLOW);
llow.SetDefaultColor(Color.RED);

input showlabels = yes;
AddLabel(showlabels, "O: " + AsText(lastopen), Color.white);
AddLabel(showlabels, "H: " + AsText(lasthigh), Color.GREEN);
AddLabel(showlabels, "L: " + AsText(lastlow), Color.RED);
AddLabel(showlabels, "C: " + AsText(lastclose), Color.YELLOW);
AddLabel(showlabels, "R: " + AsText(h[offset]-l[offset]), Color.cyan);


input showbubbles = yes;
input bubblemover = 3;
def   b = bubblemover;
def  b1 = b + 1;
def last = IsNaN(close[b]) and !IsNaN(close[b1]);
AddChartBubble(showbubbles and last, lopen,  "O: " + AsText(lastopen), Color.white);
AddChartBubble(showbubbles and last, lhigh,  "H: " + AsText(lasthigh), Color.GREEN);
AddChartBubble(showbubbles and last, lclose, "C: " + AsText(lastclose), Color.YELLOW);
AddChartBubble(showbubbles and last, llow,   "L: " + AsText(lastlow), Color.RED, up = No);
 
Last edited:
Why when I move my mouse to GTLB at 9:30am, the bar doesn't show moving value? It is show fix O:62.75, H:62.75, L:62.75, C:62.75 R:0.00
But the top part showing value?
 
Why when I move my mouse to GTLB at 9:30am, the bar doesn't show moving value? It is show fix O:62.75, H:62.75, L:62.75, C:62.75 R:0.00
But the top part showing value?
This script (nor any script's addlabel function) is not interactive with your mouse. It is just the fixed bar based on the offset. The data box option in chart settings may help you.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
223 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top