Hi All,
I'd like to put the RR chart bubbles to the right of the current bar a few bars into the future. Is this possible to do? Currently the RR bubble on the current candle is hindering my view. If its not possible to push the bubbles to the right, am I able to eliminate the bubble on each current bar so that my view isn't hindered? I've searched existing studies but haven't been able to find the right code. Thanks in advance!
I'd like to put the RR chart bubbles to the right of the current bar a few bars into the future. Is this possible to do? Currently the RR bubble on the current candle is hindering my view. If its not possible to push the bubbles to the right, am I able to eliminate the bubble on each current bar so that my view isn't hindered? I've searched existing studies but haven't been able to find the right code. Thanks in advance!
Code:
input marketThreshold = 0.0025;
input timeFrameDay = {default DAY};
input applyPersonsLevelsFilter = yes;
assert(marketThreshold >= 0, "'market threshold' must not be negative: " + marketThreshold);
def marketType = {default DISABLED, NEUTRAL, BEARISH, BULLISH};
def PP2 = high(period = timeFrameDay)[2] + low(period = timeFrameDay)[2] + close(period = timeFrameDay)[2];
marketType = if !applyPersonsLevelsFilter then marketType.DISABLED else
if PP2[-1] > (PP2[-1] + PP2 + PP2[1]) / 3 + marketThreshold then marketType.BULLISH else
if PP2[-1] < (PP2[-1] + PP2 + PP2[1]) / 3 - marketThreshold then marketType.BEARISH else marketType.NEUTRAL;
def R3;
def R2;
def R1;
def RR;
def PP;
def SS;
def S1;
def S2;
def S3;
if !IsNaN(close(period = timeFrameDay)[-1])
then {
R1 = Double.NaN;
R2 = Double.NaN;
R3 = Double.NaN;
PP = Double.NaN;
S1 = Double.NaN;
S2 = Double.NaN;
S3 = Double.NaN;
} else {
PP = (high(period = timeFrameDay)[1] + low(period = timeFrameDay)[1] + close(period = timeFrameDay)[1]) / 3;
R1 = 2 * PP - low(period = timeFrameDay)[1];
R2 = PP + high(period = timeFrameDay)[1] - low(period = timeFrameDay)[1];
R3 = R2 + high(period = timeFrameDay)[1] - low(period = timeFrameDay)[1];
S1 = 2 * PP - high(period = timeFrameDay)[1];
S2 = PP - high(period = timeFrameDay)[1] + low(period = timeFrameDay)[1];
S3 = S2 - high(period = timeFrameDay)[1] + low(period = timeFrameDay)[1];
}
RR = if (marketType == marketType.BEARISH or marketType == marketType.NEUTRAL) then R1 else R2;
SS = if (marketType == marketType.BULLISH or marketType == marketType.NEUTRAL) then S1 else S2;
def bn = HighestAll(if open == open then BarNumber()-3 else double.nan);
def futurebar = 5;
def x = (!IsNaN(close[futurebar]) and IsNaN(close[futurebar - 1]));
def RRBub = if barnumber() < bn then double.nan else Highestall(if (isnan(close[-1]) and !IsNaN(close)) and RR > close * .99 and RR < close * 1.01 then 1 else double.nan);
DefineGlobalColor("D”, CreateColor(133, 163, 104));
addchartbubble(rrbub,RR, "RR", GlobalColor("D"));
Last edited: