I did change the AlertOn feature to no, but i am still seeing alerts. I dont know how to attach picture with URL...is there a way I can just insert picture?@jan_angel It's located under the indicator's settings. Switch Alerts from Yes to No.
# Opening_Range_Breakout Strategy with Risk and Target Lines
declare hide_on_daily;
declare once_per_bar;
input OrMeanS = 0930.0; #hint OrMeanS: Begin Mean Period. Usually Market Open EST.
input OrMeanE = 0935.0; #hint OrMeanE: End Mean period. Usually End of first bar.
input OrBegin = 0930.0; #hint OrBegin: Beginning for Period of Opening Range Breakout.
input OrEnd = 1000.0; #hint OrEnd: End of Period of Opening Range Breakout.
input RthEnd = 1600;
input CloudOn = no; #hint CloudOn: Clouds Opening Range.
input AlertOn = yes; #hint AlertOn: Alerts on cross of Opening Range.
input ShowTodayOnly = yes;
input nAtr = 4; #hint nATR: Lenght for the ATR Risk and Target Lines.
input AtrTargetMult = 2.0;#hint ATRmult: Multiplier for the ATR calculations.
input InitialRisk = 1.00; #hint InitialRisk: Amount of Risk your will to take opening a trade.
input ShowTargetBubbles = yes;
def h = high;
def l = low;
def c = close;
def bar = BarNumber();
def na = Double.NaN;
def TS = TickSize();
def BubbleX = bar == HighestAll(bar);
def s = ShowTodayOnly;
def Agg = GetAggregationPeriod() / 1000 / 60;
def RTH = if SecondsFromTime(0930) >= 0 and
SecondsFromTime(1600) >= 0
then 1
else 0;
def RTHbar1 = if RTH and !RTH[1]
then bar
else na;
def ORActive = if SecondsTillTime(OrMeanE) > 0 and
SecondsFromTime(OrMeanS) >= 0
then 1
else 0;
def today = if s == 0
or GetDay() == GetLastDay() and
SecondsFromTime(OrMeanS) >= 0
then 1
else 0;
def ORHigh = if ORHigh[1] == 0
or ORActive[1] == 0 and
ORActive == 1
then h
else if ORActive and
h > ORHigh[1]
then h
else ORHigh[1];
def ORLow = if ORLow[1] == 0
or ORActive[1] == 0 and
ORActive == 1
then l
else if ORActive and
l < ORLow[1]
then l
else ORLow[1];
def ORWidth = ORHigh - ORLow;
def ORHA = if ORActive
or today < 1
then na
else ORHigh;
def ORLA = if ORActive
or today < 1
then na
else ORLow;
def O = ORHA - Round(((ORHA - ORLA) / 2) / TS, 0) * TS;
def ORActive2 = if SecondsTillTime(OrEnd) > 0 and
SecondsFromTime(OrBegin) >= 0
then 1
else 0;
def ORHigh2 = if ORHigh2[1] == 0
or ORActive2[1] == 0 and
ORActive2 == 1
then h
else if ORActive2 and
h > ORHigh2[1]
then h
else ORHigh2[1];
def ORLow2 = if ORLow2[1] == 0
or ORActive2[1] == 0 and
ORActive2 == 1
then l
else if ORActive2 and
l < ORLow2[1]
then l
else ORLow2[1];
def ORWidth2 = ORHigh2 - ORLow2;
def TimeLine = if SecondsTillTime(OrEnd) == 0
then 1
else 0;
def ORmeanBar = if !ORActive and ORActive[1]
then bar
else ORmeanBar[1];
def ORendBar = if !ORActive2 and ORActive2[1]
then bar
else ORendBar[1];
def ORH2 = if ORActive2
or today < 1
then na
else ORHigh2;
plot ORH2ext = if ShowTodayOnly and bar >= HighestAll(ORendBar)
then HighestAll(if IsNaN(c[-1])
then ORH2[1]
else na)
else if !ShowTodayOnly
then ORH2
else na;
ORH2ext.SetDefaultColor(Color.GREEN);
ORH2ext.SetStyle(Curve.LONG_DASH);
ORH2ext.SetLineWeight(3);
ORH2ext.HideTitle();
def ORL2 = if ORActive2
or today < 1
then na
else ORLow2;
plot ORL2ext = if BarNumber() >= HighestAll(ORendBar)
then HighestAll(if IsNaN(c[-1])
then ORL2[1]
else Double.NaN)
else Double.NaN;
ORL2ext.SetDefaultColor(Color.RED);
ORL2ext.SetStyle(Curve.LONG_DASH);
ORL2ext.SetLineWeight(3);
ORL2ext.HideTitle();
def Bubbleloc1 = isNaN(close[-1]);
def BreakoutBar = if ORActive
then double.nan
else if !ORActive and c crosses above ORH2
then bar
else if !isNaN(BreakoutBar[1]) and c crosses ORH2
then BreakoutBar[1]
else BreakoutBar[1];
def ATR = if ORActive2
then Round((Average(TrueRange(h, c, l), nATR)) / TickSize(), 0) * TickSize()
else ATR[1];
def cond1 = if h > ORH2 and
h[1] <= ORH2
then Round((ORH2 + (ATR * AtrTargetMult)) / TickSize(), 0) * TickSize()
else cond1[1];
def crossUpBar = if close crosses above ORH2
then bar
else double.nan;
# High Targets
plot Htarget = if bar >= HighestAll(ORendBar)
then HighestAll(cond1)
else na;
Htarget.SetLineWeight(1);
Htarget.SetDefaultColor(Color.WHITE);
Htarget.HideTitle();
AddChartBubble(ShowTargetBubbles and BubbleLoc1, cond1, "1:1", Color.WHITE, if c > Htarget then no else yes);
def condHtarget2 = if h crosses above cond1
then Round((cond1 + (ATR * AtrTargetMult)) / TS, 0) * TS
else condHtarget2[1];
plot Htarget2 = if bar >= HighestAll(ORendBar) #BreakoutBar
then HighestAll(if IsNaN(c[-1])
then condHtarget2
else na)
else na;
Htarget2.SetLineWeight(1);
Htarget2.SetDefaultColor(Color.WHITE);
Htarget2.HideTitle();
AddChartBubble(ShowTargetBubbles and BubbleLoc1, condHtarget2, "2:1", Color.WHITE, if c > Htarget2
then no
else yes);
# End Code ORB VO3(B)
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
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.
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.