ML2

SMA

3980 뷰
783
SMA 100 200 10 20 50
즐겨찾기 스크립트에서 빼기 즐겨찾기 스크립트에 넣기

코멘트

::Update ::
- Change -
Remove MA 10
Remove MA20
Add MA 9
Add MA 21
Add Crossing MA 9&21 indicator
Converting to V4

///////////////////////////////////////////////////////SCRIPT//////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////
//Free to use and modifie, like always appreciated :) //
//Review commentary welcome
// © ML2 //
//////////////////////////////////////////////////////
//@version=4

strategy("MA", overlay=true)
//
src = input(close, title="Source")

//Volume

//SMA
plot(sma(close, 9), color=color.orange, linewidth=4, title='9')
plot(sma(close, 21), color=color.gray, linewidth=4, title='21')
plot(sma(close, 50), color=color.aqua, linewidth=3, title='50')
plot(sma(close, 100), color=color.green, linewidth=4, title='100')
plot(sma(close, 200), color=color.purple, linewidth=3, title='200')
plot(sma(close, 500), color=color.olive, linewidth=4, title='500')
plot(sma(close, 730), color=color.navy, linewidth=5, title='2YEARS')

//SMA High Low
//plot(sma(high,10),color = gray,linewidth=1, title = '10 High')
//plot(sma(low,200),color = red,linewidth=1, title = '200 Low')

//Golden Cross MA 50 & 200
ma50 = input(50, minval=1, title="Moving Average 50")
ma200 = input(200, minval=1, title="Moving Average 200")

exponential = input(false, title="Exponential MA")
ema_1 = ema(src, ma50)
sma_1 = sma(src, ma50)
select1 = exponential ? ema_1 : sma_1
ema_2 = ema(src, ma200)
sma_2 = sma(src, ma200)
select2 = exponential ? ema_2 : sma_2

golden_cross() =>
select1 > select2
death_cross() =>
select1 < select2

Golden() =>
golden_cross() and death_cross()
Death() =>
death_cross() and golden_cross()
Death_1 = Death()
bgcolor(Golden() ? #FFD700 : Death_1 ? #D3D3D3 : na, transp=0, title="Golden & Death Cross Background Color")

//Golden Cross MA 9 & 21
ma9 = input(9, minval=1, title="Moving Average 9")
ma21 = input(21, minval=1, title="Moving Average 2")

exponential1 = input(false, title="Exponential MA")
ema_9 = ema(src, ma9)
sma_9 = sma(src, ma9)
select9 = exponential ? ema_9 : sma_9
ema_21 = ema(src, ma21)
sma_21 = sma(src, ma21)
select21 = exponential ? ema_21 : sma_21

MA_9_21_cross() =>
select9 > select21
MA_21_9_cross() =>
select9 < select21

Cross1() =>
MA_9_21_cross() and MA_21_9_cross()
Cross2() =>
MA_21_9_cross() and MA_9_21_cross()
Cross219 = Cross1()
bgcolor(Cross2() ? #FF9800 : Cross219 ? #00E676 : na, transp=0, title="MA 21 9 cross")

//////////////////////////////////////////////////////
//Free to use and modifie, like always appreciated :) //
//Review commentary welcome //
//////////////////////////////////////////////////////
응답
Update with MA 500 et 2years

//@version=4
strategy("MA", overlay=true)
//
src = input(close, title="Source")

//Volume

//SMA
plot(sma(close, 10), color=color.orange, linewidth=4, title='10')
plot(sma(close, 20), color=color.gray, linewidth=4, title='20')
plot(sma(close, 50), color=color.aqua, linewidth=3, title='50')
plot(sma(close, 100), color=color.green, linewidth=4, title='100')
plot(sma(close, 200), color=color.purple, linewidth=3, title='200')
plot(sma(close, 500), color=color.olive, linewidth=4, title='500')
plot(sma(close, 730), color=color.navy, linewidth=5, title='2YEARS')

//SMA High Low
//plot(sma(high,10),color = gray,linewidth=1, title = '10 High')
//plot(sma(low,200),color = red,linewidth=1, title = '200 Low')

//Golden Cross MA 50 & 200
ma50 = input(50, minval=1, title="Moving Average 50")
ma200 = input(200, minval=1, title="Moving Average 200")

exponential = input(false, title="Exponential MA")
ema_1 = ema(src, ma50)
sma_1 = sma(src, ma50)
select1 = exponential ? ema_1 : sma_1
ema_2 = ema(src, ma200)
sma_2 = sma(src, ma200)
select2 = exponential ? ema_2 : sma_2

golden_cross() =>
select1 > select2
death_cross() =>
select1 < select2

Golden() =>
golden_cross() and death_cross()
Death() =>
death_cross() and golden_cross()
Death_1 = Death()
bgcolor(Golden() ? #FFD700 : Death_1 ? #D3D3D3 : na, transp=0, title="Golden & Death Cross Background Color")

plotshape(Golden(), color=color.black, style=shape.xcross, text="Golden Cross", location=location.top)
plotshape(Death(), color=color.black, style=shape.xcross, text="Death Cross", location=location.top)
응답
홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 사용안내 차트 특징 프라이싱 프렌드 리퍼하기 하우스룰(내부규정) 헬프 센터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 라이트웨이트 차팅 라이브러리 블로그 & 뉴스 트위터
프로화일 프로화일설정 계정 및 빌링 리퍼드 프렌즈 코인 나의 서포트 티켓 헬프 센터 공개아이디어 팔로어 팔로잉 비밀메시지 채팅 로그아웃