VWMA Breakout Scanner

BenTen

BenTen

Administrative
Staff
VIP
Here you go. Save this as a study. Then switch over to the Scanner and scan for buy and sell signals.

Code:
# VWMA Breakout Strategy
# TD Ameritrade IP Company, Inc. (c) 2017-2019
# Modified by BenTen at useThinkScript.com
# Added arrows to use with the Scanner

input vwmaLength = 50;
input maLength = 70;
input averageType = AverageType.SIMPLE;

plot VWMA = Sum(volume * close, vwmaLength) / Sum(volume, vwmaLength);
plot MA = MovingAverage(averageType, close, maLength);
VWMA.SetDefaultColor(GetColor(1));
MA.SetDefaultColor(GetColor(2));

def buy = VWMA crosses above MA;
def sell = VWMA crosses below MA;

plot bullish = buy;
bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_Arrow_UP);
bullish.SetDefaultColor(Color.LIME);
bullish.SetLineWeight(1);

plot bearish = sell;
bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_Arrow_DOWN);
bearish.SetDefaultColor(Color.LIME);
bearish.SetLineWeight(1);
 
V

veerasareddy

New member
@BenTen Thank you so much. I saved as a study. But I'm not able to scan BUY / SELL as per your instructions. Could you please help one more step. Thank you for your kindness. Probably a screen shot of the scanner code.
 
horserider

horserider

Well-known member
VIP
MovAvgWeighted("length" = 50) crosses above SimpleMovingAverage("length" = 70) within 3 bars


MovAvgWeighted("length" = 50) crosses below SimpleMovingAverage("length" = 70) within 3 bars

Just try scan similiar to above , Do not have ToS open so unsure if the "SimpleMovingAverage" is the correct spelling for that study. If not just look in studies for the correct wording.
 
BenTen

BenTen

Administrative
Staff
VIP
@veerasareddy Switch to Scan tab, Add new filter study > Select the study I sent you above > Under Plot select the type of signal you want to scan for and also within how many bars.

 
Last edited:
V

veerasareddy

New member
MovAvgWeighted("length" = 50) crosses above SimpleMovingAverage("length" = 70) within 3 bars


MovAvgWeighted("length" = 50) crosses below SimpleMovingAverage("length" = 70) within 3 bars

Just try scan similiar to above , Do not have ToS open so unsure if the "SimpleMovingAverage" is the correct spelling for that study. If not just look in studies for the correct wording.
@horserider Thank you.
 
W

WayneG

New member
VIP
Folks, I looking for the VWMA. I have searched far and wide, but can't find the code or link for it, only lots of talk about how it works.

This is not the VWMA Breakout, which is already part of ThinkorSwim.

Thanks for your help,
WayneG
 
W

WayneG

New member
VIP
No, it is the Volume Weighted Moving Average (VWMA), the VWAP throws price into the mix.
 
STB

STB

Member
No, it is the Volume Weighted Moving Average (VWMA), the VWAP throws price into the mix.
Volume Weighted Moving Average

The Volume Weighted Moving Average (VWMA) study calculates the average weighted price by volume over a period of N bars. The formula is as follows: SUM(vol*price)/SUM(vol). The user may change the input (close), period and shift.

HOW ABOUT THIS?

Code:
input LENGTH = 5;
input displace = 0;

def VWMA = Sum(volume * close) / Sum(volume);
plot MYVWMA = Average(VWMA[-displace], LENGTH);
 
V

Vimal Mittal

Member
Here you go. Save this as a study. Then switch over to the Scanner and scan for buy and sell signals.

Code:
# VWMA Breakout Strategy
# TD Ameritrade IP Company, Inc. (c) 2017-2019
# Modified by BenTen at useThinkScript.com
# Added arrows to use with the Scanner

input vwmaLength = 50;
input maLength = 70;
input averageType = AverageType.SIMPLE;

plot VWMA = Sum(volume * close, vwmaLength) / Sum(volume, vwmaLength);
plot MA = MovingAverage(averageType, close, maLength);
VWMA.SetDefaultColor(GetColor(1));
MA.SetDefaultColor(GetColor(2));

def buy = VWMA crosses above MA;
def sell = VWMA crosses below MA;

plot bullish = buy;
bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_Arrow_UP);
bullish.SetDefaultColor(Color.LIME);
bullish.SetLineWeight(1);

plot bearish = sell;
bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_Arrow_DOWN);
bearish.SetDefaultColor(Color.LIME);
bearish.SetLineWeight(1);
when I copy and paste in scan custom it shows error "exactly one plot expected"?
Can you help please?
Thanks.
 

Similar threads

Top