Hi folks,
I'm running the WalkingBallista 30 min opening range script in a watchlist column that lets me know when a ticker is above, within or below the Opening Range Breakout (I happen to use 30 minutes). I'd like to have another column that shows me the current monetary gain from the ORB High (vs another column that I run that shows me the gain from Day's Open).
I'm running the WalkingBallista 30 min opening range script in a watchlist column that lets me know when a ticker is above, within or below the Opening Range Breakout (I happen to use 30 minutes). I'd like to have another column that shows me the current monetary gain from the ORB High (vs another column that I run that shows me the gain from Day's Open).
Code:
# 30 min opening range
# Robert Payne
# WalkingBallista Watchlist
def OpenRangeMinutes = 30;
def MarketOpenTime = 0930;
input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;
def FirstMinute = if SecondsFromTime(MarketOpenTime) < 60 then 1 else 0;
def OpenRangeTime = if SecondsFromTime(MarketOpenTime) < 60 * OpenRangeMinutes then 1 else 0;
def ORHigh = if FirstMinute then high else if OpenRangeTime and high > ORHigh[1] then high else ORHigh[1];
def ORLow = if FirstMinute then low else if OpenRangeTime and low < ORLow[1] then low else ORLow[1];
def OpenRangeHigh = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORHigh else Double.NaN;
def OpenRangeLow = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORLow else Double.NaN;
def dailyRange = high(period = "day" )[1] - low(period = "day" )[1];
def range = Average(dailyRange, 10);
plot status = if close > OpenRangeHigh then 1 else if close < OpenRangeLow then 0 else -1;
status.AssignValueColor(if status == 1 then Color.Green else if status == 0 then Color.Red else Color.Orange);
AssignBackgroundColor(if status == 1 then Color.Green else if status == 0 then Color.Red else Color.Orange);
Last edited: