답변완료
수식 부탁해요
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// ⓒ BalintDavid
// WHAT IT DOES AND HOW TO USE:
// In the Input page you configure the RSI
//
// The indicator draws swings on the chart based on RSI extremes
// Example: Lines are draws from OVERSOLD to OVERBOUGHT and vice-versa
// If we keep geing in deeper OVERBOUGHT or OVERSOLD, the swinglines follow the price, till another cycle is complete
// In the labels you see the swing's relation to the structure: If the swing high is higher then the previous, it becomes Higher High aka HH
//@version=4
study("RSI Swing Indicator", overlay=true, max_bars_back=1000)
// RSI Settings for user
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)
// RSI value based on inbuilt RSI
rsiValue = rsi(rsiSource, rsiLength)
// Get the current state
isOverbought = rsiValue >= rsiOverbought
isOversold = rsiValue <= rsiOvesold
// State of the last extreme 0 for initialization, 1 = overbought, 2 = oversold
var laststate = 0
// Highest and Lowest prices since the last state change
var hh = low
var ll = high
// Labels
var label labelll = na
var label labelhh = na
// Swing lines
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
// FUNCTIONS
obLabelText() =>
if(last_actual_label_hh_price < high)
"HH"
else
"LH"
//plot(last_actual_label_hh_price)
osLabelText() =>
if(last_actual_label_ll_price < low)
"HL"
else
"LL"
// Create oversold or overbought label
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())
// Move the oversold swing and label
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)
// We go from oversold straight to overbought NEW DRAWINGS CREATED HERE
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)
// We go from overbought straight to oversold NEW DRAWINGS CREATED HERE
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 we are overbought
if(isOverbought)
if(high >= hh)
hh := high
moveOverBoughtLabel()
laststate := 1
// If we are oversold
if(isOversold)
if(low <= ll)
ll := low
moveOversoldLabel()
laststate := 2
// If last state was overbought and we are overbought
if(laststate == 1 and isOverbought)
if(hh <= high)
hh := high
moveOverBoughtLabel()
//If we are oversold and the last state was oversold, move the drawings to the lowest price
if(laststate == 2 and isOversold)
if(low <= ll)
ll := low
moveOversoldLabel()
// If last state was overbought
if(laststate == 1)
if(hh <= high)
hh := high
moveOverBoughtLabel()
// If last stare was oversold
if(laststate == 2)
if(ll >= low)
ll := low
moveOversoldLabel()
2024-07-23
907
글번호 181704
지표
답변완료
검색식 부탁 드립니다
지표조건
기간 5
기간1 20
1번
분봉에서 5_20 3골든 평균돌파 첫캔들 종목검색식 부탁드립니다 두번째 캔들부터는 검색이 안되도록 해주세요
5_20 3골든 평균돌파
M5=ma(c,기간);
M20=ma(c,기간1);
A=Valuewhen(1,crossup(M5,M20),C);
A1=Valuewhen(2,crossup(M5,M20),C);
A2=Valuewhen(3,crossup(M5,M20),C);
B=(A+A1+A2)/3;
Crossup(C,B) && C>O
2번 분봉에서 첫번째 골든크로스와 B의 지표수치가 같은 종목 검색식 부탁드립니다
2024-07-22
681
글번호 181703
종목검색
답변완료
신호검색 문의드립니다.
안녕하세요~
영웅문 수식 예스 랭귀지로 변환 요청드리려고 합니다.
1. 영웅문 → 예스 랭귀지
<첫번째>
a=ma(c,5);
aa=ma(c,20);
aaa=ma(c,60);
조건1=if(aa(1)<aa,aa,0);
조건2=l(1)<=aaa(1) && c(1)>aaa(1);
조건3=l(2)<=aaa(2) && c(2)>aaa(2);
조건4=l(3)<=aaa(3) && c(3)>aaa(3);
조건5=l(4)<=aaa(4) && c(4)>aaa(4);
조건6=l(5)<=aaa(5) && c(5)>aaa(5);
<두번째>
○ 조건
move1 = 5
move2 = 10
move3 = 20
move4 = 60
guide = 20
percent = 0.5
rangG = 1
rangH = 5
multiple = 1
○ 수식
A1 = MA(C,move1,단순);
A2 = MA(C,move2,단순);
A3 = MA(C,move3,단순);
A4 = MA(C,move4,단순);
Guide1 = MA(C,guide,단순);
B1 = (C >= A1 && A1 >= A2) || (C >= A1 && A1 >= A2 && A2 >= A3) || (C > A1 && A1 >= A2 && A2 >= A3 && A3 >= A4);
B2 = max(A1, A2) < min(A1, A2) * (1+percent/100) || max(A1, A2, A3) < min(A1, A2, A3) * (1+percent/100) || max(A1, A2, A3, A4) < min(A1, A2, A3, A4) * (1+percent/100);
B3 = Guide1 (rangG) <= Guide1;
C1 = V * ((O+C+H+L)/4);
C2 = if(O<C,V*((O+C+H+L)/4),0);
C3 = highest(C1(1),rangH) * multiple < C2;
바쁘시겠지만 잘 부탁드립니다^^
항상 감사합니다.
2024-07-19
779
글번호 181700
종목검색
답변완료
지표 변환 부탁드립니다
지표 변환 부탁드립니다
수식1
a=avg(c,Period);
b=((L+H+O+C)/4)*V/100000000;
d=sum(b);
K=m-valuewhen(1, CrossUp(c,a) or CrossDown(c,a), d(1));
if(c>=a, k, -k)
수식2
a=avg(c,Period);
b=((L+H+O+C)/4)*V/100000000;
d=sum(b);
K=m-valuewhen(1, CrossUp(c,a) or CrossDown(c,a), d(1));
if(c>=a, k, -k);
avg(if(c>=a, k, -k), Period)
Period=25
2024-07-19
740
글번호 181675
지표