• Get $40 off VIP by signing up for a free account! Sign Up

THE WSAC (NEW STRATEGY) for ThinkorSwim

Stocks Rox

New member
Hi everyone this is my first time coding on thinkscript so the code really is very easy to understand. WSAC stands for weak trend signal, strong trend signal and confirmed trend signal. Its a very good and reliable swing trading strategy.

BUY SIGNAL CRITERA: Volume EMA for 10 bars is greater then Volume EMA for 35 bars. RSI is less then 45, 5 bars ago. Also price is greater then
a 35 day MA.

SELL SIGNAL CRITERA: Volume EMA for 35 bars is greater then Volume EMA for 10 bars. RSI is greater then 65, 5 bars ago. Also price is less then
a 35 day MA.
ZsIRvoF.png


Here's how it works first if the past ema volume for a more current shorter time period is greater then one of a longer time period, then that's the "W" for a weak bull signal. Then if the RSI is under 45 then that's "S" for the strong trend signal when combined with the "W". Finally if the price crosses the 35 day MA then that's the "AC" and confirmed trend signal (bull). The Bear signal is just vice versa with over bought at 65. Then it will display a green arrow where to buy, and red arrow where to sell.

I like to use it on 5D 5min chart but you can use on anything under 20 days. I tested it in real time on paper money and not in real time. I did only several dozen tests and over 70% of the trades where profitable.

The biggest gain in percent was 220% around and the biggest loss in percent was only 5%!! The average trade has a very small profitable percent at a gain of only 2.5%. Also I only use it to Buy to open, Sell to close but do what you want!

So also i made two indicators that predict signals before it happens but i wont post that till i get feedback from this post. P.S Only use this on stocks that relay on volume, so no ETF's.


Code:
input R = 14; #hint: its the length of the RSI

input length=35; #hint: its the length of the MA line

input length_longVOLUME=35; #hint: its the volume used to compare the current volume with

input length_currentVOLUME=10;  #hint: its the current volume trend

input BarsAgo=5; #hint: how many bars ago does the program look for a signal from the RSI(-1 for the volume)

input Over_Bought = 65;

input Over_Sold = 45;

def o = open;

def h = high;

def l = low;

def c = close;

def x = BarNumber();

def MidLine = 50;

def NetChgAvg = ExpAverage(c - c[1], R);

def TotChgAvg = ExpAverage(AbsValue(c - c[1]), R);

def ChgRatio = if TotChgAvg != 0

                  then NetChgAvg / TotChgAvg

                  else 0;

def RSI = 50 * (ChgRatio + 1);

def hla=(high+low)/2;

def hlc=(hla+close)/2;

def coa=(close+open)/2;

def coc=(coa+close)/2;

def cccohl=(coc+hlc)/2;

def price=(cccohl+hla)/2;

def source = volume;

def ema1 = expAverage(source,LENGTH_currentVOLUME);

def ema2 = expAverage(source,length_longVOLUME);

def lv = ema1>ema2 ;

def rv= ema1<ema2 ;

def avg = Average(price, length);

def bullma=price crosses above avg;

def bearma=price crosses below avg;

def bullr=RSI from BarsAgo bars ago <Over_Sold;

def bearr=RSI from BarsAgo bars ago >Over_Bought;

AddOrder(OrderType.BUY_TO_OPEN, bullma and lv and bullr,open[-1],1,Color.GREEN,Color.GREEN,"BUY");

AddOrder(OrderType.SELL_TO_CLOSE, bearma and rv and bearr ,open[-1],1,Color.RED, Color.RED,"SELL");

Alert(condition = bullr and lv and bullma, text = "Buy", "alert type" = Alert.BAR, sound = Sound.Bell);

Alert(condition = bearr and rv and bearma, text = "Sell", "alert type" = Alert.BAR, sound = Sound.Chimes);
#hint:The WSAC strategy (weaktrend signal, strong trend signal, and conformed trend signal)S


#END#
 
Last edited:
Here is a indicator that predicts sell signals
This way you can see the lines stacking up Blue line="W", Pink line="S", and Grey line="AC"
so you dont have to always be looking at your chart and if you missed its very useful.
grey line=3 sell
grey line =2 sometimes sell

Code:
L
declare lower;
input R = 14; #hint: its the length of the RSI

input length=35; #hint: its the length of the MA line  

input length_longVOLUME=35; #hint: its the volume used to compare the current volume with

input length_currentVOLUME=10;  #hint: its the current volume trend

def BarsAgo=4; #hint: how many bars ago does the program look for a signal from the RSI(-1 for the volume)

input Over_Bought = 65;

input Over_Sold = 45;

def o = open;

def h = high;

def l = low;

def c = close;

def x = BarNumber();

