커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1581
글번호 230811
답변완료
일봉상 패스트 스토캐스틱으로 종목검색식 부탁드립니다..
안녕하세요..
패스트 스토캐스틱 지표수식으로 52일의 최고, 최저가로 종목을 검색하고 싶은데요..
키움에서 지표는 만들었는데 종목검색은 할 수가 없어서 문의드립니다..
A=(C-lowest(L,52))/(highest(H,52)-lowest(L,52))*100;
B=EAVG(A,5);
D=EAVG(A,20);
Crossup(B,D)
패스트 스토캐스틱 52일의 최고, 최저가의 5이평이 20이평을 골든크로스하는 종목으로 검색식 부탁드립니다..
감사합니다..
2023-02-02
657
글번호 165935
답변완료
함수요청
안녕하세요?
아래의 전략에 대해 스크립트 작성 요청드립니다.
국내선물 1분봉으로 일중거래를 하고자 합니다.
1. data2 전영업일 종가 > data1의 시가 > data1의 전영업일 종가이면
당일 시가선 기준으로 2번 연속 돌파되면 익봉 시가 매수
당일 시가선 기준으로 2번 연속 이탈되면 익봉 시가 매수청산
당일 시가선 기준으로 4번 연속 돌파되면 익봉 시가 매수청산
100ma 돌파 및 이탈시 익봉 시가 매수청산
2. data2 전영업일 종가 < data1의 시가 < data1의 전영업일 종가이면
당일 시가선 기준으로 2번 연속 이탈되면 익봉 시가 매도
당일 시가선 기준으로 2번 연속 돌파되면 익봉 시가 매도청산
당일 시가선 기준으로 4번 연속 이탈되면 익봉 시가 매도청산
100ma 돌파 및 이탈시 익봉 시가 매도청산
3. data1의 시가 > data2 전영업일 종가 > data1의 전영업일 종가이면
당일 시가선 기준으로 2번 연속 돌파되면 익봉 시가 매도
당일 시가선 기준으로 2번 연속 이탈되면 익봉 시가 매도청산
당일 시가선 기준으로 4번 연속 돌파되면 익봉 시가 매도청산
100ma 돌파 및 이탈시 익봉 시가 매도청산
4.data1의 시가 < data2 전영업일 종가 < data1의 전영업일 종가이면
당일 시가선 기준으로 2번 연속 이탈되면 익봉 시가 매수
당일 시가선 기준으로 2번 연속 돌파되면 익봉 시가 매수청산
당일 시가선 기준으로 4번 연속 이탈되면 익봉 시가 매수청산
100ma 돌파 및 이탈시 익봉 시가 매수청산
아침에 시가가 결정되면 1~4번 가운데 1개의 시나리오를 적용할 것입니다.
청산조건은 or이며 15:20에는 강제청산입니다.
2023-02-02
614
글번호 165934
답변완료
지표문의
1.누적upvol ,누적downvol
5분봉에서 누적upvol-누적downvol 가감해서 매시간마다누적 표시 되게끔 작성 좀해 주세요
9시에서 10시 그다음 초기화 하고 10시에서 11시 매시간 마다 오후4시 까지
2.그럼 즐거운 하루 되세요
2023-02-02
679
글번호 165933
답변완료
최고가발생종목검색
일봉에서 10봉이내에 5봉최고가가 발생한 종목 검색 부탁드립니다
2023-02-02
651
글번호 165932
답변완료
문의 드립니다.
아래는 게시판 80595 질답 내용입니다.
180분 캔들을 매매에 사용중인데 180분봉 완성시 그다음 시가 청산후
30분후에 진입신호가 적용되질 않습니다.
보완해야할 것이 있는지 문의 드립니다.
1
현재 진입이 완성봉에서 값이 셋팅되서 다음봉 미완성시에 발생하는 내용입니다.
atstop,atlimit으로 봉완성시 값이 셋팅이 되면
다음봉 미완성시에 신호발생을 제어할 수 없습니다.
또한 if문이 봉완성기준입니다.
미완성시에 청산시점에서 30분이후로 지정이 불가능합니다.
문의하신 내용이면 시가에 청산이 발생하면
봉단위로 30분이후 봉부터 진입이 발생하게만 작성이 됩니다.
올리신 식이 봉완성시 진입이 있으면 다음봉 시가에서 청산을 모두 하므로
봉완성시 진입이 있으면 다음진입은 30분봉 이상 경과한 다음봉부터 신호가 발생하게 됩니다.
input : starttime(160000),endtime(80000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
var : s1(0),d1(0),tm(0),trade(False),tt(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
Trade = true;
}
if D1 > 0 then
{
if NextBarSdate == D1 Then
TM = TimeToMinutes(NextBarStime)-S1;
Else
TM = TimeToMinutes(NextBarStime)+1440-S1;
}
input : 익절틱수(0),손절틱수(0);
if MarketPosition != 0 Then
{
Trade = False;
TT = TM;
}
Else
{
Trade = true;
}
if Trade == False and TM >= TT+30 Then
Trade = true;
if NextBarSdate != sDate and Trade == true Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx2",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx3",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx4",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b5",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx5",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b6",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx6",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b7",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx7",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx8",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx9",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b10",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx10",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b11",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx11",AtMarket);
if NextBarSdate != sDate and Trade == true Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx1",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx2",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s3",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx3",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s4",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx4",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s5",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx5",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s6",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx6",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s7",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx7",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s8",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx8",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s9",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx9",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s10",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx10",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s11",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx11",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
------------------
input : starttime(160000),endtime(80000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
var : s1(0),d1(0),tm(0),trade(False),tt(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
Trade = true;
}
if D1 > 0 then
{
if NextBarSdate == D1 Then
TM = TimeToMinutes(NextBarStime)-S1;
Else
TM = TimeToMinutes(NextBarStime)+1440-S1;
}
input : 익절틱수(0),손절틱수(0);
if MarketPosition != 0 Then
{
Trade = False;
TT = TM;
}
Else
{
Trade = true;
}
if Trade == False and TM >= TT+30 Then
Trade = true;
if NextBarSdate != sDate and Trade == true Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx2",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx3",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx4",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Buy("b5",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx5",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b6",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx6",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b7",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx7",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx8",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx9",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b10",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx10",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Buy("b11",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx11",AtMarket);
if NextBarSdate != sDate and Trade == true Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx1",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx2",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s3",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx3",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s4",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx4",AtMarket);
if NextBarOpen != C and Trade == true Then
{
Sell("s5",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx5",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s6",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx6",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s7",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx7",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s8",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx8",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s9",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx9",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s10",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx10",AtMarket);
if NextBarOpen == C and Trade == true Then
{
Sell("s11",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx11",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
위 수식어의 캔들이 180분봉으로 가정했을때 시가청산후
진입신호를
매수는 동일상품의 캔들 1분봉 골든(5,20) 3회시 주문, 청산은 180분봉 완성후 시가청산
매도는 동일상품의 캔들 1분봉 데드(20,5) 3회시 주문, 청산은 180분봉 완성후 시가청산
으로 된 수식어를 추가로 부탁드리고자 합니다.
2023-02-02
813
글번호 165931
답변완료
수식 변환 요청드립니다
아래는 트레이딩 뷰에서 Mansfield Relative Strength지표입니다.
변환 부탁드립니다
//@version=3
// Use this indicator to compare how security is performing in compare with prefered index (SPX by default).
// > 0 outperforming
// < 0 underperforming
// Works best for weekly, but can be applied to monthly and daily charts. It will be rather useless to use it in smaller timeframes
// Apply it to SPX, industry index, sector index or other security in similar sector
// UPDAT E 1: Added sector and industry as optional params. Leave them same as index if you don't want to use them
study("Mansfield Relative Strength indicator")
index = input(title="Index", type=symbol, defval="SP:SPX")
sector = input(title="Sector (optional)", type=symbol, defval="SP:SPX")
industry = input(title="Industry (optional)", type=symbol, defval="SP:SPX")
ma_type = input(title="Which moving average to use?", defval="SMA", options=["SMA", "WMA", "EMA"])
len_daily = input(title="MA length for Daily", defval=200)
len_weekly = input(title="MA length for Weekly", defval=52)
len_monthly = input(title="MA length for Monthly", defval=10)
len_other = input(title="MA length for all other periods", defval=52)
val = close
len = period == "W" ? len_weekly : (period == "D" ? len_daily : (period == "M" ? len_monthly : len_other))
ma_func(x, length) =>
ma_type == "WMA" ? wma(x, length) : (ma_type == "SMA" ? sma(x, length) : ema(x, length))
calc_mrs_func(x, ind, length) =>
((x / security(ind, period, x)) / ma_func((x / security(ind, period, x)), length) - 1) * 10
mrs_index = calc_mrs_func(val, index, len)
mrs_sector = calc_mrs_func(val, sector, len)
mrs_industry = calc_mrs_func(val, industry, len)
c = sign(mrs_index) + sign(mrs_sector) + sign(mrs_industry)
bgcolor(c == 3 ? color(green, 80) : c == 2 ? color(green, 75) : c == 1 ? color(green, 70) : c == -1 ? color(red, 70) : c == -2 ? color(red, 75) : c == -3 ? color(red, 80) : gray)
plot(mrs_index, linewidth=3, title="MRS index")
plot(mrs_sector != mrs_index ? mrs_sector : na, linewidth=2, title="MRS sector")
plot(mrs_industry != mrs_index ? mrs_industry : na, linewidth=1, title="MRS industry")
hline(price=0, linestyle=dashed, title="Zero baseline")
2023-02-02
952
글번호 165930
답변완료
수식요청합니다.
지그재그차트에서 상승변곡점(상승후 하락시 꼭지점)을 돌파하는 종목검색식 요청합니다.
(첨부자료)
Input:전환비율(5);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""),TL1(0),Text1(0),ADXV1(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]*(1+(전환비율/100))<HH and hiBar==0;
Condition2=고[1,1]*(1-(전환비율/100))>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;
TL1=TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]);
TL_SetSize(TL1,1);
TL_SetColor(TL1,RED);
}
Else If 고[1,1]<HH[hiBar] Then//1번고점보다높은고가출현
{
고[1,1]=HH[hiBar];
고[1,2]=Index-hiBar;
고[1,3]=sDate[hiBar];
고[1,4]=sTime[hiBar];
hiBar=-1;
loBar=-1;
TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]);
}
최종꼭지점="고점";
}
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;
TL1=TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
TL_SetSize(TL1,1);
TL_SetColor(TL1,BLUE);
}
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(TL1,저[1,3],저[1,4],저[1,1]);
}
최종꼭지점="저점";
}
2023-02-01
1220
글번호 165929
답변완료
지표 의뢰 드립니다
안녕하세요!
아래수식은 지난번에 만들어 주신 수식으로 현재 매매에 사용하고 있습니다!
다름이 아니라 아래 수식처럼 강세약세 패턴을 만들고 싶습니다!
예스에서 제공해주시는 파라볼릭 과 DMI 지표를 이용한 강세약세 패턴을 만들고 싶습니다!
강세약세 조건>
1. DMI+가 DMI-를 골든크로스 할때 파라볼릭이 상승시 = 두가지 조건이 일치할때만 강세패턴
2. DMI-가 DMI+를 데드크로스 할때 파라볼릭이 하락시 = 두가지 조건이 일치할때만 약세패턴
배경색은 제가 변경 할 수 있도록 부탁드립니다.
항상 노고에 감사드립니다.
-----------------------------------------------
input : P1(5),P2(20);
Var : mav1(0),mav2(0);
mav1 = ma(c,P1);
mav2 = ma(c,P2);
if mav1 > mav2 Then{
plot1(99999999,"라인1");
plot2(0,"라인2");
}
else{
plot1(0,"라인1");
plot2(99999999,"라인2");
}
------------------------------------------------
data2 ~ data11 의 콜과 풋의 옵션교차차트에서 동일가가 1번이라도 발생하면 같은시각
data1의 선물차트에 수평선이 발생하는 수식을 만들어 주시길 부탁드립니다!
2023-02-02
1106
글번호 165928
답변완료
추세선 고저가라인
input : Period(35),선두께(2);
Var:상승색(Red), 하락색(Blue);
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;
}
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) 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,선두께);
당일 추세선의 고저가 갱신될 때마다 새로운 고저 수평라인 부탁드립니다.
2023-02-01
1219
글번호 165927