답변완료
수식전환 부탁드립니다.
아래 수식을 예스수식으로 전환부탁드립니다.
감사합니다.
study("Money Flow Index MTF + Alerts", overlay = false)
//Inputs
length = input(title="Length", defval=14)
os = input(20, title="Oversold")
ob = input(80, title="Overbought")
CurrentRes = input(true, title="Use Current Chart Resolution?")
CustomRes = input("240", title="Custom Timeframe? Uncheck Box Above (E.g. 1M, 5D, 240 = 4Hours)")
//MFI Calc
res = CurrentRes ? period : CustomRes
rawMoneyFlow = hlc3 * volume
positiveMoneyFlow() =>
a = 0.0
a := hlc3 > hlc3[1] ? a + rawMoneyFlow : a
negativeMoneyFlow() =>
b = 0.0
b := hlc3 < hlc3[1] ? b + rawMoneyFlow : b
moneyFlowRatio = sma(positiveMoneyFlow(), length) / sma(negativeMoneyFlow(), length)
moneyFlowIndex = security(tickerid, res, 100 - 100 / (1 + moneyFlowRatio))
//OB/OS Identification
oversold = moneyFlowIndex[1] > os[1] and moneyFlowIndex < os
overbought = moneyFlowIndex[1] < ob[1] and moneyFlowIndex > ob
//Plotting
col = oversold ? green : red
plot(moneyFlowIndex, color=black, linewidth=2)
plot(oversold ? moneyFlowIndex : overbought ? moneyFlowIndex : na, title="Oversold/Overbought Cross", color=col, style=circles, linewidth=6)
h1 = hline(80, "Overbought")
h2 = hline(20, "Oversold")
h3 = hline(40, "Bears")
h4 = hline(60, "Bulls")
fill(h4, h1, color=green, title="Uptrend")
fill(h3, h2, color=red, title="Downtrend")
fill (h3, h4, color=gray, title="Transition Zone")
//Alerts
alert = oversold or overbought
alertcondition(oversold, title="MFI Oversold", message="MFI Crossed Oversold" )
alertcondition(overbought, title="MFI Overbought", message="MFI Crossed Overbought" )
alertcondition(alert, title="MFI Alert Both", message="MFI Alert Generated OB/OS" )
2020-02-01
535
글번호 135547
지표
답변완료
수평선 값 출력 좀 부탁 드립니다.
* 항상 많은 도움에 정말 고맙습니다.
< 1번 요청사항 > (그림참조)
1.CrossUp(var1, var2) 시작부터 20봉 까지만 수평선그리기
2.시작봉 open값 출력 (20폰드) 좀 요청 드립니다.
즉 CrossUp(var1, var2) 시작 되면 20봉(변수) 까지만 수평선으로 그어지고
그 수평선 위에 시작값 을 출력 되게 부탁 좀 드립니다.
아래는 연습해 봤는데 잘안되네요.....
var : TL1(0),TL2(0),TX1(0),TX2(0);
var1 = ma(c,5) ;
var2 = ma(c,20) ;
##+++++++++++++++++++++++++++++++++++++++++++
if CrossUp(var1, var2) Then { Tx1 = Text_New(sdate,stime, H-0.3 ,"●"); Text_SetColor(Tx1,BLACK); Text_SetSize(tx1,20); Text_SetStyle(tx1,2,2); }
if CrossDown(var1, var2) Then { Tx1 = Text_New(sdate,stime, H-0.3 ,"●"); Text_SetColor(Tx1,RED); Text_SetSize(tx1,20); Text_SetStyle(tx1,2,2); }
TL_Delete(TL1);
TL1 = TL_New(var1,var2, c,sdate,stime,dayopen); // CrossUp(var1, var2) 시작후 20봉 까지만 수평선 출력
Text_Delete(TX1);
TX1 = Text_New(sdate,Stime,c,NumToStr(TL_GetValue(TL1,sdate,stime),2)); // 수평선 위에 시작 첫봉 open가격 출력
< 2번 요청사항 > 가격선 표시 요청 드립니다.
## 골드 현재가격이 1593.4 일경우
var1 = c ;
var11 = var1 + PriceScale*1 ; # 계산하면 1593.5 가 나옴 올림으로 처리하서 1593.5 를 해도 되고
var12 = var1 - PriceScale*4 ; # 계산하면 1593.0 가 나옴 버림으로 처리하서 1593.0 도 가능
## 즉 PlotBaseLine10 을 기준으로 5틱 단위로 위, 아래로 표시 하고 싶습니다.
▶현재가격을 기준 으로 5틱 씩 끈어서 (버림 혹은 올림 하나만 적용)잡아 주시면 고맙습니다
PlotBaseLine1(1598.0,"1",GRAY,def,0.1) ; # 현개가격 기준선 + 45틱
PlotBaseLine2(1597.5,"2",GRAY,def,0.1) ; # 현개가격 기준선 + 40틱
PlotBaseLine3(1597.0,"3",GRAY,def,0.1) ; # 현개가격 기준선 + 35틱
PlotBaseLine4(1596.5,"4",GRAY,def,0.1) ; # 현개가격 기준선 + 30틱
PlotBaseLine5(1596.0,"5",GRAY,def,0.1) ; # 현개가격 기준선 + 25틱
PlotBaseLine6(1595.5,"6",GRAY,def,0.1) ; # 현개가격 기준선 + 20틱
PlotBaseLine7(1595.0,"7",GRAY,def,0.1) ; # 현개가격 기준선 + 15틱
PlotBaseLine8(1594.5,"8",GRAY,def,0.1) ; # 현개가격 기준선 + 10틱
PlotBaseLine9(1594.0,"9",GRAY,def,0.1) ; # 현개가격 기준선 + 5틱
PlotBaseLine10(1593.5,"10",GRAY,def,0.1) ; # 현개가격 기준선
.
PlotBaseLine11(1593.0,"11",GRAY,def,0.1) ; # 현개가격 기준선 - 5틱
PlotBaseLine12(1592.5,"12",GRAY,def,0.1) ; # 현개가격 기준선 - 10틱
PlotBaseLine13(1592.0,"13",GRAY,def,0.1) ; # 현개가격 기준선 - 15틱
PlotBaseLine14(1591.5,"14",GRAY,def,0.1) ; # 현개가격 기준선 - 20틱
PlotBaseLine15(1591.0,"15",GRAY,def,0.1) ; # 현개가격 기준선 - 25틱
PlotBaseLine16(1590.5,"16",GRAY,def,0.1) ; # 현개가격 기준선 - 30틱
PlotBaseLine17(1590.0,"17",GRAY,def,0.1) ; # 현개가격 기준선 - 35틱
PlotBaseLine18(1589.5,"18",GRAY,def,0.1) ; # 현개가격 기준선 - 40틱
PlotBaseLine19(1589.0,"19",GRAY,def,0.1) ; # 현개가격 기준선 - 45틱
* 항상 고맙습니다. 수고하십시요.
2020-02-03
501
글번호 135544
시스템