Hi, I'm looking for help on a script that's able to simply shade the area chosen for IB (I like using the first hour) but there would be an input to choose which range you want to define as your IB.
Once IB closes ( 10:30am ET) in my example, the labels will show " IB high : $ price | IB low: $ price | IB mid : $ price "
if Price is above IB high color dark.green , if below IB low, color pink, if in between IB high and IB low, color white.
This the IB for today with the proper shading im looking for from tradingview
No, it stems from a method some futures traders follow that identifies the Initial balance (9:30-10:30; first hour of trading) which then sets up the rest of the session. There is historical analysis/backtests out there that go into the probability of trades, long/short, if price closes above the "IB" high on x timeframe, and vice versa. There's a ton of info on IB out there that i can link if you're interested.
The indicator really is just a simple one, imo, that "paints" the IB area once it closes with a shaded box and the label then displays the IB high (price), IB mid (halfway point between Hi/lo) price and IB Low (price). The background coloring then just follows the close of each candle to determine the coloring.
No, it stems from a method some futures traders follow that identifies the Initial balance (9:30-10:30; first hour of trading) which then sets up the rest of the session. There is historical analysis/backtests out there that go into the probability of trades, long/short, if price closes above the "IB" high on x timeframe, and vice versa. There's a ton of info on IB out there that i can link if you're interested.
The indicator really is just a simple one, imo, that "paints" the IB area once it closes with a shaded box and the label then displays the IB high (price), IB mid (halfway point between Hi/lo) price and IB Low (price). The background coloring then just follows the close of each candle to determine the coloring.
Sure. The script will allow for an adjustable “initial balance”. For my purposes it would equal the first hour of trading. And the shading would draw a box that covers the high and low achieved during that period. It should also paint a dashed line for the mid (didn’t include this prior). The line doesn’t have to extend past the box.
Hi, I'm looking for help on a script that's able to simply shade the area chosen for IB (I like using the first hour) but there would be an input to choose which range you want to define as your IB.
Once IB closes ( 10:30am ET) in my example, the labels will show " IB high : $ price | IB low: $ price | IB mid : $ price "
if Price is above IB high color dark.green , if below IB low, color pink, if in between IB high and IB low, color white.
This the IB for today with the proper shading im looking for from tradingview
general comment meant to help people compose better requests,
after reading 100s of questions, i have observed, if the word 'simply' is used in a request, almost always there is missing information. reread your post and if you find that word, read it again and elaborate.
when making a request, think about what you want to see and what has to happen.
don't expect others to interpret a picture. your words should describe the situation.
include a link to describe theories.
don't use meaningless terms or abbreviations.
ib or Initial Balance , has no meaning in TOS. you didn't offer any information or link that would describe what it is.
i think you want,
.. define some period, with start and stop times.
.. within this time period, find the highest and lowest prices.
.. calculate the middle price level.
change the color of something, but i'm not sure what.
you mention 3 colors for 3 price situations, but you don't say WHAT you want colored.
----------------------
this finds the highest and lowest , over some period, within a day.
it shades the region
labels show the hi, lo, mid levels
Code:
#period_hilomid_ib
#https://usethinkscript.com/threads/initial-balance-with-labels.21237/
#Initial Balance with Labels
#hboogie 7/7
# shade the area chosen for IB (I like using the first hour)
# but there would be an input to choose which range you want to define as your IB.
# Once IB closes ( 10:30am ET) in my example,
# the labels will show
# IB high : $ price | IB low: $ price | IB mid : $ price
# ??
# dark.green - Price is above IB high color
# pink - price is below IB low
# white - price is in between IB high and IB low
def na = double.nan;
def bn = barnumber();
def n = 500;
def big = 99999;
input start = 0930;
input end = 1030;
def period = if SecondsFromTime(start) >= 0 and SecondsTillTime(end) > 0 then 1 else 0;
def hi;
def lo;
if period and !period[1] then {
hi = fold a = 0 to n
with b
while getvalue(period,-a)
do max(b,getvalue(high,-a));
lo = fold c = 0 to n
with d = big
while getvalue(period,-c)
do min(d,getvalue(low,-c));
} else if period then {
hi = hi[1];
lo = lo[1];
} else {
hi = 0;
lo = 0;
}
def mid = (hi+lo)/2;
def hi2 = if (period and !period[1]) then hi else hi2[1];
def lo2 = if (period and !period[1]) then lo else lo2[1];
def mid2 = if (period and !period[1]) then mid else mid2[1];
addlabel(1," IB high : $ " + hi2, color.yellow);
addlabel(1," IB low: $ " + lo2, color.yellow);
addlabel(1," IB mid : $ " + mid2, color.yellow);
plot z1 = if hi > 0 then hi else na;
z1.SetDefaultColor(Color.gray);
#z1.setlineweight(1);
z1.hidebubble();
plot z2 = if lo > 0 then lo else na;
z2.SetDefaultColor(Color.gray);
#z2.setlineweight(1);
z2.hidebubble();
plot z3 = if lo > 0 then mid else na;
z3.SetStyle(Curve.MEDIUM_DASH);
z3.SetDefaultColor(Color.cyan);
#z3.setlineweight(1);
z3.hidebubble();
addcloud(z1,z2,color.gray);
#
Ok Interesting. I see it as an ORB without the buys and sells and stops - I did add some labels that I would use as current hi lo and mid values - a volume label to signal rising or falling volume and an accumulated average candle close price to see how far off mid I am at the moment... I also extended the lines to close of day (really to mid-night to capture overnight action.)
Just a note
The script calculates the running average of candle closes from 9:30 to 15:59, based on whatever timeframe you're currently viewing (1-min, 5-min, 15-min, etc.). So on a 1-minute chart, it averages 1-minute close values. On a 5-minute chart, it averages the 5-minute candle closes and remember fewer candles = fewer data points = different average result.
Just playing with it - added some areas of interest with labelling and some conditions that identify cycles as dealers will play with liquidity from time to time and added some labelling to identify compression zones to be a tad bit more proactive. https://tos.mx/!1qcxixv4
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.
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.