STT Pullback Candlestick Indicator For ThinkOrSwim

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

Can this be converted?
https://www.tradingview.com/script/...ESTICK-STRATEGY-BY-SIMPLE-TRADING-TECHNIQUES/

Code:
//  By SIMPLE TRADING TECHNIQUES

//       Arrow represent trade setup
//       Circle represent triggering of the trade
//--------------------------------------------------------------------

study(title="STT PULLBACK CANDLESTICK STRATEGY",overlay = true, shorttitle="STT PCS")
src = close, len = input(8, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

//coloring method below

src1 = close, len1 = input(50, minval=1, title="UpLevel")
src2 = close, len2 = input(50, minval=1, title="DownLevel")
isup() => rsi > len1
isdown() => rsi < len2
barcolor(isup() ? green : isdown() ? red : na )

//study('buy/sell arrows', overlay=true)
lowest = lowest(low,(5))
highest = highest(high,(5))
pullbackB = (low == lowest) or (low[1] == lowest[1]) ? 1 : 0
pullbackS = (high == highest) or (high[1] == highest[1]) ? 1 : 0

value = (high - low) / 4
value1 = high - value
value2 = low + value

out = sma(close, 50)

data = (high > out ?  rsi > len1 ? pullbackB ? close >= value1 : na : na : na)
data1 = (low < out ? rsi < len2 ? pullbackS ? close <= value2 : na : na : na)

plotchar(data, char='↑', location=location.belowbar, color=lime, text="PCS Buy")
plotchar(data1, char='↓', location=location.abovebar, color=red, text="PCS Sell")

//Trade Trigger
tiggerlongcandle = (data[1] == 1) and (high > high[1]) ? 1 : 0
tiggershortcandle = (data1[1] == 1) and (low < low[1]) ? 1 : 0
plotshape(tiggerlongcandle ? tiggerlongcandle : na, title="Triggered Long",style=shape.circle, location=location.belowbar, color=green, transp=0, offset=0, text="PCS")
plotshape(tiggershortcandle ? tiggershortcandle : na, title="Triggered Short",style=shape.circle, location=location.abovebar, color=red, transp=0, offset=0, text="PCS")

plot (out, color = black, linewidth = 3, title = "Trend - Long Term")
find below

CSS:
#//  By SIMPLE TRADING TECHNIQUES
#//       Arrow represent trade setup
#//       Circle represent triggering of the trade
#//--------------------------------------------------------------------
# request from useThinkscript.com memeber
# Converted by Sam4Cok@Samer800    -06/2023
#study(title="STT PULLBACK CANDLESTICK STRATEGY",overlay = true, shorttitle="STT PCS")
input ColorBars = yes;
input src = close;
input Length = 8;#, minval=1, title="Length")
input rsiUpLevel = 50;#, minval=1, title="UpLevel")
input rsiDownLevel = 50;#, minval=1, title="DownLevel")

def na = Double.NaN;

def nRSI = rsi(Price=src, Length=Length);
def isup = nRSI > rsiUpLevel;
def isdown = nRSI < rsiDownLevel;

def barcolor = if isup then 1 else if isdown then -1 else 0;

#/study('buy/sell arrows', overlay=true)
def lowest = lowest(low,5);
def highest = highest(high,5);
def pullbackB = if (low == lowest) or (low[1] == lowest[1]) then 1 else 0;
def pullbackS = if (high == highest) or (high[1] == highest[1]) then 1 else 0;

def value = (high - low) / 4;
def value1 = high - value;
def value2 = low + value;

def out = Average(close, 50);

def data = (if high > out then if isup then if pullbackB then close >= value1 else na else na else na); 
def data1 = (if low < out then if isdown then if pullbackS then close <= value2 else na else na else na);

plot PcsBuy = if data then low else na;#, "PCS Buy", Color.GREEN, no);
plot PcsSell = if data1 then high else na;#, "PCS Sell", Color.RED, yes);

PcsBuy.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
PcsSell.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
PcsBuy.SetDefaultColor(Color.GREEN);
PcsSell.SetDefaultColor(Color.RED);
#//Trade Trigger
def tiggerlongcandle = (data[1] == 1) and (high > high[1]);# ? 1 : 0
def tiggershortcandle = (data1[1] == 1) and (low < low[1]);# ? 1 : 0

plot TrigLong = if tiggerlongcandle then low else na;
plot TrigShort = if tiggershortcandle then high else na;
TrigLong.SetPaintingStrategy(PaintingStrategy.POINTS);
TrigShort.SetPaintingStrategy(PaintingStrategy.POINTS);
TrigLong.SetDefaultColor(Color.GREEN);
TrigShort.SetDefaultColor(Color.RED);
TrigLong.SetLineWeight(2);
TrigShort.SetLineWeight(2);

plot trend = out;#, color = black, linewidth = 3, title = "Trend - Long Term")
trend.SetDefaultColor(Color.WHITE);

AssignPriceColor(if !ColorBars then Color.CURRENT else
                 if barcolor>0 then Color.GREEN else
                 if barcolor<0 then Color.RED else Color.GRAY);
#-- END of CODE.
 
find below

CSS:
#//  By SIMPLE TRADING TECHNIQUES
#//       Arrow represent trade setup
#//       Circle represent triggering of the trade
#//--------------------------------------------------------------------
# request from useThinkscript.com memeber
# Converted by Sam4Cok@Samer800    -06/2023
#study(title="STT PULLBACK CANDLESTICK STRATEGY",overlay = true, shorttitle="STT PCS")
input ColorBars = yes;
input src = close;
input Length = 8;#, minval=1, title="Length")
input rsiUpLevel = 50;#, minval=1, title="UpLevel")
input rsiDownLevel = 50;#, minval=1, title="DownLevel")

def na = Double.NaN;

def nRSI = rsi(Price=src, Length=Length);
def isup = nRSI > rsiUpLevel;
def isdown = nRSI < rsiDownLevel;

def barcolor = if isup then 1 else if isdown then -1 else 0;

#/study('buy/sell arrows', overlay=true)
def lowest = lowest(low,5);
def highest = highest(high,5);
def pullbackB = if (low == lowest) or (low[1] == lowest[1]) then 1 else 0;
def pullbackS = if (high == highest) or (high[1] == highest[1]) then 1 else 0;

def value = (high - low) / 4;
def value1 = high - value;
def value2 = low + value;

def out = Average(close, 50);

def data = (if high > out then if isup then if pullbackB then close >= value1 else na else na else na);
def data1 = (if low < out then if isdown then if pullbackS then close <= value2 else na else na else na);

plot PcsBuy = if data then low else na;#, "PCS Buy", Color.GREEN, no);
plot PcsSell = if data1 then high else na;#, "PCS Sell", Color.RED, yes);

PcsBuy.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
PcsSell.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
PcsBuy.SetDefaultColor(Color.GREEN);
PcsSell.SetDefaultColor(Color.RED);
#//Trade Trigger
def tiggerlongcandle = (data[1] == 1) and (high > high[1]);# ? 1 : 0
def tiggershortcandle = (data1[1] == 1) and (low < low[1]);# ? 1 : 0

plot TrigLong = if tiggerlongcandle then low else na;
plot TrigShort = if tiggershortcandle then high else na;
TrigLong.SetPaintingStrategy(PaintingStrategy.POINTS);
TrigShort.SetPaintingStrategy(PaintingStrategy.POINTS);
TrigLong.SetDefaultColor(Color.GREEN);
TrigShort.SetDefaultColor(Color.RED);
TrigLong.SetLineWeight(2);
TrigShort.SetLineWeight(2);

plot trend = out;#, color = black, linewidth = 3, title = "Trend - Long Term")
trend.SetDefaultColor(Color.WHITE);

AssignPriceColor(if !ColorBars then Color.CURRENT else
                 if barcolor>0 then Color.GREEN else
                 if barcolor<0 then Color.RED else Color.GRAY);
#-- END of CODE.
On my TOS chart, I am not seeing any circles.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
511 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