아래수식을 예스로 부탁합니다.
rsiSource = input(title="RSI Source", type=input.source, defval=close)
rsiLength = input(title="RSI Length", type=input.integer, defval=7)
rsiOverbought = input(title="RSI Overbought", type=input.integer, defval=70,
minval=51, maxval=100)
rsiOvesold = input(title="RSI Oversold", type=input.integer, defval=30, minval=1,
maxval=49)
rsiValue = rsi(rsiSource, rsiLength)
isOverbought = rsiValue >= rsiOverbought
isOversold = rsiValue <= rsiOvesold
var laststate = 0
var hh = low
var ll = high
var label labelll = na
var label labelhh = na
var line line_up = na
var line line_down = na
var last_actual_label_hh_price = 0.0
var last_actual_label_ll_price = 0.0
obLabelText() =>
if(last_actual_label_hh_price < high)
"HH"
else
"LH"
osLabelText() =>
if(last_actual_label_ll_price < low)
"HL"
else
"LL"
createOverBoughtLabel(isIt) =>
if(isIt)
label.new(x=bar_index, y=na ,yloc=yloc.abovebar, style=label.style_label_down, color=color.red, size=size.tiny, text=obLabelText())
else
label.new(x=bar_index, y=na ,yloc=yloc.belowbar, style=label.style_label_up, color=color.green, size=size.tiny, text=osLabelText())
moveOversoldLabel() =>
label.set_x(labelll, bar_index)
label.set_y(labelll, low)
label.set_text(labelll, osLabelText())
line.set_x1(line_down, bar_index)
line.set_y1(line_down, low)
moveOverBoughtLabel() =>
label.set_x(labelhh, bar_index)
label.set_y(labelhh, high)
label.set_text(labelhh, obLabelText())
line.set_x1(line_up, bar_index)
line.set_y1(line_up, high)
if(laststate == 2 and isOverbought)
hh := high
labelhh := createOverBoughtLabel(true)
last_actual_label_ll_price := label.get_y(labelll)
labelll_ts = label.get_x(labelll)
labelll_price = label.get_y(labelll)
line_up := line.new(x1=bar_index, y1=high, x2=labelll_ts, y2=labelll_price, width=1)
if(laststate == 1 and isOversold)
ll := low
labelll := createOverBoughtLabel(false)
last_actual_label_hh_price := label.get_y(labelhh)
labelhh_ts = label.get_x(labelhh)
labelhh_price = label.get_y(labelhh)
line_down := line.new(x1=bar_index, y1=high, x2=labelhh_ts, y2=labelhh_price, width=1)
if(isOverbought)
if(high >= hh)
hh := high
moveOverBoughtLabel()
laststate := 1
if(isOversold)
if(low <= ll)
ll := low
moveOversoldLabel()
laststate := 2
if(laststate == 1 and isOverbought)
if(hh <= high)
hh := high
moveOverBoughtLabel()
if(laststate == 2 and isOversold)
if(low <= ll)
ll := low
moveOversoldLabel()
if(laststate == 1)
if(hh <= high)
hh := high
moveOverBoughtLabel()
if(laststate == 2)
if(ll >= low)
ll := low
moveOversoldLabel()
답변 1
예스스탁
예스스탁 답변
2020-10-05 15:46:45
안녕하세요
예스스탁입니다.
올려주신 수식은 해당 언어에 능숙하지 않아 모두 도움말을 보고 변경해야 하는데
작성해 보는데 시간이 많이 요구되어 답변이 가능하지 않습니다.
한정된 시간안에 많은 분들의 질문을 처리해야하는 업무상 일정이상 요구되는 수식은 저희가 답변을 드릴수가 없습니다.
도움을 드리지 못해 죄송합니다.
즐거운 하루되세요
> as8282 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 아래수식을 예스로 부탁합니다.
rsiSource = input(title="RSI Source", type=input.source, defval=close)
rsiLength = input(title="RSI Length", type=input.integer, defval=7)
rsiOverbought = input(title="RSI Overbought", type=input.integer, defval=70,
minval=51, maxval=100)
rsiOvesold = input(title="RSI Oversold", type=input.integer, defval=30, minval=1,
maxval=49)
rsiValue = rsi(rsiSource, rsiLength)
isOverbought = rsiValue >= rsiOverbought
isOversold = rsiValue <= rsiOvesold
var laststate = 0
var hh = low
var ll = high
var label labelll = na
var label labelhh = na
var line line_up = na
var line line_down = na
var last_actual_label_hh_price = 0.0
var last_actual_label_ll_price = 0.0
obLabelText() =>
if(last_actual_label_hh_price < high)
"HH"
else
"LH"
osLabelText() =>
if(last_actual_label_ll_price < low)
"HL"
else
"LL"
createOverBoughtLabel(isIt) =>
if(isIt)
label.new(x=bar_index, y=na ,yloc=yloc.abovebar, style=label.style_label_down, color=color.red, size=size.tiny, text=obLabelText())
else
label.new(x=bar_index, y=na ,yloc=yloc.belowbar, style=label.style_label_up, color=color.green, size=size.tiny, text=osLabelText())
moveOversoldLabel() =>
label.set_x(labelll, bar_index)
label.set_y(labelll, low)
label.set_text(labelll, osLabelText())
line.set_x1(line_down, bar_index)
line.set_y1(line_down, low)
moveOverBoughtLabel() =>
label.set_x(labelhh, bar_index)
label.set_y(labelhh, high)
label.set_text(labelhh, obLabelText())
line.set_x1(line_up, bar_index)
line.set_y1(line_up, high)
if(laststate == 2 and isOverbought)
hh := high
labelhh := createOverBoughtLabel(true)
last_actual_label_ll_price := label.get_y(labelll)
labelll_ts = label.get_x(labelll)
labelll_price = label.get_y(labelll)
line_up := line.new(x1=bar_index, y1=high, x2=labelll_ts, y2=labelll_price, width=1)
if(laststate == 1 and isOversold)
ll := low
labelll := createOverBoughtLabel(false)
last_actual_label_hh_price := label.get_y(labelhh)
labelhh_ts = label.get_x(labelhh)
labelhh_price = label.get_y(labelhh)
line_down := line.new(x1=bar_index, y1=high, x2=labelhh_ts, y2=labelhh_price, width=1)
if(isOverbought)
if(high >= hh)
hh := high
moveOverBoughtLabel()
laststate := 1
if(isOversold)
if(low <= ll)
ll := low
moveOversoldLabel()
laststate := 2
if(laststate == 1 and isOverbought)
if(hh <= high)
hh := high
moveOverBoughtLabel()
if(laststate == 2 and isOversold)
if(low <= ll)
ll := low
moveOversoldLabel()
if(laststate == 1)
if(hh <= high)
hh := high
moveOverBoughtLabel()
if(laststate == 2)
if(ll >= low)
ll := low
moveOversoldLabel()