Trade Archer - Moving Averages - v1.4F

Trade Archer Moving Averages has been updated!

Moving averages are one of the cornerstones to technical analysts tool box. There are several different kinds of moving averages of which the most common can be selected. Up to four moving averages may be configured and displayed with the option to show clouds between them. Additionally I have added a trend identification system that analyzes the slopes of the moving averages instead of relying on moving average cross overs for long/short signals.

- Multiple Moving Average Choices including: SMA , EMA , DEMA , TEMA , RMA, HMA , WMA , and VWMA .
- Four fully customizable MAs including length, color, and/or optional clouds between the MAs.
- Three ways to display MA trends: bar color, background and/or colored shapes.

The default settings for the MA lengths are: 9, 19, 50, 200. MAs default to EMAs if none are selected.
If you use a blend of MAs, like SMA and EMA , you can apply the indicator again to the same chart and enable/disable the ones you want visible, their type, and trend display.

If you have any questions or need help configuring, feel free to contact me.

Good luck
Trade Archer
오픈 소스 스크립트

진정한 TradingView의 정신에 따라, 이 스크립트의 작성자는 스크립트를 오픈소스로 게시했기에 거래자들이 이해하고 확인할 수 있습니다. 작가님께 건배! 스크립트를 무료로 사용할 수 있지만, 게시물에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 당신은 스크립트를 차트에 사용하기 위해 그것을 즐겨찾기 할 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?
//Created By User Trade Archer (Kevin Johnson)
//Last Update 8/4/2015
//Added support for SMA, EMA, DEMA, TEMA, WMA, HMA, RMA, and VWMA.  Defaults to EMA
//Note: If you make some neat additions, let me know.  Thanks & Enjoy

study(title="Trade Archer - Moving Averages - v1.4F", shorttitle="TA-MAs-v1.4F", overlay=true, precision=2)
//Collect source input and Moving Average Lengths
src = input(close, defval=close, type=source, title="Source:")
fast = input(9, minval=2, step=1, defval=9, type=integer, title="Fast MA Length")
medfast = input(19, minval=2, step=1, defval=19, type=integer, title="Medfast MA Length")
medslow = input(50, minval=2, step=1, defval=50, type=integer, title="Medslow MA Length")
slow = input(200, minval=2, step=1, defval=200, type=integer, title="Slow MA Length")

//Trend is based of combination of two MAs. Preferably MA1 length is shorter than MA2
ma1src = input(1, minval=1, defval=1, maxval=3, type=integer, step=1, title="MA1: (1) *Fast, (2)  MedFast, (3)  MedSlow")
ma2src = input(3, minval=2, defval=3, maxval=4, type=integer, step=1, title="MA2: (2)  MedFast, (3) *MedSlow, (4)  Slow")

//Coloring Options
usebg = input(true, defval=true, type=bool, title="Color Background of Trend")
usedots = input(true, defval=true, type=bool, title="Color Shape of Trend")
usebar = input(true, defval=true, type=bool, title="Color Bars of Trend")

//Set all MAs to a certain type
usesma = input(false, defval=false, type=bool, title="SMA")
useema = input(true, defval=true, type=bool, title="EMA (default)")
usedema = input(false, defval=false, type=bool, title="DEMA")
usetema = input(false, defval=false, type=bool, title="TEMA")
usewma = input(false, defval=false, type=bool, title="WMA")
usehma = input(false, defval=false, type=bool, title="HMA")
userma = input(false, defval=false, type=bool, title="RMA")
usevwma = input(false, defval=false, type=bool, title="VWMA")

dema(s,l) => e1 = ema(s, l), e2 = ema(e1, l), out = 2 * e1 - e2
tema(s,l) => e1 = ema(s, l), e2 = ema(e1, l), e3 = ema(e2, l), out = 3 * (e1 - e2) + e3
hma(s,l) => out = wma( 2*wma(s, l/2)-wma(s, l), round(sqrt(l)) )
ma(s,l) => out = usesma ? sma(s,l) : useema ? ema(s,l) : usewma ? wma(s,l) : usehma ? hma(s,l) : userma ? rma(s,l) :
      usevwma ? vwma(s,l) : usedema ? dema(s,l) : usetema ? tema(s,l) : ema(s,l)
maSelect(c) => out = ma1src == 1 ? ma(src,fast) : ma1src == 2 ? ma(src,medfast) : ma1src == 3 ? ma(src,medslow) : ma1src == 4 ? ma(src,slow) : ema(src,50)
isLong = close > ma(src,50)
isShort = close <= ma(src,50)

//One time calculations
mafast = ma(src,fast)
mamedfast = ma(src,medfast)
mamedslow = ma(src,medslow)
maslow = ma(src,slow)

ma1check = maSelect(ma1src)
ma2check = maSelect(ma2src)

//plot MAs & save as variable
pfast = plot( mafast, linewidth=1, color=green, title="Fast MA" )
pmedfast = plot( mamedfast, linewidth=1, color=green, title="Medfast MA" )
pmedslow = plot( mamedslow, linewidth=2, color=red, title="Medslow MA" )
pslow = plot( maslow, linewidth=1, color=maroon, title="Slow MA" )

//fill between two emas
fquickcloud = fill(pfast, pmedfast, color=green, transp=90, title="Quick Cloud")
fnormalcloud = fill(pmedfast, pmedslow, color=yellow, transp=90, title="Normal Cloud")
fslowcloud = fill(pmedslow, pslow, color=red, transp=90, title="Slow Cloud")

