커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
7199
글번호 230811
답변완료
문의 드립니다
안녕하세요
1.양봉양봉 완성시 두번째 양봉시가에 수평선과 지수을 표시하고
2.음봉음봉 온성시 두번째 음봉시가에 수평선과 지수을 표시하고자 합니다
부탁드립니다
감사합니다
2019-05-27
255
글번호 128991
답변완료
문의
당일 바닥에서 17번째 캔들 고가를 표시하는 수식
당일 바닥에서 13번째 양봉 고가를 표시하는 수식
2019-05-27
232
글번호 128990
답변완료
문의
안녕하세요
주식종목은 선물처럼 틱차트을길게볼수없을까요?
2019-05-27
226
글번호 128989
답변완료
수식 부탁드려요(RSI)
매수조건
가격 >200일선 & 가격 < 5일 이평선 + RSI(2) < 5
매도 조건
가격 > 5일 이평선
해당 수식 부탁드려요~~
2019-05-27
257
글번호 128988
답변완료
사용하고 있는 수식에서 전일 상승(하락)관련 인자를 반영하고 싶습니다.
아래 수식을 사용하고 있는데 여기에 다음 기능을 반영하고 싶습니다.
(참고 아래수식은 해외선물,30분봉기준입니다.)
1. 전일(일봉기준) 5% 상승시 매도진입만 활성화 (매수진입은 조건도달시에도 비활성화)
전일(일봉기준) -10%하락시 매수진입만 활성화 ( 매도진입은 조건도달시에도 비활성화)
-------------------------
Input : af(0.02), maxAF(0.2);
Input : P1(15000),P2(37000);
Input : Period(20), Percent1(0.7),Percent2(0.7);
Input : 음봉틱수1(1),음봉틱수2(3);
Input : 청산양봉틱수1(3),청산양봉틱수2(8);
Input : M1(2),M2(0);
input : 즉시익절1(395),즉시손절1(170),봉완성손절1(65);
input : 즉시익절2(60),즉시손절2(60),봉완성손절2(55);
Var : S1(0,data1),S2(0,data2); # 30분봉:S1 30분봉:S2
var : center(0,data1),UPline(0,data1),DNline(0,data1); # 엔벨로프
var : T(0,data1);
center = data1(ma(C, Period));
UPline = data1(EnvelopeUp(Period, Percent1));
Dnline = data1(EnvelopeDown(Period, Percent2));
S1 = data1(CSar(af,maxAF));
S2 = data2(CSar(af,maxAF));
if data1(crossup(c,S1)) Then
T = 1;
if data1(CrossDown(c,S1)) Then
T = -1;
if T == 1 and data1(C>upline and V >= P1 and c > dayopen) and data2(C > S2) Then
{
T = 3;
buy("매수",AtLimit,C-PriceScale*음봉틱수1);
}
if T == -1 and data1(C<dnline and V >= P2 and c < dayopen ) and data2(C < S2) Then
{
T = -3;
sell("매도",AtLimit,C+PriceScale*음봉틱수2);
}
if MarketPosition == 1 then
{
ExitLong("즉시익절1",AtLimit,EntryPrice+PriceScale*즉시익절1);
if BarsSinceEntry >= M1 and c[1]>c[2] Then
ExitLong("봉완성익절1",AtLimit,C+PriceScale*청산양봉틱수1);
ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1);
if c <= EntryPrice-PriceScale*봉완성손절1 Then
ExitLong("봉완성손절1");
}
if MarketPosition == -1 then
{
ExitShort("즉시익절2",AtLimit,EntryPrice-PriceScale*즉시익절2);
if BarsSinceEntry >= M2 and c[1]<c[2] Then
ExitShort("봉완성익절2",AtLimit,C-PriceScale*청산양봉틱수2);
ExitShort("즉시손절2",AtStop,EntryPrice+PriceScale*즉시손절2);
if c >= EntryPrice+PriceScale*봉완성손절2 Then
ExitShort("봉완성손절2");
}
if bdate != bdate[1] Then
SetStopEndofday(0);
if sdate != sdate[1] and DayOfWeek(sdate) == 6 Then
SetStopEndofday(050000);
2019-05-27
272
글번호 128987
답변완료
어디가 문제인지 봐주시면 감사하겠습니다.
Inputs: FastLength(1), SlowLength(30), ADXLength(12),npoint(1);
Variables: MP(0), Fast(0), Slow(0), GoLong(False), GoShort(False), BuyStop(0), SellStop(0),
ADXValue(0), Trending(False), TLen_F(0), TLen_S(0), TriAverage_F(0), TriAverage_S(0);
MP = MarketPosition;
TLen_F = Ceiling((FastLength + 1) * 0.5);
TRIAverage_F = ma(ma(C, TLen_F), TLen_F);
TLen_S = Ceiling((SlowLength + 1) * 0.5);
TRIAverage_S = ma(ma(C, TLen_S), TLen_S);
Fast = TRIAverage_F;
Slow = TRIAverage_S;
ADXValue = ADX(ADXLength);
Trending = ADXValue > ADXValue[FastLength];
GoLong = Fast > Slow;
GoShort = Fast < Slow;
If CrossUp( Fast , Slow) Then
BuyStop = High + npoint ;
If CrossDown( Fast , Slow) Then
SellStop = Low - npoint ;
If GoLong AND MP == 0 Then
Buy ("Long", atstop,BuyStop) ;
If GoShort AND MP == 0 Then
Sell ("Short", atstop,SellStop) ;
If MP == 1 Then Begin
ExitLong("EL", atstop,Slow - npoint);
*****If High < Fast AND Trending Then
*****Buy ("Longer", atstop,Fast + npoint) ;
End;
If MP == -1 Then Begin
ExitShort("ES", atstop,Slow + npoint);
****** If Low > Fast AND Trending Then
****** Sell ("Shorter", atstop,Fast - npoint) ;
End;
-------------------------------------------------------------------------
하단부에 제가 *******로 표시해놓은 네줄이 무었을 의미하는지 잘 이해가 안되네요
제가 이해하기로는 추가진입을 의미하는걸로 이해가 되는데 시뮬레이션상에서
Loger Shorter진입이 딱히 뜨지는 않고
저 네줄을 지워보니 전체적인 청산시점이 다 바뀌네요
2019-05-27
270
글번호 128986
답변완료
문의드립니다.
변환 부탁드립니다.
1.
inputs:
Fundamental( 20 ) ;
variables:
Bandwidth(.1),
G1( 0 ), S1( 0 ), L1( 0 ),
BP1( 0 ), Q1( 0 ), P1( 0 ),
G2( 0 ), S2( 0 ), L2( 0 ),
BP2( 0 ), Q2( 0 ), P2( 0 ),
G3( 0 ), S3( 0 ), L3( 0 ),
BP3( 0 ), Q3( 0 ), P3( 0 ),
count( 0 ), Wave( 0 ),
ROC( 0 ) ;
//compute filter coefficients
once
once
begin
L1 = Cosine( 360 / Fundamental ) ;
G1 = Cosine( Bandwidth *
360 / Fundamental ) ;
S1 = 1 / G1 - SquareRoot(
1 / ( G1 * G1 ) - 1 ) ;
L2 = Cosine( 360 / ( Fundamental / 2 ) ) ;
G2 = Cosine( Bandwidth * 360 / ( Fundamental / 2 ) ) ;
S2 = 1 / G2 - SquareRoot( 1 / ( G2 * G2 ) - 1 ) ;
L3 = Cosine( 360 / ( Fundamental / 3 ) ) ;
G3 = Cosine( Bandwidth * 360 / ( Fundamental / 3 ) ) ;
S3 = 1 / G3 - SquareRoot( 1 / ( G3 * G3 ) - 1 ) ;
end ;
//Fundamental Band-Pass
BP1 = .5 * ( 1 - S1) * ( Close - Close[2] )
+ L1 * ( 1 + S1 ) * BP1[1] - S1 * BP1[2] ;
if CurrentBar <= 3 then
BP1 = 0 ;
//Fundamental Quadrature
Q1 = ( Fundamental / 6.28 ) * ( BP1 - BP1[1] ) ;
if CurrentBar <= 4 then
Q1 = 0 ;
//Second Harmonic Band-Pass
BP2 = .5 * ( 1 - S2 ) * ( Close - Close[2] )
+ L2 * ( 1 + S2 ) * BP2[1] - S2 * BP2[2] ;
if CurrentBar <= 3 then
BP2 = 0 ;
//Second Harmonic Quadrature
Q2 = ( Fundamental / 6.28 ) * ( BP2 - BP2[1] ) ;
if CurrentBar <= 4 then
Q2 = 0 ;
//Third Harmonic Band-Pass
BP3 = .5 * ( 1 - S3 ) * ( Close - Close[2] )
+ L3 * ( 1 + S3 ) * BP3[1] - S3 * BP3[2] ;
if CurrentBar <= 3 then
BP3 = 0 ;
//Third Harmonic Quadrature
Q3 = ( Fundamental / 6.28 ) * ( BP3 - BP3[1] ) ;
if CurrentBar <= 4 then
Q3 = 0 ;
//Sum power of each harmonic at
//each bar over the Fundamental period
P1 = 0 ;
P2 = 0 ;
P3 = 0 ;
For count = 0 to Fundamental - 1
begin
P1 = P1 + BP1[count] * BP1[count]
+ Q1[count] * Q1[count] ;
P2 = P2 + BP2[count] * BP2[count]
+ Q2[count] * Q2[count] ;
P3 = P3 + BP3[count] * BP3[count]
+ Q3[count] * Q3[count] ;
end ;
//Add the three harmonics together
//using their relative amplitudes
If P1 <> 0 then
Wave = BP1 + SquareRoot( P2 / P1 ) * BP2
+ SquareRoot( P3 / P1 ) * BP3 ;
Plot1( Wave );
Plot2( 0 );
//Optional cyclic trading signal
//Rate of change crosses zero at
//cyclic turning points
ROC = ( Fundamental / 12.57 ) *
( Wave - Wave[2] ) ;
Plot3( ROC ) ;
2.
Strategy: Fourier Series Strategy
// TASC JUN 2019
// Fourier Series Analysis
// (C) 2005-2018 John F. Ehlers
inputs:
Fundamental( 20 ) ;
variables:
Bandwidth(.1),
G1( 0 ), S1( 0 ), L1( 0 ), BP1( 0 ), Q1( 0 ), P1( 0 ),
G2( 0 ), S2( 0 ), L2( 0 ), BP2( 0 ), Q2( 0 ), P2( 0 ),
G3( 0 ), S3( 0 ), L3( 0 ), BP3( 0 ), Q3( 0 ), P3( 0 ),
count( 0 ), Wave( 0 ), ROC( 0 ) ;
//compute filter coefficients once
once
begin
L1 = Cosine( 360 / Fundamental ) ;
G1 = Cosine( Bandwidth * 360 / Fundamental ) ;
S1 = 1 / G1 - SquareRoot( 1 / ( G1 * G1 ) - 1 ) ;
L2 = Cosine( 360 / ( Fundamental / 2 ) ) ;
G2 = Cosine( Bandwidth * 360 / ( Fundamental / 2 ) ) ;
S2 = 1 / G2 - SquareRoot( 1 / ( G2 * G2 ) - 1 ) ;
L3 = Cosine( 360 / ( Fundamental / 3 ) ) ;
G3 = Cosine( Bandwidth * 360 / ( Fundamental / 3 ) ) ;
S3 = 1 / G3 - SquareRoot( 1 / ( G3 * G3 ) - 1 ) ;
end ;
//Fundamental Band-Pass
BP1 = .5 * ( 1 - S1) * ( Close - Close[2] )
+ L1 * ( 1 + S1 ) * BP1[1] - S1 * BP1[2] ;
if CurrentBar <= 3 then
BP1 = 0 ;
//Fundamental Quadrature
Q1 = ( Fundamental / 6.28 ) * ( BP1 - BP1[1] ) ;
if CurrentBar <= 4 then
Q1 = 0 ;
//Second Harmonic Band-Pass
BP2 = .5 * ( 1 - S2 ) * ( Close - Close[2] )
+ L2 * ( 1 + S2 ) * BP2[1] - S2 * BP2[2] ;
if CurrentBar <= 3 then
BP2 = 0 ;
//Second Harmonic Quadrature
Q2 = ( Fundamental / 6.28 ) * ( BP2 - BP2[1] ) ;
if CurrentBar <= 4 then
Q2 = 0 ;
//Third Harmonic Band-Pass
BP3 = .5 * ( 1 - S3 ) * ( Close - Close[2] )
+ L3 * ( 1 + S3 ) * BP3[1] - S3 * BP3[2] ;
if CurrentBar <= 3 then
BP3 = 0 ;
//Third Harmonic Quadrature
Q3 = ( Fundamental / 6.28 ) * ( BP3 - BP3[1] ) ;
if CurrentBar <= 4 then
Q3 = 0 ;
//Sum power of each harmonic at
//each bar over the Fundamental period
P1 = 0 ;
P2 = 0 ;
P3 = 0 ;
For count = 0 to Fundamental - 1
begin
P1 = P1 + BP1[count] * BP1[count]
+ Q1[count] * Q1[count] ;
P2 = P2 + BP2[count] * BP2[count]
+ Q2[count] * Q2[count] ;
P3 = P3 + BP3[count] * BP3[count]
+ Q3[count] * Q3[count] ;
end ;
//Add the three harmonics together
//using their relative amplitudes
If P1 <> 0 then
Wave = BP1 + SquareRoot( P2 / P1 ) * BP2
+ SquareRoot( P3 / P1 ) * BP3 ;
//Rate of change crosses zero at
//cyclic turning points
ROC = ( Fundamental / 12.57 ) *
( Wave - Wave[2] ) ;
if ROC crosses over 0 then
Buy next bar at Market
else if ROC crosses under 0 then
SellShort next bar at Market ;
2019-05-27
525
글번호 128985
답변완료
수식좀 부탁합니다.
아래 조건에 수식좀 부탁합니다.
1분봉,데이
조건만족봉이후 특정 지지선을 깨지않고 매수조건에 부합하면 매수하려고 합니다.
매수제외조건(지지선이탈,일봉 MA60,Ma120하락중)
그리고 같은종목은 하루에 한번만 매매되게 부탁합니다.
2019-05-28
231
글번호 128984
답변완료
사용자 함수 부탁드립니다.
안녕하세요.
기하이동평균선 함수식을 만들고 싶습니다.
단순 이동 평균
1+2+3+4+5 = 15/5 = 3
기하 이동 평균
1*2*3*4*5 = 120 = 120^(1/5) = 2.605171
(1/5)에서 5는 N값입니다.
수식 부탁드립니다.
감사합니다.
2019-05-26
260
글번호 128983