커뮤니티

수식전환 부탁드립니다.

프로필 이미지
임진사댁원장
2020-02-01 18:15:11
536
글번호 135547
답변완료
아래 수식을 예스수식으로 전환부탁드립니다. 감사합니다. 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" )
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-02-03 15:05:34

안녕하세요 예스스탁입니다. 해당 언어를 대략적으로만 알고 있어 각 함수의 내용을 정확히 파악하기가 어렵습니다. 업무상 해당 언어의 도움말을 보고 변환해 드리기에는 시간이 많이 소모됩니다. 구현하고자 하시는 내용을 자세한 글로 올려주셔야 식을 작성해 드릴수 있을것 같습니다. 즐거운 하루되세요 > 임진사댁원장 님이 쓴 글입니다. > 제목 : 수식전환 부탁드립니다. > 아래 수식을 예스수식으로 전환부탁드립니다. 감사합니다. 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" )