//Converging and Diverging Conditionals
rfLength = 2
condcr1f2 = rising(ma1check,rfLength) and falling(ma2check,rfLength)  //condc1
condcf1r2 = falling(ma1check,rfLength) and rising(ma2check,rfLength)  //condc2

conddr1r2 = rising(ma1check,rfLength) and rising(ma2check,rfLength)   //condd1
conddf1f2 = falling(ma1check,rfLength) and falling(ma2check,rfLength) //condd2

upColor = lime
neColor = yellow
dnColor = red
//Color Trend of background, bar, or shapes
bgcolor(usebg and condcr1f2 or usebg and conddr1r2 ? upColor : usebg and condcf1r2 or usebg and conddf1f2 ? dnColor : usebg ? neColor : na, transp=90)
plotshape(usedots, style=shape.square, location=location.bottom, color=condcr1f2 or conddr1r2 ? upColor : condcf1r2 or conddf1f2 ? dnColor : neColor, title="Dots", transp=0)
barcolor(usebar and condcr1f2 or usebar and conddr1r2 ? upColor : usebar and condcf1r2 or usebar and conddf1f2 ? dnColor : usebar ? neColor : na)


May I know what does it mean when the candlestick turn yellow at default setting?
+2 응답
Great job, very useful tool. Thanks a lot!
Nice work and thanks for this. Is there a way to make the background cloud plot two different colors depending on the direction of the trend? For example, I just want to use one instance of the indicator with 2 WMA's that crossover but I want the background cloud itself to change to a custom color of my choice on direction of the dominant trend. Maybe you could add a "Normal Cloud Up" custom color and a "Normal Cloud Down" custom color for example so the colors will change after the MA's crossover.

I have an indicator that does this for MT4 and I could post a picture of it so you can see what I mean if you need me to. It's some type of Filled Ribbon MA and if you set the thickness of the Lines to maximum it creates a filled in cloud with two colors that change when the trend changes. I just want my background to be light blue when the MA's cross up and a light gray when the MA's cross down.

tradearcher FractalEyeZ
Thanks for the feedback and comments. Excellent suggestion. I know what you are talking about with different colors for the zone between two MAs. I will try and update this weekend if I can find some time.
I have an OBV MA indicator as well.
FractalEyeZ tradearcher
Oh cool man, and thanks for all your efforts.

Enjoy your weekend :)
+1 응답
tradearcher FractalEyeZ
Sorry. Been a bit swamped. I have found similar code to it. Little more involved than I thought at first. But it is on my todo list as it is a useful feature.
tradearcher tradearcher
Do you know how to add code to a current script? If so, append the color below to the current script.
It will do cloud color changes only for Fast and MedFast MAs. Tweak the indicator 'Style' options to
get your desired effect.

//Created By User Trade Archer (Kevin Johnson), 4/9/2016
// Quick Cloud Color Patch with Fast and MedFast MAs.
// Cloud Color Changes based on: CM_Enhanced_Ichimoku Cloud-V5
usecldchg = input(true, defval=true, type=bool, title="Cloud Color Change")
fastAbove = mafast >= mamedfast ? 1 : na
medfastBelow = mafast <= mamedfast ? 1 : na

s1plotU = fastAbove ? mafast : na
s2plotU = fastAbove ? mamedfast : na
s1plotD = medfastBelow ? mafast : na
s2plotD = medfastBelow ? mamedfast : na

col = fastAbove ? lime : red
sp1 = plot(usecldchg and s1plotU ? s1plotU : na, title='1', style=linebr, linewidth=2, color=col)
sp2 = plot(usecldchg and s2plotU ? s2plotU : na, title='2', style=linebr, linewidth=2, color=col)
sp3 = plot(usecldchg and s1plotD ? s1plotD : na, title='3', style=linebr, linewidth=2, color=col)
sp4 = plot(usecldchg and s2plotD ? s2plotD : na, title='4', style=linebr, linewidth=2, color=col)
//Fills that color cloud based on Trend.
fill(sp1, sp2, color=lime, transp=70, title='Above')
fill(sp3, sp4, color=red, transp=70, title='Below')
tradearcher tradearcher
Here we go with a sample setup with Cloud Color Change.

FractalEyeZ tradearcher
Thank you Kev, I really appreciate your efforts because I tried to figure it out last week but was just left scratching my head! I did look at CM's Ichimoku Cloud code but could not figure out how to properly re-code it. You programmer guys are really smart and I knew you would figure it out.

I pasted the new updated lines of code right beneath this line:

fslowcloud = fill(pmedslow, pslow, color=red, transp=90, title="Slow Cloud")

and it works perfectly! Now I have the best MA and can customize it how I want...nice :)

Mine are currently set to 21 and 63 WMA's and I'm really diggin' the purple and grey...hehehe!!!

So this is now version v1.4G right?

+1 응답
tradearcher FractalEyeZ
Thanks for the feedback. Looks great!
For version 1.4G or maybe 1.5, I will add it two the other two clouds that I have in the script. (My desire to be consistent).
You can also run multiple versions of the same indicator to filter the signals for a different perspective.

Which ever MA type that simplifies your visual analysis and increases your trading/investing success rate is the correct one.
To stay in sync with news and historical practices, I always have either EMA50 and EMA200 or SMA50 and SMA200. But that may not be the case with FX.
홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 정보 차트 특징 프라이싱 프렌드 리퍼하기 하우스룰(내부규정) 헬프 센터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 라이트웨이트 차팅 라이브러리 블로그 & 뉴스 트위터
프로화일 프로화일설정 계정 및 빌링 리퍼드 프렌즈 코인 나의 서포트 티켓 헬프 센터 비밀메시지 채팅 로그아웃