커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1496
글번호 230811
답변완료
종목검색식 부탁드립니다.
1. 조건식 A가 있는데
현재가가 조건식 A 보다 낮고, 이전봉 종가가 조건식 A보다 높은 경우를 찾는 조건식이며,
또한 주식의 분봉60분인 경우 갭보정을 한 경우를 찾는 조건식입니다.
항상 감사드립니다.
2023-10-24
1033
글번호 173373
답변완료
문의 드립니다.
// create base on http://www.dailyfx.com/forex_forum/coding-strategy-advisors-indicators-functions/237563-ttm-squeeze-indicator.html
study("TTM Squeeze")
length = input(title="Length", type=integer, defval=20, minval=0)
bband(length, mult) =>
sma(close, length) + mult * stdev(close, length)
keltner(length, mult) =>
ema(close, length) + mult * ema(tr, length)
e1 = (highest(high, length) + lowest(low, length)) / 2 + sma(close, length)
osc = linreg(close - e1 / 2, length, 0)
diff = bband(length, 2) - keltner(length, 1)
osc_color = osc[1] < osc[0] ? osc[0] >= 0 ? #00ffff : #cc00cc : osc[0] >= 0 ? #009b9b : #ff9bff
mid_color = diff >= 0 ? green : red
plot(osc, color=osc_color, style=histogram, linewidth=2)
plot(0, color=mid_color, style=circles, linewidth=3)
트레이딩뷰 지표인데 예스로 좀 변환해주세요.
2023-10-24
1134
글번호 173372
답변완료
문의 드립니다
input : StartTime(150000),EndTime(50000),midtime(210000);
input : 익절틱수1(800),손절틱수1(0);
input : 익절틱수2(160),손절틱수2(0);
var : Tcond(False),entry(0),T(0);
Variables: Mom(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
T = 1;
}
if (sdate != sdate[1] and stime >= midtime) or
(sdate == sdate[1] and stime >= midtime and stime[1] < midtime) Then
{
Tcond = False;
T = 2;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
T = 0;
}
if Tcond == true Then
{
if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 4 Then
ExitShort();
}
if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then
{
Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 4 Then
ExitLong();
if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 4 Then
ExitShort();
if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then
{
Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 4 Then
ExitLong();
if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 4 Then
ExitShort();
if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then
{
Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 4 Then
ExitLong();
if T == 1 Then
{
SetStopProfittarget(PriceScale*익절틱수2,PointStop);
SetStopLoss(PriceScale*손절틱수2,PointStop);
}
Else
{
SetStopProfittarget(PriceScale*익절틱수1,PointStop);
SetStopLoss(PriceScale*손절틱수1,PointStop);
}
익절시 해당 캔들의 다음신호 진입금지의
수식어가 가능한지 문의 드립니다.
2023-10-25
829
글번호 173371
답변완료
수식 부탁드립니다
1. (일) 1봉전 종가대비 0봉전 종가등락률 1% 이상 10% 이하
2. (일) 1봉전 종가대비 0봉전 시가등락률 5% 이하
3. (일) 2봉전 종가대비 1봉전 종가등락률 10% 이하
세가지 부탁드립니다.
2023-10-24
941
글번호 173370
답변완료
전환추세 거래량
Input : 전환(0.5);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL(0),TX(0),TX2(0),T(0);
Array:고[10,4](0),저[10,4](0);
HH = H;
LL = L;
If Index == 0 Then
{
고[1,1] = HH;
고[1,2] = 0;
고[1,3] = sDate;
고[1,4] = sTime;
저[1,1] = LL;
저[1,2] = 0;
저[1,3] = sDate;
저[1,4] = sTime;
}
If Index > 0 Then
{
hiBar = hiBar + 1;
loBar = loBar + 1;
}
If HH[hiBar] < HH Then hiBar = 0;
If LL[loBar] > LL Then loBar = 0;
Condition1 = 저[1,1]+전환 <= HH and hiBar == 0;
Condition2 = 고[1,1]-전환 >= LL and loBar == 0;
처리구분 = "";
If Condition1 and Condition2 Then
{
If 최종꼭지점 == "저점" Then
{
If 저[1,1] > LL Then 처리구분 = "저점처리";
Else 처리구분 = "고점처리";
}
Else If 최종꼭지점 == "고점" Then
{
If 고[1,1] < HH Then 처리구분 = "고점처리";
Else 처리구분 = "저점처리";
}
}
Else If Condition1 Then 처리구분 = "고점처리";
Else If Condition2 Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
If 최종꼭지점 == "저점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
고[j,jj] = 고[j-1,jj];
}
}
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
TL = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]);
TL_SetSize(TL,2);
TL_SetColor(TL,RED);
T = 1;
}
Else If 고[1,1] < HH[hiBar] Then
{
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
TL_SetEnd(TL,고[1,3],고[1,4],고[1,1]);
Text_SetString(TX,NumToStr(고[1,1]-저[1,1],2));
Text_SetLocation(TX,고[1,3],고[1,4],고[1,1]);
}
최종꼭지점 = "고점";
if MarketPosition >= 0 and T == 1 and 고[1,1] >= 저[1,1]+1 and V > 500 and V >= V[1]*2.5 Then
{
T = 2;
Sell();
}
}
If 처리구분 == "저점처리" Then
{
If 최종꼭지점 == "고점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
저[j,jj] = 저[j-1,jj];
}
}
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
TL = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
TL_SetSize(TL,2);
TL_SetColor(TL,BLUE);
T = -1;
}
Else If 저[1,1] > LL[loBar] Then
{
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
TL_SetEnd(TL,저[1,3],저[1,4],저[1,1]);
Text_SetString(TX,NumToStr(고[1,1]-저[1,1],2));
Text_SetLocation(TX,저[1,3],저[1,4],저[1,1]);
}
최종꼭지점 = "저점";
if MarketPosition <= 0 and T == -1 and 저[1,1] <= 고[1,1]-1 and V > 500 and V >= V[1]*2.5 Then
{
T = -2;
Buy();
}
}
if MarketPosition == 1 and BarsSinceEntry == 1 Then
ExitLong();
if MarketPosition == -1 and BarsSinceEntry == 1 Then
ExitShort();
84235 재문의
한 추세선에 한번만 나오는 매매 신호를 조건이 맞으면 모두 나오게 부탁드립니다.
2023-10-24
1013
글번호 173369
답변완료
수식 부탁드립니다.
1.상한가가 60일이상 없다가 신규 상한가가 발생된 이후 5봉이내에 발생된 첫 음봉 종목
검색수식.즉 음봉이 발생되고, 그 이전 5봉이내에 음봉이 없고 상한가가 1회있어야 한다는
조건임. 단 상한가의 거래량보다 첫 음봉의 거래량이 적어야 한다.
2. 1번조건을 만족하는 종목중에서 음봉발생이후 3봉이내에 첫 음봉의 저가보다 낮은 저가가
처음으로 발생된 캔들이 발생하는 종목 검색수식(양음봉은 따지지않고 첫음봉의 저가보다
낮은 저가가 처음발생되는 종목 검색수식
위 조건을 만족하는 종목검색수식(신호수식)을 부탁드립니다
2023-10-24
799
글번호 173368
답변완료
문의 드립니다.
1분봉 차트에 money flow index 차트를 적용 시켰습니다.
기본 수치 14로 하면 트레이딩뷰 차트와 예스 차트에서는 모양이 동일합니다.
그런데 수치를 7로 바꿔주면 예스와 트레이딩뷰 차트 모양이 다르게 나옵니다.
수치를 바꿔을때도 트레이딩뷰와 동일하게 나오게 해주세요.
알람 수식등은 빼고 money flow index 수식만 바꿔주세요.
트레이딩뷰 수식입니다.
//@version=3
study("Money Flow Index MTF + Alerts", overlay = false)
////////////////////////////
// This study is based on the work of TV user Beasley Savage (https://www.tradingview.com/스크립트/g58H59ub-Money-Flow-Index-Beasley-Savage/)
// and all credit goes to them.
//
// Changes I've made:
//
// 1. Added a visual symbol of an overbought/oversold threshold cross in the form of a red/green circle, respectively.
// Sometimes it can be hard to see when a cross actually occurs, and if your scaling isn't set up properly you can get
// misleading visuals. This way removes all doubt. Bear in mind they aren't meant as trading signals, so DO NOT use them as such.
// Research the MFI if you're unsure, but I use them as an early warning and that particular market/stock is added to my watchlist.
//
// 2. Added 60/40 lines as the MFI respects these incredibly well in trends. E.g. in a solid uptrend the MFI won't go below 40,
// and vice versa. Use the idea of support and resistance levels on the indicator and it'll be a great help.
// I've coloured the zones. Strong uptrends should stay above 60, strong downtrends should stay below
// 40. The zone in between 40-60 I've called the transition zone. MFI often stays here in consolidation periods, and
// in the last leg of a cycle/trend the MFI will often 드롭 into this zone after being above 60 or below 40. This is a great
// sign that you should get out and start looking to reverse your position. Hopefully it helps to spot divergences as well.
//
// 3. Added alerts based on an overbought/oversold cross. Also added an alert for when either condition is triggered, so hopefully
// that's useful for those struggling with low alert limits. Feel free to change the overbought/oversold levels, the alerts +
// crossover visual are set to adapt.
//
// Any queries please comment or PM me.
//
// Cheers,
// RJR
//
////////////////////////////
// Version control
// ========================
// 1.0
// Initial Release
// 1.1
// Added support for multiple time frames
// Cleaned up code
// 1.1.1
// Minor error fix
////////////////////////////
//Inputs
length = input(title="Length", defval=14)
os = input(20, title="Oversold")
ob = input(80, title="Overbought")
CurrentRes = input(true, title="Use Current Chart Resolution?")
CustomRes = input("240", title="Custom Timeframe? Uncheck Box Above (E.g. 1M, 5D, 240 = 4Hours)")
//MFI Calc
res = CurrentRes ? period : CustomRes
rawMoneyFlow = hlc3 * volume
positiveMoneyFlow() =>
a = 0.0
a := hlc3 > hlc3[1] ? a + rawMoneyFlow : a
negativeMoneyFlow() =>
b = 0.0
b := hlc3 < hlc3[1] ? b + rawMoneyFlow : b
moneyFlowRatio = sma(positiveMoneyFlow(), length) / sma(negativeMoneyFlow(), length)
moneyFlowIndex = security(tickerid, res, 100 - 100 / (1 + moneyFlowRatio))
//OB/OS Identification
oversold = moneyFlowIndex[1] > os[1] and moneyFlowIndex < os
overbought = moneyFlowIndex[1] < ob[1] and moneyFlowIndex > ob
//Plotting
col = oversold ? green : red
plot(moneyFlowIndex, color=black, linewidth=2)
plot(oversold ? moneyFlowIndex : overbought ? moneyFlowIndex : na, title="Oversold/Overbought Cross", color=col, style=circles, linewidth=6)
h1 = hline(80, "Overbought")
h2 = hline(20, "Oversold")
h3 = hline(40, "Bears")
h4 = hline(60, "Bulls")
fill(h4, h1, color=green, title="Uptrend")
fill(h3, h2, color=red, title="Downtrend")
fill (h3, h4, color=gray, title="Transition Zone")
//Alerts
alert = oversold or overbought
alertcondition(oversold, title="MFI Oversold", message="MFI Crossed Oversold" )
alertcondition(overbought, title="MFI Overbought", message="MFI Crossed Overbought" )
alertcondition(alert, title="MFI Alert Both", message="MFI Alert Generated OB/OS" )
2023-10-24
1644
글번호 173367
답변완료
함수요청
안녕하세요?
아래 전략에 대해 스크립트 작성 부탁드립니다.
국내선물 분봉으로 포지션 거래를 하고자 합니다.
저점대비 3포인트 상승 봉완성시 익봉시가 매수 진입
고점대비 3포인트 하락 봉완성시 익봉시가 매도 진입
(캔틀의 머리와 꼬리를 떼고 몸통으로만 계산합니다.)
0.5포인트 손절
고점과 저점은 현재가격 기준입니다.
현재의 가격이 과거 가격대비 3포인트 움직였냐? 여부로 판독하고자 합니다.
2023-10-24
829
글번호 173363
답변완료
당일저가 시간대
당일저가 시간대가 9시~10시59분 까지를 1
11시~12시59분 까지를 2
13시~장마감 까지를 3 으로 하는 수식
위 수식의 결과가 1이 나올때 n일 동안의 총합을 나타내는 수식
부탁드립니다
2023-10-24
896
글번호 173362