VWAP deviations as horizontal lines?

Alex

Active member
VIP
Make the vwap and its 2 standard deviations appear as self adjusting extended horizontal lines? would it be possible to make?
 
to be honest, i am completely lost
so i loaded your code you put together
and added it to XPEV 30D 1HR chart and this is what i get

Screen-Shot-2020-12-06-at-13-05-58.png


so to change the bar number in the settings of the indicator.....
i understood it to be this.....

Screen-Shot-2020-12-06-at-13-06-50.png



so what number of bars should i enter in order for the my chart to look like the example chart i posted in the beginning
like this....

Screen-Shot-2020-12-05-at-13-31-31.png
HES ALSO USING A 30 DAY 1 HOUR CHART AND HE IS USING 3 STANDARD DEVIATIONS AND 1 STANDARD DEVIATIONS HERES THE UPDATED CODE

#VM_MIDAS_StandartDeviationBands;
def Data = BarNumber();
input Number_Of_Bar = 1;
input price = close;
def bar = Data >= Number_Of_Bar;
def pv = if bar then pv[1] + price * volume else 0;
def cumvolume = if bar then cumvolume[1] + volume else 0;
plot vw = pv / cumvolume;
def bars = Data - Number_Of_Bar;
def sample = if bar then sample[1] + Sqr(price - vw) else 0;
def var = sample / bars;
def dev = Sqrt(var);

plot dev1 = vw + dev * 3;
plot dev2 = vw - (dev * 3);
plot dev3 = vw + (dev *1);
plot devN1 = vw - dev *1;


vw.setdefaultColor(color.yellow);
dev1.SetDefaultColor(Color.White);
dev2.SetDefaultColor(Color.White);
dev3.SetDefaultColor(Color.White);
devn1.SetDefaultColor(Color.White);


dev1.Setlineweight(2);
dev2.Setlineweight(2);
dev3.Setlineweight(2);
devn1.Setlineweight(2);
 

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

HES ALSO USING A 30 DAY 1 HOUR CHART AND HE IS USING 3 STANDARD DEVIATIONS AND 1 STANDARD DEVIATIONS HERES THE UPDATED CODE

#VM_MIDAS_StandartDeviationBands;
def Data = BarNumber();
input Number_Of_Bar = 1;
input price = close;
def bar = Data >= Number_Of_Bar;
def pv = if bar then pv[1] + price * volume else 0;
def cumvolume = if bar then cumvolume[1] + volume else 0;
plot vw = pv / cumvolume;
def bars = Data - Number_Of_Bar;
def sample = if bar then sample[1] + Sqr(price - vw) else 0;
def var = sample / bars;
def dev = Sqrt(var);

plot dev1 = vw + dev * 3;
plot dev2 = vw - (dev * 3);
plot dev3 = vw + (dev *1);
plot devN1 = vw - dev *1;


vw.setdefaultColor(color.yellow);
dev1.SetDefaultColor(Color.White);
dev2.SetDefaultColor(Color.White);
dev3.SetDefaultColor(Color.White);
devn1.SetDefaultColor(Color.White);


dev1.Setlineweight(2);
dev2.Setlineweight(2);
dev3.Setlineweight(2);
devn1.Setlineweight(2);
thank you for the updated version
i appreciate the time you put into it ❤️
 
Does anybody have a VWAP coded that shows VWAP and standard deviation bands
but is anchored at 9:30am est to 4:00pm est and can be displayed on ETH charts but
it displays RTH VWAP bands ? Tried to code it but never works.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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