LazyBear

Variable Moving Average [LazyBear]

Variable Moving Average, often abbreviated as VMA, is an Exponential Moving Average developed by Tushar S. Chande. VMA automatically adjusts its smoothing constant on the basis of Market Volatility .

Use this like other Moving Averages. I have added the following options that can be enabled via options page:
- Trend Direction Indication: Green = Up trend, Blue = Potential congestion, Red = down trend.
- Color bars based on Trend

More info:
http://www.thewizardtrader.com/Education/TechnicalIndicators/Overlays/VariableMovingAverage.aspx

List of my other indicators:
- GDoc: https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
- Chart:
Master Index: List of all my indicators

Remove from Favorite Scripts Add to Favorite Scripts
//
// @author LazyBear 
// List of all my indicators: 
// https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
// 
study(title="Variable Moving Average [LazyBear]", shorttitle="VMA_LB", overlay=true)
src=close
l =input(6, title="VMA Length") 
std=input(false, title="Show Trend Direction")
bc=input(false, title="Color bars based on Trend")
k = 1.0/l
pdm = max((src - src[1]), 0)
mdm = max((src[1] - src), 0)
pdmS = ((1 - k)*nz(pdmS[1]) + k*pdm)
mdmS = ((1 - k)*nz(mdmS[1]) + k*mdm)
s = pdmS + mdmS
pdi = pdmS/s
mdi = mdmS/s
pdiS = ((1 - k)*nz(pdiS[1]) + k*pdi)
mdiS = ((1 - k)*nz(mdiS[1]) + k*mdi)
d = abs(pdiS - mdiS)
s1 = pdiS + mdiS
iS = ((1 - k)*nz(iS[1]) + k*d/s1)
hhv = highest(iS, l) 
llv = lowest(iS, l) 
d1 = hhv - llv
vI = (iS - llv)/d1
vma = (1 - k*vI)*nz(vma[1]) + k*vI*src
vmaC=(vma > vma[1]) ? green : (vma<vma[1]) ? red : (vma==vma[1]) ? blue : black 
plot(vma, color=std?vmaC:black, linewidth=3, title="VMA")
barcolor(bc?vmaC:na)
Awesome! looking at the code, I think I see how I might even be able to figure out making the audible alert. Thanks, dude.
+1 Reply
YW.

BTW, here's a peek in to the next item in my queue.

snapshot
+7 Reply
accidentje LazyBear
Looks great, LB. Thanks again
+2 Reply
Good for trend and momentum traders
Reply
Sir, have u released this indicator yet or still working on it. If u did, would this work on a 2 min chart. Thanks and regards.
Reply
One hell of an indicator LB... especially in combination with stochastics. Can't wait for your trend & momentum script...
Reply
LazyBear PRO accidentje
Thanks @accidentje
Reply
Thank you, another great script. How do you decided/find what script you're going to work on next?
Reply
LazyBear PRO iamaltcoin
YW.

Sometimes I code up requests from other members, but mostly its from my scripts playground (new ideas or indicators ported from other platforms).

This keeps my to-publish queue full always :)
Reply
Can I have your AutoGraph?

Just write it on a chart and post below. But make sure you address it to me so others don't claim it as their own!!!
+1 Reply
LazyBear PRO ChrisMoody
only if u teach me how to trade properly :)
+2 Reply
I want in on that class as well! Glad to host it here is Palm Springs ;√)
Reply
Dude...Trading is a "Walk In The Park"...compared to the Complex Codes your code in your sleep....
+2 Reply
Looks really good LazyBear! Nice work!
Reply
Thanks Tim.
Reply
Thank you for all the formulas, I am grateful for the help.
Reply
Hi, why does the line just show as black for me?
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out