Volume Based Candles Identifier for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Most of the time traders are confused about if the price movements were supported by VOLUME. This indicator colors the bars into volume weighted signals...When prices go down bars are red and controversially when up, bars are green. Additionally we have two more colors for each situation:
  • DARK RED when prices go down and VOLUME is bigger than 150% of its (default 21 day) average, that indicates us price action is supported by a strong BEARISH VOLUME
  • RED when prices go down and VOLUME is BETWEEN 50% AND 150% of its (default 21 day) average, at this situation we can think that volume is neither strong nor weak
  • ORANGE when prices go down and VOLUME is just less than 50% of its (default 21 day) average, so the volume is weak and doesn't support the price action much
  • DARK GREEN when prices go UP and VOLUME bigger than 150% of its (default 21 day) average, that indicates us price action is supported by a strong BULLISH VOLUME
  • GREEN when prices go UP and VOLUME is BETWEEN 50% AND 150% of its (default 21 day) average, at this situation we can think that volume is neither strong nor weak
  • LIGHT GREEN when prices go UP and VOLUME is just less than 50% of its (default 21 day) average, so the volume is weak and doesn't support the price action much
Note: For this ThinkorSwim version, I have made changes to the coloring a bit.
  • LIGHT GREEN = WHITE and Orange = BLUE


thinkScript Code

Code:
# Volume Based Coloured Bars
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/8RPiMMmn-Volume-Based-Coloured-Bars/

# Note: LIGHT GREEN = WHITE and Orange = BLUE

input length = 21;

def avrg = simpleMovingAvg(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;

assignPriceColor(if vold1 then color.dark_red else if vold2 then color.red else if vold3 then color.blue else if volu1 then color.dark_green else if volu2 then color.uptick else if volu3 then color.white else color.CYAN);
 
P

princesly

New member
Warehouse
I like the idea but find it a bit confusing especially with the color white and blue. maybe it is because I am not catching its use from a day trading perspective. I wonder if it is possible to eliminate some colors or somehow correlate them with the distance of VWAP or some type of relation to the 50 and 200 EMA?
 
P

princesly

New member
Warehouse
@BenTen when I day-trade, I like to take into account the distance of the stock move away from the 9 EMA, VWAP, 50 & 200 EMA respectively. To have the indicator configurable for those targets on a 14 or 50 day period would be gold because you can backtest the method for a conservative entry with stop loss.

Another candle-coloring option would be to leverage the 4 periods RSI at 90 and 10 percent as an oversold/overbought indicator on a multi-timeframe--especially 30 minutes or day. So in other words, over 90% and 10% would indicate a customizable respective colored candle.

I think the Z-Score indicator covers my thoughts on the distance from the VWAP but leveraging that logic and other logics suggested above on the candle color would help a great deal because it would give you not only volume customization option but others as well.

I know it is a bit of a loaded request that could be for a different indicator but it would add diverse flexibility to different-styled day traders that need one less indicator on their chart.

Thanks for the consideration, you rock!
Prince
 
Last edited:
S

SupaDupa

New member
Is there a way to show volume by increasing decreasing the width of the candle i.e. fatter candles would represent increase volume and vice versa TY
 
L

lindosskier

New member
@BenTen, could you possibly add to the code the ability to color the candles based on the average of the last 3 candles let's say (you can leave that open for everyone to put their own number). I think this will help us "Smooth" the noise that may come from just 1 candle/print. And if we can combine that with what @DeusMecanicus shared, I think we would have a GREAT indicator. Much appreciated and thank you for your help in advance.
 

Top