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.
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.
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.
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: