Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
def na = Double.NaN;
def last = isNaN(Close);
def zone = if SelectZone==SelectZone."Supply Demand Zone" then 1 else
if SelectZone==SelectZone."Support Resistance Zone" then -1 else 0;
#---- Colors
DefineGlobalColor("SDColor" , CreateColor(23,105,170));
DefineGlobalColor("SupZoneColor" , Color.DARK_GREEN);
DefineGlobalColor("ResZoneColor" , Color.DARK_RED);
script nz {
input data = close;
input repl = 0;
def ret_val = if IsNaN(data) then repl else data;
plot return = ret_val;
}
script fixnan {
input source = close;
def fix = if !IsNaN(source) then source else fix[1];
plot result = fix;
}
def RSI1 = RSI(Price = close, Length = rsiLength);
def RSI1OB = if rsiObOs == rsiObOs."Manual" then OverboughtManualSelect else
if rsiObOs == rsiObOs."70 / 30" then 70 else
if rsiObOs == rsiObOs."75 / 25" then 75 else
if rsiObOs == rsiObOs."80 / 20" then 80 else
if rsiObOs == rsiObOs."90 / 10" then 90 else
if rsiObOs == rsiObOs."95 / 5" then 95 else 100;
def RSI1OS = if rsiObOs == rsiObOs."Manual" then OversoldManualSelect else
if rsiObOs == rsiObOs."70 / 30" then 30 else
if rsiObOs == rsiObOs."75 / 25" then 25 else
if rsiObOs == rsiObOs."80 / 20" then 20 else
if rsiObOs == rsiObOs."90 / 10" then 10 else
if rsiObOs == rsiObOs."95 / 5" then 5 else 0;
def RSI1incrementer_up = if RSI1 > RSI1OB then 1 else 0;
def RSI1incrementer_down = if RSI1 < RSI1OS then 1 else 0;
def RSI1incrementer_both = if RSI1 > RSI1OB or RSI1 < RSI1OS then 1 else 0;
def RSI1rsrH = if RSI1rsd >= NumberOfConfirmationBars then high else na;
def RSI1rsrL = if RSI1rsd >= NumberOfConfirmationBars then low else na;
def RSI1SupportZoneHigh = fixnan(RSI1rsrH);
def RSI1SupportZoneLow = fixnan(RSI1rsrL);
def RSI1_ResZoneColor = if RSI1ResistanceZoneHigh != RSI1ResistanceZoneHigh[1] or last then na else 1;
def RSI1_SupZoneColor = if RSI1SupportZoneLow != RSI1SupportZoneLow[1] or last then na else 1;
def RSI1SDColor = if RSI1rH != RSI1rH[1] or last then na else 1;
def RSI1RZHigh = if zone<=0 and RSI1_ResZoneColor then RSI1ResistanceZoneHigh else na; # "Resistance Zone - High"
def RSI1RZLow = if zone<=0 and RSI1_ResZoneColor then RSI1ResistanceZoneLow else na; # "Resistance Zone - Low"
AddCloud(RSI1RZHigh[-1], RSI1RZLow[-1], GlobalColor("ResZoneColor"), GlobalColor("ResZoneColor"), yes);
def RSI1SZHigh = if zone<=0 and RSI1_SupZoneColor then RSI1SupportZoneHigh else na; # "Support Zone - High"
def RSI1SZLow = if zone<=0 and RSI1_SupZoneColor then RSI1SupportZoneLow else na; # "Support Zone - Low"
AddCloud(RSI1SZHigh[-1], RSI1SZLow[-1], GlobalColor("SupZoneColor"), GlobalColor("SupZoneColor"), yes);
def RSI1rHi = if zone>=0 and RSI1SDColor then RSI1rH else na; # "Supply Demand - High"
def RSI1rLo = if zone>=0 and RSI1SDColor then RSI1rL else na; # "Supply Demand - Low"
AddCloud(RSI1rHi[-1],RSI1rLo[-1], GlobalColor("SDColor"), GlobalColor("SDColor"), yes);
#--- Signals
def UpCond = (close > RSI1rH) and (RSI1rH == RSI1rH[1]);
def UpCount = if UpCond then UpCount[1] + 1 else 0;
def CrossUp = UpCount==NumberOfConfirmationBars;
AddChartBubble(ShowBreaks and CrossUp,low, "Break", Color.GREEN, no);
#----
def DnCond = (close < RSI1rL) and (RSI1rL == RSI1rL[1]);
def DnCount = if DnCond then DnCount[1] + 1 else 0;
def CrossDn = DnCount==NumberOfConfirmationBars;
AddChartBubble(ShowBreaks and CrossDn,high, "Break", Color.RED, YES);