def MidLine = 50;

def NetChgAvg = ExpAverage(c - c[1], R);

def TotChgAvg = ExpAverage(AbsValue(c - c[1]), R);

def ChgRatio = if TotChgAvg != 0

                  then NetChgAvg / TotChgAvg

                  else 0;

def RSI = 50 * (ChgRatio + 1);

def hla=(high+low)/2;

def hlc=(hla+close)/2;

def coa=(close+open)/2;

def coc=(coa+close)/2;

def cccohl=(coc+hlc)/2;

def price=(cccohl+hla)/2;

def source = volume;

def ema1 = expAverage(source,LENGTH_currentVOLUME);

def ema2 = expAverage(source,length_longVOLUME);

def rv= ema1<ema2 ;

def avg = Average(price, length);

def bearma=price crosses below avg;

def bearr=RSI from BarsAgo bars ago >Over_Bought;

plot line1=bearr;

plot line2=bearr+rv;

plot line3=bearr+rv+bearma;
#hint:This Study predicts when then WSAC is going to have a sell signal a bar in avance
#END#
 
Last edited:
Here is a indicator that predicts buy signals
This way you can see the lines stacking up Blue line="W", Pink line="S", and Grey line="AC"
so you dont have to always be looking at your chart and if you missed a signal then the price falls or rises and theres a new signal on the indicator the strategy wont show it because it didn't know you missed it so its very useful.
grey line=3 BUY
Code:
declare lower;
input R = 14; #hint: its the length of the RSI

input length=35; #hint: its the length of the MA line 

input length_longVOLUME=35; #hint: its the volume used to compare the current volume with

input length_currentVOLUME=10;  #hint: its the current volume trend

def BarsAgo=5; #hint: how many bars ago does the program look for a signal from the RSI(-1 for the volume)

input Over_Bought = 65;

input Over_Sold = 45;

def o = open;

def h = high;

def l = low;

def c = close;

def x = BarNumber();

def MidLine = 50;

def NetChgAvg = ExpAverage(c - c[1], R);

def TotChgAvg = ExpAverage(AbsValue(c - c[1]), R);

def ChgRatio = if TotChgAvg != 0

                  then NetChgAvg / TotChgAvg

                  else 0;

def RSI = 50 * (ChgRatio + 1);

def hla=(high+low)/2;

def hlc=(hla+close)/2;

def coa=(close+open)/2;

def coc=(coa+close)/2;

def cccohl=(coc+hlc)/2;

def price=(cccohl+hla)/2;

def source = volume;

def ema1 = expAverage(source,LENGTH_currentVOLUME);

def ema2 = expAverage(source,length_longVOLUME);

def lv = ema1>ema2 ;

def avg = Average(price, length);

def bullma=price crosses above avg;

def bullr=RSI from BarsAgo bars ago <Over_Sold;

plot line1=bullr;

plot line2=bullr+lv;

plot line3=bullr+lv+bullma;
#hint:this study predicts when the WSAC is going to give a buy signal a bar in advance

#END#
 
Last edited:
Thanks for your input. I've been testing it on the top 10 most active stocks, I'm getting 50% win rate. However, Extremely good returns on Apple, Facebook, Netflix, Tesla, Microsoft. I'm trying to add a buy / sell signal as an alert but getting an error when I do line 1 = 1 .
No such function: BarNumber at 1:1 Expected double. Any idea ?

I'm trying to combine this strategy with a way to find extremely high momentum stocks before they explode. For example PSV on friday. Your strategy triggered a buy signal at 0.55 2 days before. If only I could find it beforehand


Another thing I was trying to do is a scan of buy signals in the morning.
 
Last edited:
Thanks for your input. I've been testing it on the top 10 most active stocks, I'm getting 50% win rate. However, Extremely good returns on Apple, Facebook, Netflix, Tesla, Microsoft. I'm trying to add a buy / sell signal as an alert but getting an error when I do line 1 = 1 .
No such function: BarNumber at 1:1 Expected double. Any idea ?

I'm trying to combine this strategy with a way to find extremely high momentum stocks before they explode. For example PSV on friday. Your strategy triggered a buy signal at 0.55 2 days before. If only I could find it beforehand


Another thing I was trying to do is a scan of buy signals in the morning.
Thanks for the feedback Im new to coding on thinkscript and was having trouble getting alerts to my phone or using this in a scan,
When you do make a combination and it works plz share i would love to see that!
 
Last edited:
If anyone used this for real plz tell me how it went I'm very curious! thx
 
Last edited by a moderator:
Hi everyone this is my first time coding on thinkscript so the code really is very easy to understand. WSAC stands for weak trend signal, strong trend signal and confirmed trend signal. Its a very good and reliable swing trading strategy.

