Wick Pressure For ThinkOrSwim

TPTrades

Member
VIP
The author states:
Multiple Wicks forming at OverSold & OverBought levels create Buying and Selling Pressure. This Script tries to capture the essence of the buy and sell pressure created by those wicks. Wick pressure shows that the trend is Exhausted.

How it works:
This Wick Pressure Indicator checks for three candles forming the wicks in overbought and oversold zones. The zones are set by RSI and can be changed in settings. Those three candles should form a bit long wick and length of the wick is determined by ATR. The ATR multiple can be changed from settings. And then the script draws a box in the area formed by three candle wicks.

iHail7i.png

Found this really cool script from trading view and would like to test on TOS.
https://www.tradingview.com/script/w2sPsVff-Wick-Pressure-by-SiddWolf/
@samer800 is it possible to convert this to TOS?
 
Last edited by a moderator:
Found this really cool script from trading view and would like to test on TOS.

https://www.tradingview.com/script/w2sPsVff-Wick-Pressure-by-SiddWolf/

code below:

Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SiddWolf

//@version=5
indicator(title="Wick Pressure by SiddWolf", shorttitle="WP [SiddWolf]", overlay=true)

mee_rsi = ta.rsi(close, 14)
atr_mult = input.float(title="ATR Multiplier",defval=0.7, step=0.1, minval=0.4, maxval=2.0, tooltip="The Wick area is filtered on the basis of atr and this is multiplier to that ATR. The more the multiplier value, the less the signals and vice versa")
box_length = input.int(title="Box Length",defval=16, step=2, minval=4, maxval=100, tooltip="Length of Wick Pressure Box")
rsi_ob = input.int(title="RSI OverBought",defval=60, step=5, minval=50, maxval=90, inline="rsi_settings", tooltip="RSI based on which signnals are filtered")
rsi_os = input.int(title="RSI OverSold",defval=40, step=5, minval=10, maxval=50, inline="rsi_settings")
bull_color = input(defval=#00FF0021, title="Bullish Pressure", inline="box_color")
bear_color = input(defval=#FF000021, title="Bearish Pressure", inline="box_color")


//bullish wick pressure
rsi_bullish_cond = mee_rsi < rsi_os or mee_rsi[1] < rsi_os or mee_rsi[2] < rsi_os
ll3 = ta.lowest(low, 3)
lc3 = math.min(ta.lowest(close, 3), ta.lowest(open, 3))
sidd_bull_cond = low<=lc3 and low[1]<=lc3 and low[2]<=lc3 and open>=lc3 and open[1]>=lc3 and open[2]>=lc3 and lc3-ll3>(atr_mult*ta.atr(14)) and rsi_bullish_cond and close>open
if sidd_bull_cond
    box.new(bar_index, lc3, bar_index+box_length, ll3, bgcolor=bull_color, border_color=color.green)

plotshape(sidd_bull_cond,  style = shape.triangleup, color = color.green, location =  location.belowbar, size = size.small)




//bearish wick pressure
rsi_bearish_cond = mee_rsi > rsi_ob or mee_rsi[1] > rsi_ob or mee_rsi[2] > rsi_ob
hh3 = ta.highest(high, 3)
hc3 = math.max(ta.highest(close, 3), ta.highest(open, 3))
sidd_bear_cond = high>=hc3 and high[1]>=hc3 and high[2]>=hc3 and open<=hc3 and open[1]<=hc3 and open[2]<=hc3 and hh3-hc3>(atr_mult*ta.atr(14)) and rsi_bearish_cond and close<open
if sidd_bear_cond
    box.new(bar_index, hh3, bar_index+box_length, hc3, bgcolor=bear_color, border_color=color.red)

plotshape(sidd_bear_cond,  style = shape.triangledown, color = color.red, location =  location.abovebar, size = size.small)

@samer800 is it possible to convert this to TOS?
check the below:

CSS:
#/ This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © SiddWolf
#indicator(title="Wick Pressure by SiddWolf", shorttitle="WP [SiddWolf]", overlay=true)
#hint atrMultiplier: The Wick area is filtered on the basis of atr and this is multiplier to that ATR. The more the multiplier value, the less the signals and vice versa.
#Hint maxBoxLength: Length of Wick Pressure Box.

# Converted by Sam4Cok@Samer800    - 04/2024

input showLabels = yes;
input rsiLength = 14;
input atrLength = 14;
input lookbackPressure = 3;
input atrMultiplier = 0.7;     # "ATR Multiplier"
input maxBoxLength = 50;       # "Box Length"
input rsiOverbought = 60;      # "RSI OverBought"
input rsiOversold = 40;        # "RSI OverSold"

def na = Double.NaN;

Script Pivots {
    input series    = close;
    input left  = 10;
    input right = 10;
    input isHigh = yes;
    def na = Double.NaN;
    def leftBars = RoundUp(left, 0);
    def rightBars = RoundUp(right, 0);
    def HH = series == Highest(series, leftBars + 1);
    def LL = series == Lowest(series, leftBars + 1);
    def pivotRange = (leftBars + rightBars + 1);
    def leftEdgeValue = if series[pivotRange] ==0 then na else series[pivotRange];
    def pvtCond = !isNaN(series) and leftBars > 0 and rightBars > 0 and !isNaN(leftEdgeValue);
    def barIndexH = if pvtCond then
                    fold i = 1 to rightBars + 1 with p=1 while p do
                    series > GetValue(series, - i) else na;
    def barIndexL = if pvtCond then
                    fold j = 1 to rightBars + 1 with q=1 while q do
                    series < GetValue(series, - j) else na;
    def PivotPoint;
if isHigh {
    PivotPoint = if HH and barIndexH then series else na;
    } else {
    PivotPoint = if LL and barIndexL then series else na;
    }
    plot pvt = PivotPoint;
}
def ph = Pivots(high, maxBoxLength, maxBoxLength/10, yes);
def pl = Pivots(low, maxBoxLength, maxBoxLength/10, no);
def mee_rsi = RSI(Price = close, Length = rsiLength);
def atrBand = ATR(Length = atrLength) * atrMultiplier;
#//bullish wick pressure
def rsi_bullish_cond = mee_rsi < rsiOversold or mee_rsi[1] < rsiOversold or mee_rsi[2] < rsiOversold;
def ll3 = Lowest(low, lookbackPressure);
def oL3 = Lowest(open, lookbackPressure);
def cL3 = Lowest(close, lookbackPressure);
def lc3 = Min(cL3, oL3);
def sidd_bull_cond = low <= lc3 and low[1] <= lc3 and low[2] <= lc3 and open >= lc3 and open[1] >= lc3 and open[2] >= lc3
                    and (lc3 - ll3) > atrBand and rsi_bullish_cond and close > open;

def cntUp = if sidd_bull_cond then 0 else if !isNaN(pl) then maxBoxLength + 1 else cntUp[1] + 1;
def TopB = if sidd_bull_cond then lc3 else TopB[1];
def BotB = if sidd_bull_cond then ll3 else BotB[1];

#//bearish wick pressure
def rsi_bearish_cond = mee_rsi > rsiOverBought or mee_rsi[1] > rsiOverBought or mee_rsi[2] > rsiOverBought;
def hh3 = highest(high, lookbackPressure);
def oH3 = highest(open, lookbackPressure);
def cH3 = highest(close, lookbackPressure);
def hc3 = Max(cH3, oH3);
def sidd_bear_cond = high>=hc3 and high[1]>=hc3 and high[2]>=hc3 and open<=hc3 and open[1]<=hc3 and open[2]<=hc3
                    and (hh3-hc3) > atrBand and rsi_bearish_cond and close<open;

def cntDn = if sidd_bear_cond then 0 else if !isNaN(ph) then  maxBoxLength + 1 else cntDn[1] + 1;
def TopS = if sidd_bear_cond then hh3 else TopS[1];
def BotS = if sidd_bear_cond then hc3 else BotS[1];

#-- Plot

plot BullTop = if TopB and cntUp <= maxBoxLength then TopB else na;
plot BullBot = if BotB and cntUp <= maxBoxLength then BotB else na;
plot BearTop = if TopS and cntDn <= maxBoxLength then TopS else na;
plot BearBot = if BotS and cntDn <= maxBoxLength then BotS else na;

BullTop.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
BullBot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
BearTop.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
BearBot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
BullTop.SetDefaultColor(Color.GREEN);
BullBot.SetDefaultColor(Color.GREEN);
BearTop.SetDefaultColor(Color.RED);
BearBot.SetDefaultColor(Color.RED);

AddCloud(if BullTop==BullTop[1] then BullTop else na, BullBot, Color.DARK_GREEN);
AddCloud(if BearTop==BearTop[1] then BearTop else na, BearBot, Color.DARK_RED);

AddChartBubble(showLabels and sidd_bull_cond, BullBot, "B", Color.GREEN, no);
AddChartBubble(showLabels and sidd_bear_cond, BearTop, "S", Color.RED);
#-- END of CODE
 

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