커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3472
글번호 230811
답변완료
수식입력값(yeslanguage로 변환 요청)
안녕 하십닌까?
아래 함수 yeslanguage로 변환해서 수식값 등록할수 있도록 부탁드립니다.
//@version=5
indicator(title=macd+200ema",timeframe="",timeframe_gaps=true)
// getting inputs
fast_length = input(title = "fast length", defval =12)
slow_length = input(title = "slow length", defval =26)
src = input(title = "source" , defval =close)
signal_length = input.int(title ="signal smoothing",minval=1,maxval=50,
defval = 9 , display = display.data_windows)
sma_source = input.string(title=:oscillator ma type",defval= "ema", options =
[ "sma", "ema"],display = display.data_windows)
sma_signal=input.string(title = "signal line ma type",defval = "ema",
option=[ "sma", "ema"],display = display.data_windows)
// calculating
2025-07-03
298
글번호 192249
답변완료
질문 부탁드립니다
수고가 많으십니다
혹시 이런 수식도 가능한지 여쭤보고 싶습니다
차트상 조건 h>l*1.1 이 최초로 나오고 나서 (a봉 라고 할게요) 그 이후로
a봉 저가대비 8% 이상 상승한 봉을 찾는데 (반드시 h>l*1.1 일 필요없음)
누적을 해서 a 봉의 고가를 기준으로 20퍼센트를 초과하게 되면, 그 봉의 (봉 B) 고가를 구함
그 후로 봉B 고가 에서부터 -8% 하락한 봉을 찾습니다 (b봉 고가 기준 -20% 하락 지점까지)
봉b 기준 -20% 을 초과하면 그 봉의 저가를 구한뒤 다시 상승형 비교..
이 패턴을 계속 반복하게 하려고 하는데 작성이 가능할까요?
예를 들어서 가장 최초의 h>l*1.1 봉 이후에 조건봉 "저가"대비 +15% 봉 , 그 이후에 +8% 봉(+15% 봉의 저가 대비)이 체크되면
총 +23% (+20% 초과) 이므로 그 봉을 새로운 기준봉으로 하고
그 "고가값"을 기준으로 다음이 -15%, 그 다음이 -8% 이라면 그 봉이 새로운 기준봉, 그때의 저가를 구함 ...
이런식으로 상승 하락의 흐름을 만들고자합니다
**중점적으로 알고 싶은건 h>l*1.1이라는 조건을 최초만족했을때만 적용하고 그 이후로는 독립적인 조건으로 진행되게 할 수 있는지 입니다
감사합니다
2025-07-03
262
글번호 192248
답변완료
종목 검색식 부탁드립니다.
더위에 고생 많으십니다.
1. 일봉기준으로
주봉20이평 < 주봉60이평 일때
고가가 주봉60이평 위의 종목을 검색하고자 합니다.
(즉, 5일이내 고가가 잠시라도 주봉60이평을 돌파한 종목이 필요하다는 의미)
2. 30분봉기준으로
주봉20이평 < 주봉60이평 일때
고가가 주봉60이평 위의 종목을 검색하고자 합니다.
(즉, 5봉이내 고가가 잠시라도 주봉60이평을 돌파한 종목이 필요하다는 의미)
가능하시면 부탁드립니다.
항상 많은 도움에 감사드립니다.
2025-07-03
281
글번호 192247
답변완료
도움을 요청합니다.
본격 무더위가 시작되었습니다.
늘 도와주심에 감사드리고요
또 도움을 요청합니다.
=========================================
변수 v1 = data1(Upvol-DownVol);
변수 v2 =
SC= (C-O)/(H-L); //캔들의 몸통비율 산출
SCV = SC*v; //실제 몸통비율만큼 볼륨 값 산출
변수sum = v1+v2/2; //결론적으로 산출 방법이 다른 두 개의 볼륨을 합산, /2 평균값을 표현하고자 합니다.
추가로 피보나치비율 Plot 부탁드립니다.
=======================================================
늘 도와주심에 감사드립니다. 꾸벅
2025-07-02
337
글번호 192246
답변완료
부탁드립니다.
아래수식에서 Plot1 밴드현황에 관련하여 강세약세 수식을 부탁드립니다.
Var : 렌코(0), 렌코_시가 (0), 렌코_종가 (0), 렌코_고가 (0), 렌코_저가(0), 밴드_상단 (0), 밴드_중심 (0), 밴드_하단 (0), V_Renko(0),V_Renko_YN(0), 렌코추세(0), 렌코전환(0), 렌코전고점(0), 렌코전저점(0),렌코카운터(0) ;
렌코 = WoodStock_Renko_Band_K3(PriceScale*6,렌코_시가, 렌코_종가, 렌코_고가, 렌코_저가,밴드_상단, 밴드_중심, 밴드_하단,V_Renko,V_Renko_YN, 렌코추세, 렌코전환, 렌코전고점, 렌코전저점,렌코카운터);
Var : 랜코지속(0), 밴드위치(0),밴드전고저(0), 밴드현황(0), 밴드현황추가(0),밴드위치추가(0);
If DayIndex == 0 Then
{렌코전고점 = 0;
렌코전저점 = 0;
}
밴드전고저
= IFF(렌코_종가 > 렌코전고점 && V_Renko_YN > 0 && 렌코전고점 <> 0, 1,
IFF(렌코_종가 < 렌코전저점 && V_Renko_YN < 0 && 렌코전저점 <> 0, -1,
0));
랜코지속
= IFF(렌코카운터 > 1, 1,
IFF(렌코카운터 < -1, -1,
0));
밴드위치추가 =
IFF(렌코_종가 > 밴드_상단 , 2,
IFF(렌코_종가 < 밴드_하단 , -2,
0));
밴드위치 =
IFF(렌코_시가 >= 밴드_상단 , 3,
IFF(렌코_시가 > 밴드_중심 , 1,
IFF(렌코_시가 >= 밴드_중심 && V_Renko_YN > 0, 1,
IFF(렌코_시가 <= 밴드_하단 , -3,
IFF(렌코_시가 < 밴드_중심 , -1,
IFF(렌코_시가 <= 밴드_중심 && V_Renko_YN < 0, -1,
0))))));
밴드현황 = 랜코지속+V_Renko_YN;//+밴드전고저;
PlotBaseLine1(0);
Plot1(밴드현황,"밴드현황",
IFF(밴드현황 > 4 ,RGB(190,0,0),
IFF(밴드현황 > 3 ,RGB(255,0,0),
IFF(밴드현황 > 0 ,rgb(251, 126, 126),
IFF(밴드현황 < -4 ,RGB(0,0,0),
IFF(밴드현황 < -3 ,RGB(0,0,255),
IFF(밴드현황 < 0 , rgb(78, 163, 253),
GRAY)))))),DEF,1);
2025-07-02
380
글번호 192245
답변완료
추세선 변곡점에 수치(가격)를 포함
아래 추세선 수식의 변곡점에 수치(가격)를 포함해주시면 고맙겠습니다
============================================================
input : Period(35),선두께(2),기준(-10),p(5);
Var:상승색(Turquoise), 하락색(Turquoise),Vpower(0),mav(0);
Var:j(0),T(0);
Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
Array:r[7](0),fr[7](0),TL2[7](0),TL3[7](0),TX2[7](0),TX3[7](0);
Plot1(0);
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
Vpower = upVol/(upVol+downVol)*100-50;
mav = ma(Vpower,p);
if 기준 < mav Then
T = 1;
if 기준 > mav Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,하락색);
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
for j = 0 to 6
{
fr[j] = LoVal[1] + ((HiVal[0] - LoVal[1]) * r[j]);
}
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date22 = date[0];
time22 = stime[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,상승색);
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
for j = 0 to 5
{
fr[j] = LoVal[0] + ((HiVal[1] - LoVal[0]) * r[j]);
}
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date32 = date[0];
time32 = stime[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
}
}
TL_SetSize(TL1,선두께);
TL_SetDrawMode(TL1,0);
2025-07-03
313
글번호 192244
답변완료
수식 질문
항상 친절한 답변에 감사드립니다.
아래 별개의 For문 수식 2개를 논리합(or조건)으로 결합한 수식을 부탁드립니다
[수식1]
var : A(False),N(0),Sum(0),T(0);
A = C < C[1];
Sum = 0;
T = 0;
For N = 0 to 10
{if A[N] == true Then Sum = Sum + 1;
T = T + Sum;}
If T > 40 Then Find(1);
[수식2]
var : A(False),N(0),Sum(0),T(0);
A = C > O;
Sum = 0;
T = 0;
For N = 0 to 10
{if A[N] == true Then Sum = Sum + 1;
T = T + Sum;}
If T > 40 Then Find(1);
2025-07-02
257
글번호 192243
답변완료
함수요청
단기 분봉으로 당일 macd 오실레이터 음전환시 매도
양전환시 매도청산
당일 양전환시 매수, 음전환시 매수청산
당일 매매횟수는 최대 진입과 청산 각 1회
예스랭귀지로 스크립트 짜줘
2025-07-02
262
글번호 192242
답변완료
적용가능하도록 부탁드립니다.
import HeWhoMustNotBeNamed/ta/1
indicator("포인트 CCI", format=format.price, precision=2, explicit_plot_zorder=true)
const string version = "v2.2"
const string groupSettings = "Settings "+ version
var bullcol = input.color(#E91E63, 'Cold Color', group=groupSettings, inline="col")
var bearcol = input.color(#00BCD4, 'Hot Color', group=groupSettings, inline="col")
var invisible = color.rgb(0, 0, 0, 100)
var bullcol_xlight = color.new(bullcol, 80)
var bearcol_xlight = color.new(bearcol, 80)
var bullcol_light = color.new(bullcol, 70)
var bearcol_light = color.new(bearcol, 70)
var bullcol_medium = color.new(bullcol, 60)
var bearcol_medium = color.new(bearcol, 60)
var shortcol = chart.fg_color
var longcol = color.rgb(255,220,100)
var pivotcol = color.white
const int bull_signal_loc = -107
const int bear_signal_loc = 5
const string mode1 = "1 Oscillator Mode"
const string mode2 = "2 Overlay Mode (top and bottom no oscillator)"
const string mode3 = "3 Candle Mode"
mode = input.string(mode1, "Display Mode", options=[mode1, mode2, mode3], tooltip="Modes 2 & 3 are more advanced and expect that you most likely overlay the indicator on top of price action itself or another indiciator using TradingView's object tree panel.", group=groupSettings)
compact = mode == mode2
formula1 = "Standard (2 Period)"
formula2 = "Average"
formula = input.string(formula1, "Formula", options=[formula1, formula2], group=groupSettings)
use_average = formula == formula2
src = input.source(close, "Source", group=groupSettings)
threshold = input.int(20, title="Exhaustion Threshold", minval=1, maxval=50, group=groupSettings, tooltip="Sets the overbought/oversold zone size and offset. Lower values will produce less results, higher values towards 50 will produce many results.")
smoothType = input.string('ema', title="Smoothing Type", options=['sma', 'ema', 'hma', 'rma', 'wma', 'vwma', 'swma', 'highlow', 'linreg', 'median', 'mom', 'percentrank'], group=groupSettings)
average_ma = input.int(3, "Average Formula MA", group=groupSettings)
plot_shading = input.bool(true, title="Fill Gradients in OB/OS Zone", group=groupSettings)
plot_crosses = input.bool(false, title="Highlight Crossovers", group=groupSettings, tooltip="Experimental idea for plotting crossovers with attempted bull/bear coloring. This needs to be combined with other TA but typically crossover condition results in interesting price action during or after.")
plot_zero_crosses = input.bool(false, title="Plot Zero Line Crosses", group=groupSettings, tooltip="Experimental idea for plotting crosses")
const string lookbackGroupName = "Dual Signal Setup (Fast/Slow Lookback)"
shortLength = input.int(title="Fast Length", defval=30, group=lookbackGroupName)
shortSmoothingLength = input.int(7, title="Fast Smoothing Length", group=lookbackGroupName)
longLength = input.int(112, title="Slow Length", minval=1, group=lookbackGroupName)
longSmoothingLength = input.int(3, title="Slow Smoothing Length", group=lookbackGroupName)
_pr(length) =>
float max = ta.highest(length)
float min = ta.lowest(length)
100 * (src - max) / (max - min)
float s_percentR = _pr(shortLength)
float l_percentR = _pr(longLength)
float avg_percentR = math.avg(s_percentR, l_percentR)
if shortSmoothingLength > 1
s_percentR := ta.ma(s_percentR, smoothType, shortSmoothingLength)
if longSmoothingLength > 1
l_percentR := ta.ma(l_percentR, smoothType, longSmoothingLength)
if average_ma > 1
avg_percentR := ta.ma(avg_percentR, smoothType, average_ma)
var was_ob = false
var was_os = false
bool overbought = s_percentR >= -threshold and l_percentR >= -threshold
bool oversold = s_percentR <= -100+threshold and l_percentR <= -100+threshold
bool ob_reversal = not overbought and overbought[1]
bool os_reversal = not oversold and oversold[1]
bool ob_trend_start = overbought and not overbought[1]
bool os_trend_start = oversold and not oversold[1]
bool bool_cross_long1 = ta.crossover(s_percentR, -50)
bool bool_cross_long2 = ta.crossover(l_percentR, -50)
bool cross_zero_long = bool_cross_long1 or bool_cross_long2
bool bool_cross_short1 = ta.crossunder(s_percentR, -50)
bool bool_cross_short2 = ta.crossunder(l_percentR, -50)
bool cross_zero_short = bool_cross_short1 or bool_cross_short2
bool zero_long = (s_percentR > -50 and l_percentR > -50) and cross_zero_long
bool zero_short = (s_percentR < -50 and l_percentR < -50) and cross_zero_short
if use_average
// use average
overbought := avg_percentR >= -threshold
oversold := avg_percentR <= -100+threshold
ob_reversal := not overbought and overbought[1]
os_reversal := not oversold and oversold[1]
ob_trend_start := overbought and not overbought[1]
os_trend_start := oversold and not oversold[1]
bool cross_bear = ta.crossover(l_percentR, s_percentR)
bool cross_bull = ta.crossunder(l_percentR, s_percentR)
middle = hline(mode == mode1 ? -50 : na, 'Middle Line', color.orange, hline.style_solid)
band1 = hline(mode == mode1 ? -20 : na, 'Overbought Line', color.white, hline.style_solid)
band0 = hline(mode == mode1 ? -80 : na, 'Oversold Line', color.white, hline.style_solid)
p_fastr = plot(mode == mode1 and not use_average ? s_percentR : na, "Fast Period %R", color=shortcol, linewidth=1)
p_slowr = plot(mode == mode1 and not use_average ? l_percentR : na, "Slow Period %R", color=longcol, linewidth=1)
p_avgr = plot(mode == mode1 and use_average ? avg_percentR : na, "Average Formula %R", color=shortcol, linewidth=1)
gradientBullColor = plot_shading ? color.new(bullcol, 100) : invisible
gradientBearColor = plot_shading ? color.new(bearcol, 100) : invisible
fill(p_fastr, p_slowr, 0, -30, top_color = color.new(gradientBearColor, 0), bottom_color = gradientBearColor, title = "Overbought Gradient Fill")
fill(p_fastr, p_slowr, -70, -100, top_color = gradientBullColor, bottom_color = color.new(gradientBullColor, 0), title = "Oversold Gradient Fill")
plotshape(ob_reversal ? bear_signal_loc : na, title="Overbought Trend Reversal ▼", style=shape.triangledown, location=mode == mode1 ? location.absolute : mode == mode3 ? location.abovebar : location.top, color=bullcol, text='', textcolor=invisible, size=size.tiny)
plotshape(os_reversal ? bull_signal_loc : na, title="Oversold Trend Reversal ▲", style=shape.triangleup, location=mode == mode1 ? location.absolute : mode == mode3 ? location.belowbar : location.bottom, color=bearcol, text='', textcolor=invisible, size=size.tiny)
plotshape(overbought ? bear_signal_loc : na, title="Overbought Trend Warning ■", style=shape.square, location=mode == mode1 ? location.absolute : mode == mode3 ? location.abovebar : location.top, color=bearcol_medium, text='', textcolor=invisible, size=size.tiny)
plotshape(oversold ? bull_signal_loc : na, title="Oversold Trend Warning ■", style=shape.square, location=mode == mode1 ? location.absolute : mode == mode3 ? location.belowbar : location.bottom, color=bullcol_medium, text='', textcolor=invisible, size=size.tiny)
plotshape(zero_long and plot_zero_crosses ? bear_signal_loc : na, title="Zero Cross Long", style=shape.triangleup, location=mode == mode1 ? location.absolute : mode == mode3 ? location.abovebar : location.top, color=color.yellow, text='', textcolor=invisible, size=size.tiny)
plotshape(zero_short and plot_zero_crosses ? bull_signal_loc : na, title="Zero Cross Short", style=shape.triangledown, location=mode == mode1 ? location.absolute : mode == mode3 ? location.belowbar : location.bottom, color=color.yellow, text='', textcolor=invisible, size=size.tiny)
plot(not compact and plot_crosses and (cross_bull or cross_bear) ? l_percentR : na, "Crossover Dot (small)", style=plot.style_circles, color=pivotcol, linewidth=4)
plot(not compact and plot_crosses and (cross_bull or cross_bear) ? l_percentR : na, "Crossover Dot (big)", style=plot.style_circles, color=cross_bull ? bullcol_light : bearcol_light, linewidth=12)
plotchar(ob_trend_start ? bear_signal_loc : na, char="◡", color=bearcol, location=mode == mode1 ? location.absolute : mode == mode3 ? location.abovebar : location.top)
plotchar(os_trend_start ? bull_signal_loc : na, char="◠", color=bullcol, location=mode == mode1 ? location.absolute : mode == mode3 ? location.belowbar : location.bottom)
varip groupAlerts = "Alerts"
bullStartOn = input.bool(true, "Bull trend start ⏹", group=groupAlerts, inline="bullStart")
bullStartTxt = input.string("%RTE bull trend start ⏹", "", group=groupAlerts, inline="bullStart")
bearStartOn = input.bool(true, "Bear trend start ⏹", group=groupAlerts, inline="bearStart")
bearStartTxt = input.string("%RTE bear trend start ⏹", "", group=groupAlerts, inline="bearStart")
bullReversalOn = input.bool(true, "Bull trend break ▼", group=groupAlerts, inline="bullReversal")
bullReversalTxt = input.string("%RTE bull trend break ▼", "", group=groupAlerts, inline="bullReversal")
bearReversalOn = input.bool(true, "Bear trend break ▲", group=groupAlerts, inline="bearReversal")
bearReversalTxt = input.string("%RTE bear trend break ▲", "", group=groupAlerts, inline="bearReversal")
bullCrossOn = input.bool(false, "Bull cross ⏺", group=groupAlerts, inline="bullCross")
bullCrossTxt = input.string("Bullish crossover", "", group=groupAlerts, inline="bullCross")
bearCrossOn = input.bool(false, "Bear cross ⏺", group=groupAlerts, inline="bearCross")
bearCrossTxt = input.string("Bearish crossover", "", group=groupAlerts, inline="bearCross")
if (bullReversalOn and ob_reversal)
alert(message="하락전환", freq=alert.freq_once_per_bar_close)
else if (bearReversalOn and os_reversal)
alert(message="상승전환", freq=alert.freq_once_per_bar_close)
const string group_strategy = "Strategy (send external signal to TTS backtester)"
bool longDealsEnabled = input.bool(true, "Enable Long Deals", group=group_strategy)
bool shortDealsEnabled = input.bool(true, "Enable Short Deals", group=group_strategy)
strategy1 = "1 Trend Following @ Square"
strategy2 = "2 Reversal @ Square"
strategy3 = "3 Reversal Trade @ Triangle"
strategy4 = "4 Re-enter Trend Trade @ Triangle"
strategy5 = "5 Pings"
strategy6 = "6 Zero Line Cross"
strategyEntry = input.string(strategy1, "Strategy Entry", options=[strategy1, strategy2, strategy3, strategy4, strategy5, strategy6], group=group_strategy)
bool startLongDeal = false
bool startShortDeal = false
bool endLongDeal = false
bool endShortDeal = false
switch strategyEntry
strategy1 =>
if ob_trend_start and longDealsEnabled
startLongDeal := true
else if os_trend_start and shortDealsEnabled
startShortDeal := true
strategy2 =>
if os_trend_start and longDealsEnabled
startLongDeal := true
else if ob_trend_start and shortDealsEnabled
startShortDeal := true
strategy3 =>
if ob_reversal and shortDealsEnabled
startShortDeal := true
else if os_reversal and longDealsEnabled
startLongDeal := true
strategy4 =>
if os_reversal and shortDealsEnabled
startShortDeal := true
else if ob_reversal and longDealsEnabled
startLongDeal := true
strategy5 =>
if cross_bull and longDealsEnabled
startLongDeal := true
else if cross_bear and shortDealsEnabled
startShortDeal := true
strategy6 =>
if zero_long and longDealsEnabled
startLongDeal := true
else if zero_short and shortDealsEnabled
startShortDeal := true
import jason5480/external_input_utils/6 as exiu
float longChannelComp = 10.0 * (startLongDeal ? 2.0 : 0.0)
float shortChannelComp = startShortDeal ? 2.0 : 0.0
float signal = longChannelComp + shortChannelComp
bool startLongDealDec = exiu.eval_cond(signal, '/10==', 2.0)
bool startShortDealDec = exiu.eval_cond(signal, 'mod10==', 2.0)
plot(series = signal, title = '🔌Signal', color = color.olive, display = display.data_window + display.status_line)
showTF = input.bool(true, 'show time frame', inline = '24')
showpf = input.bool(true, 'show prefix', inline = '24')
showchange = input.bool(false, 'show change %', inline = '24')
string i_tableYpos = input.string('top', 'Position', inline = '12', options = ['top', 'middle', 'bottom'])
string i_tableXpos = input.string('right', '', inline = '12', options = ['left', 'center', 'right'])
size1 = input.string('normal', 'title', inline = '14', options = ['tiny', 'small', 'normal', 'large', 'huge', 'auto'])
size3 = input.string('normal', 'change', inline = '14', options = ['tiny', 'small', 'normal', 'large', 'huge', 'auto'])
size2 = input.string('normal', 'signature', inline = '14', options = ['tiny', 'small', 'normal', 'large', 'huge', 'auto'])
color = input.color(color.rgb(255, 255, 255, 12), 'color')
string = input.string('🦍차트고릴라', 'your signature')
seperator = input.string('/', 'seperator')
cahngeClose = request.security(syminfo.tickerid, timeframe.period, close)
cur = syminfo.currency
base = syminfo.basecurrency
exchange = syminfo.prefix
getTimeFrame() =>
tf = timeframe.multiplier
tfstr = ''
if timeframe.isseconds
tfstr := 's'
tfstr
if timeframe.isminutes
if tf >= 60
tf := tf / 60
tfstr := 'h'
tfstr
else
tfstr := 'm'
tfstr
if timeframe.isdaily
tfstr := 'D'
tfstr
if timeframe.isweekly
tfstr := 'W'
tfstr
if timeframe.ismonthly
tfstr := 'M'
tfstr
[tfstr, str.tostring(tf)]
var table table1 = table.new(i_tableYpos + '_' + i_tableXpos, 4, 1)
if barstate.islast
str1 = base != '' ? base + seperator + cur : syminfo.ticker
[tf, period] = getTimeFrame()
change = math.round((cahngeClose[0] / cahngeClose[1] - 1) * 100, 2)
changeStr = ''
if change > 0
changeStr := '▲' + str.tostring(math.abs(change)) + '%'
changeStr
else
changeStr := '▼' + str.tostring(math.abs(change)) + '%'
changeStr
table.cell(table1, 0, 0, showpf ? exchange : '', text_color = color, width = 0, text_size = size2)
table.cell(table1, 1, 0, str1 + (showTF ? ' ' + period + tf : ''), width = 0, text_color = color, text_size = size1)
table.cell(table1, 3, 0, showchange ? changeStr : '', width = 0, text_color = change > 0 ? color.green : color.red, text_size = size3)
table.cell(table1, 2, 0, string, text_color = color, width = 0, text_size = size3)
2025-07-02
685
글번호 192241