BUY SIGNAL CRITERA: Volume EMA for 10 bars is greater then Volume EMA for 35 bars. RSI is less then 45, 5 bars ago. Also price is greater then
a 35 day MA.

SELL SIGNAL CRITERA: Volume EMA for 35 bars is greater then Volume EMA for 10 bars. RSI is greater then 65, 5 bars ago. Also price is less then
a 35 day MA.
View attachment 7457

Here's how it works first if the past ema volume for a more current shorter time period is greater then one of a longer time period, then that's the "W" for a weak bull signal. Then if the RSI is under 45 then that's "S" for the strong trend signal when combined with the "W". Finally if the price crosses the 35 day MA then that's the "AC" and confirmed trend signal (bull). The Bear signal is just vice versa with over bought at 65. Then it will display a green arrow where to buy, and red arrow where to sell.

I like to use it on 5D 5min chart but you can use on anything under 20 days. I tested it in real time on paper money and not in real time. I did only several dozen tests and over 70% of the trades where profitable.

The biggest gain in percent was 220% around and the biggest loss in percent was only 5%!! The average trade has a very small profitable percent at a gain of only 2.5%. Also I only use it to Buy to open, Sell to close but do what you want!

So also i made two indicators that predict signals before it happens but i wont post that till i get feedback from this post. P.S Only use this on stocks that relay on volume, so no ETF's.


Code:
input R = 14; #hint: its the length of the RSI

input length=35; #hint: its the length of the MA line

input length_longVOLUME=35; #hint: its the volume used to compare the current volume with

input length_currentVOLUME=10;  #hint: its the current volume trend

input BarsAgo=5; #hint: how many bars ago does the program look for a signal from the RSI(-1 for the volume)

input Over_Bought = 65;

input Over_Sold = 45;

def o = open;

def h = high;

def l = low;

def c = close;

def x = BarNumber();

def MidLine = 50;

def NetChgAvg = ExpAverage(c - c[1], R);

def TotChgAvg = ExpAverage(AbsValue(c - c[1]), R);

def ChgRatio = if TotChgAvg != 0

                  then NetChgAvg / TotChgAvg

                  else 0;

def RSI = 50 * (ChgRatio + 1);

def hla=(high+low)/2;

def hlc=(hla+close)/2;

def coa=(close+open)/2;

def coc=(coa+close)/2;

def cccohl=(coc+hlc)/2;

def price=(cccohl+hla)/2;

def source = volume;

def ema1 = expAverage(source,LENGTH_currentVOLUME);

def ema2 = expAverage(source,length_longVOLUME);

def lv = ema1>ema2 ;

def rv= ema1<ema2 ;

def avg = Average(price, length);

def bullma=price crosses above avg;

def bearma=price crosses below avg;

def bullr=RSI from BarsAgo bars ago <Over_Sold;

def bearr=RSI from BarsAgo bars ago >Over_Bought;

AddOrder(OrderType.BUY_TO_OPEN, bullma and lv and bullr,open[-1],1,Color.GREEN,Color.GREEN,"BUY");

AddOrder(OrderType.SELL_TO_CLOSE, bearma and rv and bearr ,open[-1],1,Color.RED, Color.RED,"SELL");

Alert(condition = bullr and lv and bullma, text = "Buy", "alert type" = Alert.BAR, sound = Sound.Bell);

Alert(condition = bearr and rv and bearma, text = "Sell", "alert type" = Alert.BAR, sound = Sound.Chimes);
#hint:The WSAC strategy (weaktrend signal, strong trend signal, and conformed trend signal)S


#END#
Hi Stock Rox, I came across this strategy and am wondering if it has been working for you, I checked a pile of stocks and only found one that showed a decent profit after 180 days on a 5m chart. Have you ever developed this strategy further after 3 years or so? Also, have you come up with a scan for it. I have tried, but I stink at coding. Thanks
 
Last edited:
Hi Stock Rox, I came across this strategy and am wondering if it has been working for you, I checked a pile of stocks and only found one that showed a decent profit after 180 days on a 5m chart. Have you ever developed this strategy further after 3 years or so? Also, have you come up with a scan for it. I have tried, but I **** at coding. Thanks

Did you know that by clicking on a member's name, you can easily check when they were last seen on the uTS forum? It's a great way to keep track of who's been around recently, and who hasn't. Speaking of which, it looks like @stockrox is no longer active. :(

As the OP stated, he only paper-traded.

This strategy was mistakenly applied to a low timeframe.
Moving averages calculations with a lookback so many bars can only be successfully traded on the higher aggregations.
Read more:
https://usethinkscript.com/threads/...urate-without-dropping-p-l.17145/#post-133974
 
Last edited:

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