VSC Volume Strength Candles For ThinkOrSwim

tciccarelli750

New member
Can someone convert this to TOS ? (Trading View Code)


//StokedStocks Volume Strength Candles / Bars (VSC)
//Is Price Action Higher or Lower on STRONG or WEAK VOLUME from lookback / Length (Strong or Weak Bulls // Strong or Weak Bears)
//Candles / Bars Indicate the Following (default 13 period lookback / Length)
//MAROON Bear Candle with STRONG VOLUME more than 150% of the lookback / length (13 default), STRONG Bear Candle Confirmed With Volume
//RED Bear Candle while VOLUME is BETWEEN 50% & 150% of the Lookback / Length (13 default), Neutral Bear Volume Neither strong or weak
//ORANGE Bear Candle with WEAK VOLUME (Less than 50% of the Length / Lookback)
//DARK GREEN Bull Candle with STRONG VOLUME MORE than 150% of lookback
//GREEN Bull Candle with Neutral VOLUME BETWEEN 50% & 150% of the lookback / Length
//AQUA Bull Candle with WEAK VOLUME less than 50% of the Lookback
 
Last edited by a moderator:
Can someone convert this to TOS ? (Trading View Code)


//StokedStocks Volume Strength Candles / Bars (VSC)
//Is Price Action Higher or Lower on STRONG or WEAK VOLUME from lookback / Length (Strong or Weak Bulls // Strong or Weak Bears)
//Candles / Bars Indicate the Following (default 13 period lookback / Length)
//MAROON Bear Candle with STRONG VOLUME more than 150% of the lookback / length (13 default), STRONG Bear Candle Confirmed With Volume
//RED Bear Candle while VOLUME is BETWEEN 50% & 150% of the Lookback / Length (13 default), Neutral Bear Volume Neither strong or weak
//ORANGE Bear Candle with WEAK VOLUME (Less than 50% of the Length / Lookback)
//DARK GREEN Bull Candle with STRONG VOLUME MORE than 150% of lookback
//GREEN Bull Candle with Neutral VOLUME BETWEEN 50% & 150% of the lookback / Length
//AQUA Bull Candle with WEAK VOLUME less than 50% of the Lookback
//Is price confirmed by volume?
//Can Change the Lookback / Length from 13
//Can Change the Colors and Transparency I recommend ZERO Transparency to easily identify volume strength

study("Volume Strength Candles / Bars", shorttitle="VSC", overlay=true)
length=input(13, "length", minval=1)
avrg=sma(volume,length)

vold1 = volume > avrg*1.5 and close<open
vold2 = volume >= avrg*0.5 and volume<=avrg*1.5 and close<open
vold3 = volume < avrg *0.5 and close<open

volu1 = volume > avrg*1.5 and close>open
volu2 = volume >= avrg*0.5 and volume<=avrg*1.5 and close>open
volu3 = volume< avrg*0.5 and close>open


cold1=maroon
cold2=red
cold3=orange


colu1=#006400
colu2=lime
colu3=aqua


color = vold1 ? cold1 : vold2 ? cold2 : vold3 ? cold3 : volu1 ? colu1 : volu2 ? colu2 : volu3 ? colu3 : na

barcolor(color)

here you go
when asking for a conversion, please post a link to the original study.
https://www.tradingview.com/script/e8XCokTw-Volume-Strength-Candles-Colored-Bars/


Ruby:
# convert_vsc_0

# https://usethinkscript.com/threads/convert-tradingview-vsc-indicator.11289/
# Convert TradingView VSC Indicator
#  tciccarelli750  5/16  at 1:41 PM
# Can someone convert this to TOS ? (Trading View Code)
# https://www.tradingview.com/script/e8XCokTw-Volume-Strength-Candles-Colored-Bars/

def na = double.nan;
input length = 13;
input avg1_type =  AverageType.simple;
def avrg = MovingAverage(avg1_type, volume, length);

def vold1 = (volume > (avrg * 1.5) and close < open);
def vold2 = (volume >= (avrg * 0.5) and volume <= (avrg * 1.5) and close<open);
def vold3 = (volume < (avrg * 0.5) and close < open);

def volu1 = (volume > (avrg * 1.5) and close > open);
def volu2 = (volume >= (avrg * 0.5) and volume <= (avrg*1.5) and close > open);
def volu3 = (volume < (avrg * 0.5) and close > open);


#cold1=maroon
DefineGlobalColor("cold1", CreateColor(128, 0, 0));
#cold2=red
DefineGlobalColor("cold2", CreateColor(255, 0, 0));
#cold3=orange
DefineGlobalColor("cold3", CreateColor(255, 165, 0));

#colu1=#006400  dark green
DefineGlobalColor("colu1", CreateColor(0, 100, 0));
#colu2=lime , change to green
DefineGlobalColor("colu2", CreateColor(0, 255, 0));
#colu3=aqua
DefineGlobalColor("colu3", CreateColor(0, 255, 255));

AssignPriceColor(
     if vold1 then GlobalColor("cold1")
else if vold2 then GlobalColor("cold2")
else if vold3 then GlobalColor("cold3")
else if volu1 then GlobalColor("colu1")
else if volu2 then GlobalColor("colu2")
else if volu3 then GlobalColor("colu3")
else color.current);

# -------------------------

#//StokedStocks Volume Strength Candles / Bars (VSC)
#//Is Price Action Higher or Lower on STRONG or WEAK VOLUME from lookback / Length (Strong or Weak Bulls 
#// #Strong or Weak Bears)
#//Candles / Bars Indicate the Following (default 13 period lookback / Length)
#//MAROON Bear Candle with STRONG VOLUME more than 150% of the lookback / length (13 default), STRONG Bear Candle Confirmed With Volume
#//RED Bear Candle while VOLUME is BETWEEN 50% & 150% of the Lookback / Length (13 default), Neutral Bear Volume Neither strong or weak
#//ORANGE Bear Candle with WEAK VOLUME (Less than 50% of the Length / Lookback)
#//DARK GREEN Bull Candle with STRONG VOLUME MORE than 150% of lookback
#//GREEN Bull Candle with Neutral VOLUME BETWEEN 50% & 150% of the lookback / Length
#//AQUA Bull Candle with WEAK VOLUME less than 50% of the Lookback
#//Is price confirmed by volume?
#//Can Change the Lookback / Length from 13
#//Can Change the Colors and Transparency I recommend ZERO Transparency to easily identify volume strength

#study("Volume Strength Candles / Bars", shorttitle="VSC", overlay=true)
#length=input(13, "length", minval=1)
#avrg=sma(volume,length)

#vold1 = volume > avrg*1.5 and close<open
#vold2 = volume >= avrg*0.5 and volume<=avrg*1.5 and close<open
#vold3 = volume < avrg *0.5 and close<open

#volu1 = volume > avrg*1.5 and close>open
#volu2 = volume >= avrg*0.5 and volume<=avrg*1.5 and close>open
#volu3 = volume< avrg*0.5 and close>open

#color = vold1 ? cold1 : vold2 ? cold2 : vold3 ? cold3 : volu1 ? colu1 : volu2 ? colu2 : volu3 ? colu3 : na
#barcolor(color)
#


NQD38Bq.jpg



reference links
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/DefineGlobalColor
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AssignPriceColor

use this page to find RGB colors
https://www.w3schools.com/colors/colors_picker.asp
 

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
543 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