커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1531
글번호 230811
답변완료
문의 드립니다.
1.
input : StartTime(190000),EndTime(30000),진입횟수(0);
input : 익절틱수(850),손절틱수(60);
Input:Length(1),Pval(0.01);
var : Tcond(False),entry(0);
Variables: Mom(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
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;
entry = 0;
Xcond = false;
N1 = NetProfit;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 or daypl <= -당일손실 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true ) then
Xcond = true;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Buy("CBI_LE",AtStop,Highest(High,Length)+Pval);
ExitLong("CBI_SE",AtStop,Lowest(High,Length)+Pval);
if MarketPosition < 1 then
{
ExitLong("dbp",atStop,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2.
input : StartTime(190000),EndTime(30000),진입횟수(0);
input : 익절틱수(850),손절틱수(60);
Input:Length(1),Pval(0.01);
var : Tcond(False),entry(0);
Variables: Mom(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
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;
entry = 0;
Xcond = false;
N1 = NetProfit;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 or daypl <= -당일손실 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true ) then
Xcond = true;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
ExitShort("CBI_LE",AtStop,Highest(High,Length)-Pval);
Sell("CBI_SE",AtStop,Lowest(Low,Length)-Pval);
if MarketPosition < 1 then
{
ExitShort("dbp",AtStop,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
질의를 드렸던 내용인데요.
매수는 앞 캔들의 고가를 0.01 이상일때 진입신호로 되어있습니다.
매도는 앞 캔들의 저가를 0.01 이상일때 진입신호로 되어있습니다.
아래로 수정을 부탁드립니다.
매수는 앞 캔들의 종가를 0.01 이상일때 진입신호로 수정을 부탁드립니다.
매도는 앞 캔들의 종가를 0.01 이하일때 진입신호로 수정을 부탁드립니다.
미리 감사드립니다.
2023-09-11
1143
글번호 172359
답변완료
문의 드립니다.
//@version=3
study(title="Money Flow Index")
// Typical price = (high price + low price + closing price) / 3
// Raw money flow = typical price x volume
// Money flow ratio = (14-day Positive Money Flow) / (14-day Negative Money Flow)
// Positive money flow is calculated by summing up all of the money flow on the days in the period
// where the typical price is higher than the previous typical price. This same logic applies for the negative money flow.
// MFI = 100 - 100 / (1 + money flow ratio)
length = input(title="Period Length", type=integer, defval=10, minval=1)
show_value = input(title="Show which value", type=string, options=["Raw Money Flow", "Money Flow Ratio", "Money Flow Index"], defval="Money Flow Index")
show_raw = (show_value == "Raw Money Flow")
show_ratio = (show_value == "Money Flow Ratio")
show_index = (show_value == "Money Flow Index")
show_sma = input(title="Show MFI SMA", type=bool, defval=true)
avg_len = input(title="SMA Length", type=integer, defval=5, minval=1)
mfi_high = 80
mfi_mid = 50
mfi_low = 20
prc = avg(high, low, close)
raw = prc * volume
pos_day = (prc[0] >= prc[1]) ? raw : 0
neg_day = (prc[0] <= prc[1]) ? raw : 0
pos_period = sum(pos_day, length)
neg_period = sum(neg_day, length)
mf_ratio = (pos_period / neg_period)
mf_index = 100 - (100 / (1 + mf_ratio))
mfi_sma = sma(mf_index, avg_len)
plot(show_raw ? pos_period : na, "Positive Flow", green, linewidth=2, transp=0)
plot(show_raw ? neg_period : na, "Negative Flow", red, linewidth=2, transp=0)
plot(show_ratio ? mf_ratio : na, "Money Flow Ratio", black, linewidth=2, transp=0)
plot(show_index ? mf_index : na, "Money Flow Index", blue, linewidth=2, transp=0)
plot(show_index and show_sma ? mfi_sma : na, "Money Flow SMA", gray, linewidth=1, transp=0)
plot(show_index ? mfi_high : na, "High Line", green)
plot(show_index ? mfi_mid : na, "Mid Line", silver)
plot(show_index ? mfi_low : na, "Low Line", red)
트레이딩뷰 수식인데 위 수식에서 Money Flow Index선과 시그널선
그리고 기준선만 예스로 좀 바꿔주세요.
2023-09-11
1482
글번호 172347
답변완료
수식오류수정 부탁드립니다
당일 두번째 진입(b2)부터는 직전 청산후 5봉 경과후 진입식 입니다.그런데 어떤날은
첫번째 진입인 데도 두번째이후 진입명인 b2가 표시가 됩니다. 어떤 표현이 잘못된건지
수정 부탁드립니다.
input : left(5),right(5),ln(3),dn(12),ts(30),loss(20),scl(3),LAT(5);
var : ii(0),entry(0),T1(0);
if Bdate != Bdate[1] Then{
T1 = TotalTrades;
}
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = TotalTrades-T1+1;//당일 진입 3회까지만
if bdate != Bdate[1] Then
{
var1 = 0;
ii = 0;
}
ii = ii +1;
if ii >= 11 and Swinglow(1,L,5,5,11) != -1 Then
{
var2 =L[5];
}
if date != date[1] then{
var3 = 0;// 당일 첫번째 진입
}
if MarketPosition==0 and NextBarSdate == sDate AND Var3<1 and var2>0 and entry< 3 Then//var3<1 당일 첫번째진입은
{
Buy("b1",AtLimit,var2+PriceScale*scl);//첫번째 진입은 b1
var3=1;
}
if MarketPosition==0 and BarsSinceExit(1)>5 and NextBarSdate == sDate and var2>0 and entry< 3 Then// 당일 두 번재 진입부터는 직전 청산후 5봉 경과후 진입
{
Buy("b2",AtLimit,var2+PriceScale*scl);//2번째봉부터는 청산후 5본 경과
}
SetStopLoss(LOSS,PercentStop);
SetStopTrailing(dn,ts,PercentStop,1);
SetStopEndofday(151500);
2023-09-11
1009
글번호 172345
답변완료
어제까지 42일평균값
안녕하세요? 종목검색식 부탁드려요
오늘의종가(주가의 현재값)이 어제까지 42일동안의 평균값을 돌파하는 검색식부탁드려요
어제까지 20일동안 주가의 종가의 위치는 일목기준선의 42일선 밑에 주가가 위치해 있어야합니다
감사합니다
2023-09-11
890
글번호 172344
답변완료
수식 부탁드립니다.
RSI의 기준선을 하향이탈하거나 상향돌파할시의 라인설정과 그 라인 돌파하는 수식 신호수식을 의뢰합니다
A=RSI(14);
B=CrossDown(A,23);
BB=Valuewhen(1,B,(O+C)/2);
D=CrossUp(A,25);
DD=Valuewhen(1,D,(O+C)/2)
1. 매수신호1
가. BB가 3번이상 하락변동하고, 하락한 마지막 BB라인을 시가종가로 상향돌파할 때
나. DD가 3번이상 하락변동하고, 하락한 마지막 DD라인을 시가종가로 상향돌파할 때
- 가 또는 나의 조건이 만족할 때의 매수신호수식
여기서 하락이라 함은 BB나 DD라인을 지표수식으로 표시해보면 계단식으로 변화가
있는데 이 변화가 계단식 하락으로 연속 세번이상 변화가 있을 때를 말함.
단 하락하다가 상승변화가 있으면 카운팅은 다시 계산되어야 한다
2. 매수신호2
BB가 하락한 것이 5봉이내에 발생한 적이 있으면서 DD가 하락발생하고, 하락변동한
DD라인을 시가종가로 돌파할 경우의 신호수식
시가종가돌파 한다는 것은 O<DD && C>DD 인 경우임, CrossUp이 아님
보통 BB나 DD가 하락시에, 그봉에서 양봉이 나오는 경우가 많은데 이봉의 중심가를
시종가로 돌파하는 경우도 포함되어야 한다.
3. 위의 경우와 별개의 질문입니다
A=AVG(C,20):
A라인의 후행라인 설정시에는 A[-10], 선행라인 설정시에는 A[10]으로 하면 되는데
선행시킨 A[10] 이평선의 추세를 표현하고자 한다면 어떤 수식으로 해야하나요?
예를들어 선행시킨 라인의 하향추세를 표현하기 위해 A[10][1] > A[10] 로 하니까
수식오류라고 나와서 어케해야하는지 알려주세요.
2023-09-11
827
글번호 172337
심홍 님에 의해서 삭제되었습니다.
2023-09-11
18
글번호 172331
찬돌 님에 의해서 삭제되었습니다.
2023-09-11
21
글번호 172330
답변완료
수식문의
안녕하세요
항상 감사드립니다
문의1) 아래수식으로 검색된 종목이 재검색시에도 유지될 수 있도록 검토 부탁립니다.
Input : Change(240);#240일
Input : Mult1(1.03),Mult2(0.5),DV(100000);
Array : HD[10](0),HT[10](0),HV[10](0),HI[10](0);
Array : LD[10](0),LT[10](0),LV[10](0),LI[10](0);
Var : Cnt(0),Hprice(0),Lprice(0);
Var : UpTrend(false),DownTrend(False),Trend(0);
Var : ZigZagTL(0);
HPrice = H;
LPrice = L;
if Index == 0 Then
{
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
HI[0] = Index;
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
LI[0] = Index;
}
Else
{
UpTrend = HPrice >= Highest(HPrice,Change)[1];
DownTrend = LPrice <= Lowest(LPrice,Change)[1];
if Trend <= 0 and UpTrend == true Then
{
Trend = 1;
For cnt = 9 DownTo 1
{
HD[cnt] = HD[cnt-1];
HT[cnt] = HT[cnt-1];
HV[cnt] = HV[cnt-1];
HI[cnt] = HI[cnt-1];
}
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
HI[0] = Index;
var1 = (HV[0]-LV[0])/(HI[0]-LI[0]);
Var2 = HV[0];
}
Else if Trend >= 0 and DownTrend Then//하락추세 전환
{
Trend = -1;
For cnt = 9 DownTo 1
{
LD[cnt] = LD[cnt-1];
LT[cnt] = LT[cnt-1];
LV[cnt] = LV[cnt-1];
LI[cnt] = LI[cnt-1];
}
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
LI[0] = Index;
}
Else
{
if Trend == 1 Then
{
if HPrice > HV[0] Then
{
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
HI[0] = Index;
var1 = (HV[0]-LV[0])/(HI[0]-LI[0]);
Var2 = HV[0];
}
Else
Var2 = Var2+var1;
if Condition1 == False and C > Var2[1] and Var2[1] > L Then
{
Condition1 = true;
if C > DayOpen and C >= DayClose(1)*Mult1 and
DayVolume(0) >= DV and DayVolume(0)>DayVolume(1)*mult2 and
Asks > Bids Then
Find(1);
}
}
if Trend == -1 Then
{
if LPrice < LV[0] Then
{
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
LI[0] = Index;
}
}
}
}
2023-09-11
852
글번호 172324
꿀떡 님에 의해서 삭제되었습니다.
2023-09-11
3
글번호 172321