답변완료
예스랭귀지로 변환 부탁드려요
A=avg(C,period);
B=V*C;
M=Sum(B);
K=M-valuewhen(1,Crossup(C,A) OR Crossdown(C,A),M(1));
F=IF(C>=A,K,-K);
G=Avg(IF(C>=A,K,-K),20);
I=Valuewhen(1,Crossup(F,G) OR Crossdown(F,G),(high+low)/2);
J= avg(C,60)<avg(C,20);
K=avg(C,20)<avg(C,10);
C<I && J && K
Period 20
즐거운 하루 보내세요~~
2025-07-22
179
글번호 192671
종목검색
답변완료
예스랭귀지로 변환 부탁드립니다.
안녕하세요. 예스스탁님.
파인스크립트 지표를 예스랭귀지로 변환 부탁 드립니다.
바쁘신데도 불구하고 매번 친절하게 대응해주셔서 감사합니다.
-----------------------
//@version=5
indicator("Swing Pivots High Low", "Swing Pivots High Low", overlay=true, max_labels_count=500)
tf = input.timeframe(title="Timeframe", defval="")
gr="LENGTH LEFT / RIGHT"
leftLenH = input.int(title="Pivot High", defval=5, minval=1, inline="Pivot High",group=gr)
rightLenH = input.int(title="/", defval=5, minval=1, inline="Pivot High",group=gr)
colorH = input(title="", defval=color.red, inline="Pivot High",group=gr)
leftLenL = input.int(title="Pivot Low", defval=5, minval=1, inline="Pivot Low", group=gr)
rightLenL = input.int(title="/", defval=5, minval=1, inline="Pivot Low",group=gr)
colorL = input(title="", defval=color.blue, inline="Pivot Low",group=gr)
pivotHigh(ll, rl) =>
maxLen = 1000
float ph = ta.pivothigh(ll, rl)
int offset = 0
while offset < maxLen
if not na(ph[offset])
break
offset := offset + 1
ph[offset]
pivotLow(ll, rl) =>
maxLen = 1000
float pl = ta.pivotlow(ll, rl)
int offset = 0
while offset < maxLen
if not na(pl[offset])
break
offset := offset + 1
pl[offset]
ph = request.security(syminfo.tickerid, tf, pivotHigh(leftLenH, rightLenH), barmerge.gaps_off, barmerge.lookahead_on)
pl = request.security(syminfo.tickerid, tf, pivotLow(leftLenL, rightLenL), barmerge.gaps_off, barmerge.lookahead_on)
drawLabel(_offset, _pivot, _style, _color) =>
if not na(_pivot)
label.new(bar_index[_offset], _pivot, str.tostring(_pivot, format.mintick), style=_style, color=_color, textcolor=#131722)
// TODO: Need to calculate offset for different choiced timeframe.
// Theres an issue with finding the correct high/low bar as the high may be in the middle of a bar (for example: daily bar has alot of 5min bars)
// Lower timeframes have maximum available bars and it wont work when using higher timeframes - daily, weekly, monthly on smaller 5min/Nmin charts
// For now will not draw labels if different timeframe is choiced.
if (timeframe.period == tf or tf == "")
drawLabel(rightLenH, ta.pivothigh(leftLenH, rightLenH), label.style_label_down, colorH)
drawLabel(rightLenL, ta.pivotlow(leftLenL, rightLenL), label.style_label_up, colorL)
plotshape(ph, "PH", style=shape.circle, location=location.absolute, color=colorH)
plotshape(pl, "PL", style=shape.circle, location=location.absolute, color=colorL)
alertcondition(ta.crossover(close, ph), "PH Crossover", "Price crossed over current pivot high")
alertcondition(ta.crossunder(close, ph), "PH Crossunder", "Price crossed under current pivot high")
alertcondition(ta.crossover(close, pl), "PL Crossover", "Price crossed over current pivot low")
alertcondition(ta.crossunder(close, pl), "PL Crossunder", "Price crossed under current pivot low")
2025-07-22
173
글번호 192655
지표
답변완료
종목검색식 부탁드립니다
1. 아래수식을 참조하여 수식1) 이 수식2) 를 골든크로스 할때 검색식 부탁합니다.
2. 아래수식을 참조하여 수식3) 이 주봉 20 이평(단순) 돌파할때 검색식 부탁합니다.
--------아래-----
(수식1)
tenkan=If(Sum(거래량, ConvPeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, ConvPeriod) / Sum(거래량, ConvPeriod),
(Max(고가, ConvPeriod) + Min(저가, ConvPeriod)) / 2);
(수식2)
kijun = If(Sum(거래량, BasePeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, BasePeriod) / Sum(거래량, BasePeriod),
(Max(고가, BasePeriod) + Min(저가, BasePeriod)) / 2);
(수식3)
shift(close,-25)
(수식4)
spanA = (tenkan + kijun) / 2;
//SHIFT(spanA,25)
(수식5)
spanB = tenkan=If(Sum(거래량, SpanBPeriod) > 0,
Sum(((고가 + 저가) / 2) * 거래량, SpanBPeriod) / Sum(거래량, SpanBPeriod),
(Max(고가, SpanBPeriod) + Min(저가, SpanBPeriod)) / 2);
//SHIFT(spanB,25)
- 지표조건설정
ConvPeriod : 9
BasePeriod : 26
SpanBPeriod : 52
Shift : 26
2025-07-22
134
글번호 192654
종목검색