custom watchlist showing 1st 15 min candle, RSI and VWAP

Epavell

New member
custom watchlist showing above/below 1st 15 min candle, RSI, and VWAP

Looking to create a watchlist field to show the following information:

Note: I have coding below that might help with the below but I have limited skills in making it all jive together.
  1. Show the price of the midpoint of the first fifteen minute candle.
  2. Show where we are in relation to the first fifteen minute candles midpoint. So current price above first candle mid say “ Above Mid”. Current price below first candle mid say ”Below Mid”. Equal to “ “.
  3. Show RSI number. (Positive number as it is ex “15” if negative show negative sign ex. “-15”
IF close of price is greater/above VWAP (have coding as well) and above midpoint price of first 15 min candle and RSI number is greater than 15 then color the box green.

If close of price is less than/below VWAP and below midpoint price of first 15 min candle and RSI number is negative 15 or more then color the box red.

Else the box can be color.white

Note the letters/number should be color.black for best visualization.

Appreciate your help in this.




Coding found in TOS from other scripts that might be helpful to code.

#####Vwap info####

def myVwap = Reference VWAP();


#####15 Min aggregation period #####

### 15m timeframe ###

def tf15m = AggregationPeriod.FIFTEEN_MIN;
def valid15m = GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN;

def h15m;
def l15m;
def o15m;
def c15m;
def grn15m;
def red15m;
def onebar15m;
def twobar15m;
def thrbar15m;

if valid15m {

h15m = high (period = tf15m)
l15m = low (period = tf15m);
o15m = open (period = tf15m);
c15m = close(period = tf15m);
onebar15m = h15m <= h15m[1] && l15m >= l15m[1];
twobar15m = h15m <= h15m[1] && l15m < l15m[1] or h15m > h15m[1] && l15m >= l15m[1];
thrbar15m = h15m > h15m[1] && l15m < l15m[1];
grn15m = o15m <= c15m;
red15m = o15m >= c15m;

} else {
h15m = 0;
l15m = 0;
o15m = 0;
c15m = 0;
grn15m = Double.NaN;
red15m = Double.NaN;
onebar15m = Double.NaN;
twobar15m = Double.NaN;
thrbar15m = Double.NaN;
}


####Midpoint candle code ####

input candletype = {default candle, heikinashi};
def HAclose = hlc3;
rec HAopen = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh = Max( high, Max( HAopen, HAclose ) );
def HAlow = Min( low, Min( HAopen, HAclose ) );
plot Data = if candletype == candletype.heikinashi

then (HAhigh + HAlow) / 2
else hl2;

Data.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Data.AssignValueColor(if Data > Data[1] then Color.GREEN else CreateColor(102, 0, 0));
Data.SetLineWeight(5);


###RSI Histogram Code####

declare lower;
input fastLength = 12;
input slowLength = 26;
input RSILength = 8;
input Multiplier = 1.5;
input Over_Sold = -20;
input Over_Bought = 20;
input averageType = AverageType.EXPONENTIAL;
input showBreakoutSignals = yes;


plot Diff = (RSI(RSILength,100, 0, close) - 50) * multiplier;

# plot Diff = MACD(fastLength, slowLength, MACDLength, averageType).Diff;
plot UpSignal = if Diff crosses above 20 then 0 else Double.NaN;
plot DownSignal = if Diff crosses below 20 then 0 else Double.NaN;
plot OverSold = over_Sold;
plot OverBought = over_Bought;
# plot POverSold = P_over_Sold;
# plot POverBought = P_over_Bought;
plot Zzero = 0;

UpSignal.SetHiding(!showBreakoutSignals);


DownSignal.SetHiding(!showBreakoutSignals);
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));
Zzero.SetDefaultColor(Color.BLACK);

Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);

Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.RED);

Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.GREEN);

Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));

UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

###################
###ADDED CODE for SIGNALS

##########################
#DEF VOLBOMB = Diff > Diff[1];
#Plot bullish = volbomb;
#bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#alert(bullish,”VOLBOMB”, alert.Bar, sound.ding);

Plot volbomb = diff > 20;
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
260 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

What are the benefits of VIP Membership?
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.
Back
Top