커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3428
글번호 230811
답변완료
부탁드립니다.
$,보내주신수식 감사합니다,
#,66851에서 2번질문에
1,현재봉고가 > 이전음봉고가
현재봉저가 < 이전음봉저가 일때의 조건을 기본으로하고
현재봉의 시가가 이전음봉의 시가보다 3틱이상 크고 현재봉의종가가 이전음봉의
종가보다 3틱이상 작을때 두 조건만족시에 현재봉 완성시 현재봉고가,저가라인
을 표시합니다.
1-1,현재봉고가 > 이전양봉고가
현재봉저가 < 이전양봉저가 일때의 조건을 기본으로하고
현재봉의 시가가 이전양봉의 시가보다 3틱이상 크고 현재봉의종가가 이전양봉의
종가보다 3틱이상 작을때 두 조건만족시에 현재봉 완성시 현재봉고가,저가라인
을 표시합니다.
3번질문에
2,현재봉고가 < 이전음봉고가
현재봉저가 > 이전음봉저가 일때의 조건을 기본으로하고
현재봉의 시가가 이전음봉의 시가보다 3틱이상 작고 현재봉의종가가 이전음봉의
종가보다 3틱이상 클때 두 조건만족시에 현재봉 완성시 현재봉고가,저가라인
을 표시합니다.
2-1,현재봉고가 < 이전양봉고가
현재봉저가 > 이전양봉저가 일때의 조건을 기본으로하고
현재봉의 시가가 이전양봉의 시가보다 3틱이상 작고 현재봉의종가가 이전양봉의
종가보다 3틱이상 클때 두 조건만족시에 현재봉 완성시 현재봉고가,저가라인
을 표시합니다.
위 두가지 기본조건만족을 추가해서 작성부탁드립니다
$,미리 감사드립니다.
2020-04-07
723
글번호 137620
답변완료
키움수식을 변환하고싶어요
a=highest(high,40);
aa=valuewhen(1,a,h);
mm=ma(c,5);
k=a(1)==aa(1) && a(2)==aa(2) && !(a==aa);
kk=k(1) && c>c(1) && c>o(1) && c>mm;
kkk=k(2) && c>c(2) && c>o(2) && c>mm;
n=kk or kkk;
n && c>mm
위와같이 키움증권에서valuewhen 수식이있을때
예스트레이드에서 종목을 검색할려고하는데
변환을 어떻게해야하는지 궁금합니다
2020-04-04
787
글번호 137611
답변완료
수식적용
input : P1(50),P2(120),af(0.02),maxaf(0.2);
var1 = ema(C,P1);
var2 = ema(c,P1);
var3 = sar(af,maxaf);
if MarketPosition >= 0 and var1 < var2 and CrossDown(c,var3) Then
sell();
if MarketPosition == -1 and crossup(c,var3) Then
ExitShort();
if MarketPosition <= 0 and var1 > var2 and CrossUp(c,var3) Then
Buy();
if MarketPosition == 1 and CrossDown(c,var3) Then
ExitLong();
제가 문의드린 수식에 답을 지금 적용 시켰더니
전략실행차트에서는 아무것도 나타나지 않고
시뮬레이션차트에서도 그래프가 0 으로만 나옵니다ㅜㅜ
왜 그런걸까요? ㅜㅜ
2020-04-04
646
글번호 137610
답변완료
수식 작성 부탁드립니다!
시가 매수후
시가에서 -5%까지 -1%하락할때마다 1주씩 매수
-6% ~ -10%까지 -1%하락할때마다 2주씩 매수
부탁드립니다.
2020-04-06
668
글번호 137608
답변완료
문의드립니다
Input:length(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),
TL_Val1(0),TL_Val2(0);
Var:TL11(0),TL12(0),TL13(0),TL14(0),TL15(0),TL16(0),TL17(0),TL18(0),TL19(0),TL20(0);
Var:TL21(0),TL22(0),TL23(0),TL24(0),TL25(0),TL26(0),TL27(0),TL28(0),TL29(0),TL30(0),mav(0),T(0);
Array:고점[10,2](0),저점[10,2](0);
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then
{ If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
TL_Delete(TL1);
TL_Delete(TL2);
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
Text_Delete(Text1);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1]and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL2 = TL_New(sDate[eBar+1],sTime[eBar+1],고점[1,1]+ PriceScale*1,sDate[eBar],sTime[eBar],고점[1,1]+PriceScale*1);
TL_SetExtRight(Tl2,true);
TL_SetColor(Tl2,LGREEN);
TL_SetSize(TL2,2);
TL_SetColor(TL1,BLACK);
TL_SetSize(TL1,0);
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
If 처리구분 == "저점처리" Then
{
lastLoVal = L;
If 저점[1,2] < 고점[1,2] Then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
TL_Delete(TL1);
TL_Delete(TL2);
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
Text_Delete(Text1);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TL2 = TL_New(sDate[eBar+1],sTime[eBar+1],저점[1,1]- PriceScale*1,sDate[eBar],sTime[eBar],저점[1,1]-PriceScale*1);
TL_SetExtRight(Tl2,true);
TL_SetColor(Tl2,YELLOW);
TL_SetSize(TL2,2);
TL_SetColor(TL1,BLACK);
TL_SetSize(TL1,0);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
mav = ma(C,20);
위수식에서 틱수를 고점봉의50프로 저점봉의 50프로 로 하고십습니다 ,부탁드립니다.
2020-04-06
580
글번호 137600
답변완료
일목균형표
수고하십니다
일목균형표의 구름대 내부에 채워진 색을 바꾸고 싶습니다
양운과 음운의 색이 봉챠트의 색과 비슷해서 구름대 안에서는 봉챠트가 잘 보이지 않습니다
1. 색을 바꾸거나
2. 색을 없애거나 입니다
감사합니다
2020-04-06
511
글번호 137597
답변완료
문의드립니다.
//@version=4
study(BB MACD)
inp_Source = input(title = "Source", type = input.source, defval = close)
inp_Sensitivity = input(title = "Sensitivity", type = input.float, defval = 0.01)
inp_HiLo_Lookback = input(title = "Hi/Lo Lookback", type = input.integer, defval = 5)
inp_Slow_MA_Period = input(title = "Slow MA: Period", type = input.integer, defval = 26)
inp_Slow_MA_Method = input(title = "Slow MA: Type", defval = 'EMA', options = ['SMA', 'EMA', 'LWMA', 'RMA'])
inp_Fast_MA_Period = input(title = "Fast MA: Period", type = input.integer, defval = 12)
inp_Fast_MA_Method = input(title = "Fast MA: Type", defval = 'EMA', options = ['SMA', 'EMA', 'LWMA', 'RMA'])
inp_Signal_MA_Period = input(title = "Signal MA: Period", type = input.integer, defval = 9)
inp_Signal_MA_Method = input(title = "Signal MA: Type", defval = 'SMA', options = ['SMA', 'EMA', 'WMA', 'RMA'])
f_Get_MA(MA_Type, MA_Source, MA_Period) =>
MA = 0.0
MA := MA_Type == 'SMA' ? sma(MA_Source, MA_Period) : MA_Type == 'EMA' ? ema(MA_Source, MA_Period) : MA_Type == 'WMA' ? wma(MA_Source, MA_Period) : MA_Type == 'RMA' ? rma(MA_Source, MA_Period) : na
MA
f_Get_Std_Dev(MA_Type, MA_Source, MA_Period) =>
MA = 0.0
MA := f_Get_MA(MA_Type, MA_Source, MA_Period)
Price = 0.0
Price := sma(MA_Source, 1)
Summation = 0.0
for i = 0 to MA_Period - 1
Summation := Summation + (Price[i] - MA) * (Price[i] - MA)
Std_Dev = 0.0
Std_Dev := sqrt(Summation / MA_Period)
Std_Dev
f_Get_TR() =>
TR = max(high, close[1]) - min(low, close[1])
TR
f_Get_ATR(Period) =>
TR = f_Get_TR()
Summation = 0.0
for i = 1 to Period
Summation := Summation + TR[i]
ATR = 0.0
ATR := Summation / Period
ATR
MA_Fast = f_Get_MA(inp_Fast_MA_Method, inp_Source, inp_Fast_MA_Period)
HiLo_Range = abs(barssince(high == highest(high, inp_HiLo_Lookback)) - barssince(low == lowest(low, inp_HiLo_Lookback))) * syminfo.mintick * 100000
MA_Slow = f_Get_MA(inp_Slow_MA_Method, inp_Source, inp_Slow_MA_Period)
MA_Slow_Deviation = f_Get_Std_Dev(inp_Slow_MA_Method, inp_Source, inp_Slow_MA_Period)
MA_Slow_ATR = f_Get_ATR(inp_Slow_MA_Period)
Histogrm = MA_Slow_Deviation - MA_Slow_ATR
Main_Line = Histogrm
Signal_Line = f_Get_MA(inp_Signal_MA_Method, Main_Line, inp_Signal_MA_Period)
Histogrm_Color = color.green
if MA_Fast >= MA_Fast[1]
if HiLo_Range >= inp_Sensitivity
Histogrm_Color := color.green
else
Histogrm_Color := color.yellow
else
if HiLo_Range >= inp_Sensitivity
Histogrm_Color := color.red
else
Histogrm_Color := color.blue
plot(Histogrm, title = "BB MACD", color = Histogrm_Color, style = plot.style_histogram)
plot(Histogrm, title = "BB MACD", color = color.blue, style = plot.style_line)
--------------------------------------------------------------------
Slow MA, Fast MA Method에서 type은 EMA로,
Signal MA Method에서 type은 SMA로 부탁드립니다.
그리고
f_Get_MA(MA_Type, MA_Source, MA_Period) =>
MA = 0.0
MA := MA_Type == 'SMA' ? sma(MA_Source, MA_Period) : MA_Type == 'EMA' ? ema(MA_Source, MA_Period) : MA_Type == 'WMA' ? wma(MA_Source, MA_Period) : MA_Type == 'RMA' ? rma(MA_Source, MA_Period) : na
MA
에서 SMA와 EMA만 남겨주실수 있을지
수식에서 적용되는 MA가 SMA와 EMA만 적용될 수 있었으면 좋겠습니다.
항상 감사합니다.
2020-04-06
584
글번호 137586
답변완료
함수 검증 요청
안녕하세요?
글번호 66778번 재질문 드립니다.
eFriend Global YESTRADER에서 #3010 전략실행차트로 적용해보면
금일에
(7시) 시초가
data1: 다우 20944
data2: 나스닥 7535.75
data3: 에스앤피 2485 입니다.
(7시 5분 완성봉)
data1: 다우 21219
data2: 나스닥 7631.50
data3: 에스앤피 2515.25 입니다.
7시 5분 완성봉, 즉 7시 10분 완성봉 시가(7시 6분이추 첫 데이터)에 매수 신호가 발생되어야 하나 신호가 생성되지 않았습니다.
작성주신 스크립트 작성 요청드립니다.
----------------------------------------------------------------------------------------
input : StartTime(70000),EndTime(033000);
var : Tcond(false,data1),entry(0,data1);
var : O1(0,data1),O2(0,data2),O3(0,data3);
if data1((sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime)) Then
{
Tcond = true;
entry = 0;
}
if data1((sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime)) Then
Tcond = False;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if data1(bdate != bdate[1]) Then
O1 = data1(O);
if data2(bdate != bdate[1]) Then
O2 = data2(O);
if data3(bdate != bdate[1]) Then
O3 = data3(O);
if tcond == true and entry < 10 then
{
if data1(C>O1) and data2(C>O2) and data3(C>O3) Then
buy("b",AtMarket);
if data1(C<O1) and data2(C<O2) and data3(C<O3) Then
sell("s",AtMarket);
}
if data1(sdate != sdate[1]) Then
SetStopEndofday(EndTime);
if data1(bdate != bdate[1]) Then
SetStopEndofday(0);
즐거운 하루되세요
> 흰둥이아빠 님이 쓴 글입니다.
> 제목 : 함수요청
> 안녕하세요?
아래 전략에 대해 스크립트 작성 요청드립니다.
data1: 다우 5분봉
data2: 나스닥 5분봉
data3: 에스앤피 5분봉
7시(써머타임해지시 8시) 개장 이후 당일 셋다 양봉 발생시(7시 시초가 대비로 현재가 크냐 작냐로 계산) 완성 익봉 시가에 매도 진입
7시(써머타임해지시 8시) 개장 이후 당일 셋다 양봉 발생시(7시 시초가 대비로 현재가 크냐 작냐로 계산) 완성 익봉 시가에 매도 진입
거래시간은 7시부터 익일 03시 30분까지 하고자 하며 (03시 30분에 강제청산)
영업일이 달라지면 다시 7시부터 양봉과 음봉을 따져서 거래를 신규 거래를 하고자 합니다.
진입횟수는 당일기준 10회로 제한하고자 합니다.
2020-04-06
553
글번호 137582
백두에서한라 님에 의해서 삭제되었습니다.
2020-04-06
23
글번호 137576