커뮤니티

수식 변환 부탁 드립니다.

프로필 이미지
cooparoo
2024-05-04 00:31:05
842
글번호 179144
답변완료
안녕하세요! 수식 변환 부탁드립니다. 감사합니다^ /@version=5 indicator(overlay=true) // ** ---> Inputs ------------- { var bool positive = false var bool negative = false string RSI_group = "RSI Settings" string mom_group = "Momentum Vales" string visual = "Visuals" int Len2 = input(14,"RSI 1&#65039;&#8419;",inline = "rsi",group = RSI_group) int pmom = input(65," Positive above",inline = "rsi1",group =RSI_group ) int nmom = input(32,"Negative below",inline = "rsi1",group =RSI_group ) bool showlabels = input(true,"Show Momentum &#10067;",inline = "001",group =visual ) color p = input(color.rgb(76, 175, 79, 62),"Positive",inline = "001",group =visual ) color n = input(color.rgb(255, 82, 82, 66),"Negative",inline = "001",group =visual ) bool filleshow = input(true,"Show highlighter &#10067;",inline = "002",group =visual ) color bull = input(color.rgb(76, 175, 79, 62),"Bull",inline = "002",group =visual ) color bear = input(color.rgb(255, 82, 82, 66),"Bear",inline = "002",group =visual ) rsi = ta.rsi(close, Len2) //------------------- } // ** ---> Momentums ------------- { p_mom = rsi[1] < pmom and rsi > pmom and rsi > nmom and ta.change(ta.ema(close,5)) > 0 n_mom = rsi < nmom and ta.change(ta.ema(close,5)) < 0 if p_mom positive:= true negative:= false if n_mom positive:= false negative:= true // ** ---> Entry Conditions ------------- { a = plot(filleshow ? ta.ema(high,5) : na,display = display.none,editable = false) b = plot(filleshow ? ta.ema(low,10) : na,style = plot.style_stepline,color = color.red,display = display.none,editable = false) // fill(a,b,color = color.from_gradient(rsi14,35,pmom,color.rgb(255, 82, 82, 66),color.rgb(76, 175, 79, 64)) ) fill(a,b,color = positive ? bull :bear ,editable = false) //plotting pcondition = positive and not positive[1] ncondition2 = negative and not negative[1] plotshape(showlabels ? pcondition: na , title="Positive Signal",style=shape.labelup, color=p, location= location.belowbar , size=size.tiny,text= "Positive",textcolor = color.white) plotshape(showlabels ? ncondition2: na , title="Negative Signal",style=shape.labeldown, color=n, location= location.abovebar , size=size.tiny,text = "Negative",textcolor = color.white) // Alerts // alertcondition(pcondition,"Positive Trend") alertcondition(ncondition2,"Negative Trend") //
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-05-07 09:51:10

안녕하세요 예스스탁입니다. input : Len2(14); input : pmom(65); input : nmom(32); #bool showlabels = input(true,"Show Momentum &#10067;",inline = "001",group =visual ) #color p = input(color.rgb(76, 175, 79, 62),"Positive",inline = "001",group =visual ) #color n = input(color.rgb(255, 82, 82, 66),"Negative",inline = "001",group =visual ) #bool filleshow = input(true,"Show highlighter &#10067;",inline = "002",group =visual ) #color bull = input(color.rgb(76, 175, 79, 62),"Bull",inline = "002",group =visual ) #color bear = input(color.rgb(255, 82, 82, 66),"Bear",inline = "002",group =visual ) var : positive(false),negative(false),R(0); var : n_mom(False),p_mom(False),E(0); var : pcondition(False),ncondition2(False),tx(0); r = rsi(Len2); E = Ema(C,5); p_mom = r[1] < pmom and r > pmom and r > nmom and E-E[1] > 0; n_mom = r < nmom and E-E[1] < 0; if p_mom == true Then { positive = true; negative = false; } if n_mom then { positive = false; negative = true; } plot1(ema(high,5)); plot2(ema(low,10)); pcondition = positive == true and positive[1] == False; ncondition2 = negative == true and negative[1] == False; if pcondition == true then { tx = Text_New(sDate,sTime,L,"▲"); Text_SetStyle(tx,2,0); Text_SetColor(tx,rgb(76, 175, 79)); } if ncondition2 == true then { tx = Text_New(sDate,sTime,H,"▼"); Text_SetStyle(tx,2,1); Text_SetColor(tx,rgb(255, 82, 82)); } 즐거운 하루되세요 > cooparoo 님이 쓴 글입니다. > 제목 : 수식 변환 부탁 드립니다. > 안녕하세요! 수식 변환 부탁드립니다. 감사합니다^ /@version=5 indicator(overlay=true) // ** ---> Inputs ------------- { var bool positive = false var bool negative = false string RSI_group = "RSI Settings" string mom_group = "Momentum Vales" string visual = "Visuals" int Len2 = input(14,"RSI 1&#65039;&#8419;",inline = "rsi",group = RSI_group) int pmom = input(65," Positive above",inline = "rsi1",group =RSI_group ) int nmom = input(32,"Negative below",inline = "rsi1",group =RSI_group ) bool showlabels = input(true,"Show Momentum &#10067;",inline = "001",group =visual ) color p = input(color.rgb(76, 175, 79, 62),"Positive",inline = "001",group =visual ) color n = input(color.rgb(255, 82, 82, 66),"Negative",inline = "001",group =visual ) bool filleshow = input(true,"Show highlighter &#10067;",inline = "002",group =visual ) color bull = input(color.rgb(76, 175, 79, 62),"Bull",inline = "002",group =visual ) color bear = input(color.rgb(255, 82, 82, 66),"Bear",inline = "002",group =visual ) rsi = ta.rsi(close, Len2) //------------------- } // ** ---> Momentums ------------- { p_mom = rsi[1] < pmom and rsi > pmom and rsi > nmom and ta.change(ta.ema(close,5)) > 0 n_mom = rsi < nmom and ta.change(ta.ema(close,5)) < 0 if p_mom positive:= true negative:= false if n_mom positive:= false negative:= true // ** ---> Entry Conditions ------------- { a = plot(filleshow ? ta.ema(high,5) : na,display = display.none,editable = false) b = plot(filleshow ? ta.ema(low,10) : na,style = plot.style_stepline,color = color.red,display = display.none,editable = false) // fill(a,b,color = color.from_gradient(rsi14,35,pmom,color.rgb(255, 82, 82, 66),color.rgb(76, 175, 79, 64)) ) fill(a,b,color = positive ? bull :bear ,editable = false) //plotting pcondition = positive and not positive[1] ncondition2 = negative and not negative[1] plotshape(showlabels ? pcondition: na , title="Positive Signal",style=shape.labelup, color=p, location= location.belowbar , size=size.tiny,text= "Positive",textcolor = color.white) plotshape(showlabels ? ncondition2: na , title="Negative Signal",style=shape.labeldown, color=n, location= location.abovebar , size=size.tiny,text = "Negative",textcolor = color.white) // Alerts // alertcondition(pcondition,"Positive Trend") alertcondition(ncondition2,"Negative Trend") //