커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내

안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
프로필 이미지
예스스탁
2026-02-27
4734
글번호 230811
지표
답변완료

안녕하세요 . 수식 부탁드립니다

1 위 그림에서 macdv 가 기준선 0 아래에서 macds와 우상향 크로스후 macdv 가 기준선 0을 우상향 돌파시 매수 청산은 macdv가 macds 가 우하향 크로스일때 .. 식을 알고 싶습니다 2 아래 조건식을 사용중인데 ,,, 기술적 지표는 틱봉을 사용하고 . 참조데이터는 분봉이다보니 시간차에 의해 진입이 안되는 현상이 있어요 ... 그래서 시간을 5분안에 기술적 지표와 원하는 참조데이터 가 모두 만족 조건이 될 시에 진입하는 조건식을 알고 싶습니다 . 늘 감사합니다 Cond1 = False; Cond2 = False; Cond1 = #Ma300 > Ma400 #And Ma150 > Ma150[1] ; #And Close >=Ma150[1] #and Close >= MA150 crossup(stok,stod) and stok > stod #and stok > stok[1] ; #and stok > 20 #and Close >= DayOpen #and macdv >= macdv[1] #and macdv >= macds and macdv >= 0 ; Cond2 = #Ma300 < Ma400 #And Ma150 < Ma150[1] ; #And Close <= Ma150[1] #and Close <= MA150 CrossDown(stok,stod) and stok < stod #and stok < stok[1] ; #and stok < 80 #and Close <= DayOpen #and macdv <= macdv[1] #and macdv <= macds and macdv <= 0 ; Condition1 = MarketPosition != 1 #and (stime < 120000 or stime >= 151500) #and data2(C) > 0 and data2(C > O) #and data3(C) > 0 #and data3(C > O) #and data4(C) > 0 and data4(C > O) #and data5(C) > 0 #and data5(C > O) #and data6(C > O) #and data7(C > O) and Cond1 == true ;
프로필 이미지
정마니
2015-10-30
239
글번호 91896
시스템
답변완료

수식 수정 부탁드립니다

수식 수정 2가지 입니다 (1)아래 식을 적용해본 결과 천정에서 -40,-80,...선이 완료된 후에는 바닥에서 +40,+80,...선이 출력되는 방식입니다 천정에서 -40,-80,...선과 바닥에서 +40,+80,...선이 번갈아 출력되지 않고 하나의 면적에 천정 지지선과 바닥 저항선이 동시에 출력되는 방식으로 수정 부탁드립니다 그리고 -40 글자는 blue, +40 글자는 red 색깔로 표시하는 수식도 추가부탁드립니다 감사합니다 ---------------------------------------------------------------- input : N(40); var : HH(0),LL(0),T(0),HD(0),HT(0),LD(0),LT(0),HL(0),LH(0); var : Tx1(0),tx2(0),tx3(0),tx4(0),tx5(0); var : tx6(0),tx7(0),tx8(0),tx9(0),Tx10(0); if bdate != bdate[1] then{ T = 0; HH = H; LL = L; } if H > HH and Bdate == Bdate[1] Then{ T = 1; HH = H; Condition1 = false; Condition2 = false; Condition3 = false; Condition4 = false; Condition5 = false; Condition6 = false; Condition7 = false; Condition8 = false; Condition9 = false; } if L < LL and Bdate == Bdate[1] Then{ T = -1; LL = L; Condition1 = false; Condition2 = false; Condition3 = false; Condition4 = false; Condition5 = false; Condition6 = false; Condition7 = false; Condition8 = false; Condition9 = false; } if T == 1 Then{ var1 = dayhigh-PriceScale*(N*1); var2 = dayhigh-PriceScale*(N*2); var3 = dayhigh-PriceScale*(N*3); var4 = dayhigh-PriceScale*(N*4); var5 = dayhigh-PriceScale*(N*5); var6 = dayhigh-PriceScale*(N*6); var7 = dayhigh-PriceScale*(N*7); var8 = dayhigh-PriceScale*(N*8); var9 = dayhigh-PriceScale*(N*9); plot1(var1,"1",blue); plot2(var2,"2",blue); plot3(var3,"3",blue); plot4(var4,"4",blue); plot5(var5,"5",blue); plot6(var6,"6",blue); plot7(var7,"7",blue); plot8(var8,"8",blue); plot9(var9,"9",blue); Text_Delete(tx1); Text_Delete(tx2); Text_Delete(tx3); Text_Delete(tx4); Text_Delete(tx5); Text_Delete(tx6); Text_Delete(tx7); Text_Delete(tx8); Text_Delete(tx9); tx1 = Text_New(sdate,stime,var1,"-"+NumToStr(N*1,0)); tx2 = Text_New(sdate,stime,var2,"-"+NumToStr(N*2,0)); tx3 = Text_New(sdate,stime,var3,"-"+NumToStr(N*3,0)); tx4 = Text_New(sdate,stime,var4,"-"+NumToStr(N*4,0)); tx5 = Text_New(sdate,stime,var5,"-"+NumToStr(N*5,0)); tx6 = Text_New(sdate,stime,var6,"-"+NumToStr(N*6,0)); tx7 = Text_New(sdate,stime,var7,"-"+NumToStr(N*7,0)); tx8 = Text_New(sdate,stime,var8,"-"+NumToStr(N*8,0)); tx9 = Text_New(sdate,stime,var9,"-"+NumToStr(N*9,0)); if Condition1 == false and CrossDown(c,var1) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*1,0)); Condition1 = true; } if Condition2 == false and CrossDown(c,var2) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*2,0)); Condition1 = true; } if Condition3 == false and CrossDown(c,var3) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*3,0)); Condition3 = true; } if Condition4 == false and CrossDown(c,var4) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*4,0)); Condition4 = true; } if Condition5 == false and CrossDown(c,var5) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*5,0)); Condition5 = true; } if Condition6 == false and CrossDown(c,var6) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*6,0)); Condition6 = true; } if Condition7 == false and CrossDown(c,var7) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*7,0)); Condition7 = true; } if Condition8 == false and CrossDown(c,var8) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*8,0)); Condition8 = true; } if Condition9 == false and CrossDown(c,var9) Then{ tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*8,0)); Condition9 = true; } Text_SetStyle(tx1,2,2); Text_SetStyle(tx2,2,2); Text_SetStyle(tx3,2,2); Text_SetStyle(tx4,2,2); Text_SetStyle(tx5,2,2); Text_SetStyle(tx6,2,2); Text_SetStyle(tx7,2,2); Text_SetStyle(tx8,2,2); Text_SetStyle(tx9,2,2); Text_SetStyle(tx10,2,2); } if T == -1 Then{ var1 = daylow+PriceScale*(N*1); var2 = daylow+PriceScale*(N*2); var3 = daylow+PriceScale*(N*3); var4 = daylow+PriceScale*(N*4); var5 = daylow+PriceScale*(N*5); var6 = daylow+PriceScale*(N*6); var7 = daylow+PriceScale*(N*7); var8 = daylow+PriceScale*(N*8); var9 = daylow+PriceScale*(N*9); plot1(var1,"1",red); plot2(var2,"2",red); plot3(var3,"3",red); plot4(var4,"4",red); plot5(var5,"5",red); plot6(var6,"6",red); plot7(var7,"7",red); plot8(var8,"8",red); plot9(var9,"9",red); Text_Delete(tx1); Text_Delete(tx2); Text_Delete(tx3); Text_Delete(tx4); Text_Delete(tx5); Text_Delete(tx6); Text_Delete(tx7); Text_Delete(tx8); Text_Delete(tx9); tx1 = Text_New(sdate,stime,var1,"+"+NumToStr(N*1,0)); tx2 = Text_New(sdate,stime,var2,"+"+NumToStr(N*2,0)); tx3 = Text_New(sdate,stime,var3,"+"+NumToStr(N*3,0)); tx4 = Text_New(sdate,stime,var4,"+"+NumToStr(N*4,0)); tx5 = Text_New(sdate,stime,var5,"+"+NumToStr(N*5,0)); tx6 = Text_New(sdate,stime,var6,"+"+NumToStr(N*6,0)); tx7 = Text_New(sdate,stime,var7,"+"+NumToStr(N*7,0)); tx8 = Text_New(sdate,stime,var8,"+"+NumToStr(N*8,0)); tx9 = Text_New(sdate,stime,var9,"+"+NumToStr(N*9,0)); if Condition1 == false and Crossup(c,var1) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*1,0)); Condition1 = true; } if Condition2 == false and Crossup(c,var2) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*2,0)); Condition1 = true; } if Condition3 == false and Crossup(c,var3) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*3,0)); Condition3 = true; } if Condition4 == false and Crossup(c,var4) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*4,0)); Condition4 = true; } if Condition5 == false and Crossup(c,var5) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*5,0)); Condition5 = true; } if Condition6 == false and Crossup(c,var6) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*6,0)); Condition6 = true; } if Condition7 == false and Crossup(c,var7) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*7,0)); Condition7 = true; } if Condition8 == false and Crossup(c,var8) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0)); Condition8 = true; } if Condition9 == false and Crossup(c,var9) Then{ tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0)); Condition9 = true; } Text_SetStyle(tx1,2,2); Text_SetStyle(tx2,2,2); Text_SetStyle(tx3,2,2); Text_SetStyle(tx4,2,2); Text_SetStyle(tx5,2,2); Text_SetStyle(tx6,2,2); Text_SetStyle(tx7,2,2); Text_SetStyle(tx8,2,2); Text_SetStyle(tx9,2,2); Text_SetStyle(tx10,2,2); } ------------------------------------------ (2) 아래식은 p1과 p2 크로스 시점에 진입식입니다 아래식을 p1과 p2 골든 크로스 가격을 현재가가 골든크로스 하거나 터치할때 매수 p1과 p2 데드 크로스 가격을 현재가가 데드크로스 하거나 터치할때 매도 진입식으로 수정 부탁드립니다 감사합니다 var:p1(0),p2(0); p1=ma(c,10) p2=ma(c,20) if Crossup( p1,p2) then{ buy(); } if CrossDown( p1,p2) then{ sell(); }
프로필 이미지
회원
2015-11-01
315
글번호 91895
지표
답변완료

시스템식 검토 부탁드립니다.

이평보정계수와 시장보정계수가 제대로 적용되지 않아 검토 부탁 드립니다. 그림1)에서 보듯이 120일 이동평균선이 우하향하는 조건이므로 이때 그림2) 처럼 이평보정계수(5)가 적용되어 기존 10:10 엔벨로프 하단선 부근에서 1차매수하던 것을 15:15 엔벨로프 하단선 부근에서 1차매수 신호가 발생되어야 하는데, 그림과 같이 적용이 되지 않네요.. 하지만, 그림3)은 갭하락(5)로 설정했을때 이평보정계수가 제대로 적용된 경우입니다. 그림3)에 갭하락(4)로 설정했을 경우에는 120이평 조건과 갭하락 조건 두조건이 모두 만족하여 두가지 보정계수가 적용되므로 20:20 엔벨로프 하단선 부근에서 1차매수 신호가 발생하므로 현재의 차트에서는 1차매수 신호가 발생되지 말아야 하는데, 신호가 발생했습니다. 검토 부탁드립니다. 현재 시스템식은 다음과 같습니다. ---------------------------------------------------------------------------------------- input : 전략식시작일자(20151028), 전략식시작시간(090000), 전략총매수금액(5000); input : 전략식종료일자(20151231); input : 갭하락(5), 시장보정계수(5),일봉이평기간(120),이평보정계수(5); input : P(10), 매수위치1차(10), 매수위치2차(7), 매수위치3차(14); input : 매수위치보정(1); input : 매도위치1차(7), 매도위치2차(14); input : 매수비중1차(30), 매수비중2차(35), 매수비중3차(35); input : 매도비중1차(50), 매도비중2차(50); input : 전략식진입횟수(100); input : 타점보유일수(5); var : sum(0),mav(0),cnt(0),eup(0),edn(0),Didx(0),LatestEntryDidx(0),Ecnt(0); var : TimeCond(false),Xcond1(false),Xcond2(false),Loss(0),LatestEntrylow(0); var : Period(0),매수1차(0); var : cum1(0),cum2(0),ma1(0),ma2(0); # 일자수 계산 if date != date[1] Then Didx = Didx+1; # 일봉 120이평 계산(전일기준,전전일기준) cum1 = 0; cum2 = 0; for cnt = 1 to 일봉이평기간{ cum1 = cum1+DayClose(cnt); cum2 = cum2+DayClose(cnt+1); } # 전일기준 일봉 120일이평 ma1 = cum1/일봉이평기간; # 전전일기준 일봉 120일이평 ma2 = cum2/일봉이평기간; #기본값은 기간은 P, %는 매수위치1차 Period = P; 매수1차 = 매수위치1차; #갭하락이면 #기간은 기존Period값+시장보정계수 #%는 기존 매수1차값에 + 시장보정계수 if dayopen < DayClose(1)*(1-갭하락) Then{ Period = Period + 시장보정계수; 매수1차 = 매수1차 + 시장보정계수; } #이평하락이면 #기간은 기존Period값+이평보정계수 #%는 기존 매수1차값에 + 이평보정계수 if ma1 < ma2 Then{ Period = Period + 이평보정계수; 매수1차 = 매수1차 + 이평보정계수; } #당일포함 일봉 Period개의 종가를 누적 sum = 0; for cnt = 0 to Period-1{ sum = sum+DayClose(cnt); } #누적값을 Period로 나누어 평균값 산출 mav = sum/Period; #상단계산 Eup = mav+mav*(매수1차/100); #하단계산 Edn = mav-mav*(매수1차/100); #지정일 지정시간이 되면 TimeCond는 True(그전에는 false) if sdate == 전략식시작일자 and (stime == 전략식시작시간 or (stime > 전략식시작시간 and stime[1] < 전략식시작시간 )) then TimeCond = true; if sdate > 전략식종료일자 Then TimeCond = false; #TimeCond가 True가 된 후 if TimeCond == true then{ if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "1차매수" Then Ecnt = Ecnt+1; #무포지션 상태에서 매수위치1차에 도달하면 매수 if MarketPosition == 0 and Ecnt < 전략식진입횟수 Then buy("1차매수",atlimit,Edn*(1+매수위치보정/100),Floor((전략총매수금액*10000/c)*(매수비중1차/100))); #첫매수이후 if MarketPosition == 1 Then{ #최근 진입시점의 일자수 저장 if CurrentContracts > CurrentContracts[1] Then{ LatestEntryDidx = Didx; LatestEntrylow = L; } #1차매수 발생 후 매수위치2차에 도달하면 매수 if MaxEntries == 1 Then buy("2차매수",atlimit,Edn[BarsSinceEntry]*(1-매수위치2차/100),Floor((전략총매수금액*10000/c)*(매수비중2차/100))); #1차매수 발생 후 매수위치3차에 도달하면 매수 if MaxEntries == 2 Then buy("3차매수",atlimit,Edn[BarsSinceEntry]*(1-매수위치3차/100),Floor((전략총매수금액*10000/c)*(매수비중3차/100))); #1차매도가 한번 발생하면 더이상 발생못하도록 Xcond1은 true if LatestExitName(0) == "1차매도" then Xcond1 = true; #2차매도가 한번 발생하면 더이상 발생못하도록 Xcond2는 true if LatestExitName(0) == "2차매도" then Xcond2 = true; #Xcond1이 false일때 #진입이후 최저가에서 매도위치1차 만큼 상승하면 일부 청산 if Xcond1 == false Then exitlong("1차매도",Atlimit,lowest(L,BarsSinceEntry)*(1+매도위치1차/100),"",Floor(MaxContracts*(매도비중1차/100)),1); #Xcond2가 false일 #진입이후 최저가에서 매도위치2차 만큼 상승하면 전량청산 if Xcond2 == false Then exitlong("2차매도",Atlimit,lowest(L,BarsSinceEntry)*(1+매도위치2차/100)); #최근 진입후 3일이상 경과(현재 일자수가 최근진입시점의 일자수보다 3이상증가) if Didx >= LatestEntryDidx+타점보유일수 and Xcond1 == false and CurrentContracts == CurrentContracts[1] Then{ #최근 진입이후 3일되었을때의 최근진입일 포함3일 최저가 계산 if date != date[1] and Didx == LatestEntryDidx[BarsSinceEntry]+3 Then{ Loss = daylow(1); for cnt = 1 to 타점보유일수 { if daylow(cnt) < Loss Then Loss = daylow(cnt); } } #Loss값 이하로 가격하락하면 전량 청산 exitlong("손절",AtStop,Loss); } #최종 매수일 포함 3일경과되면 다음날 시가에 매도 if Didx == LatestEntryDidx+(타점보유일수-1) and stime == 150000 Then{ exitlong("익절2",AtMarket); } # 1차매도가 발생한 상황 # 가장 최근 진입일의 당일최저가보다 낮은 시세 발생하면 전량청산 # if L < LatestEntrylow and Xcond1 == false Then # LatestEntrylow = L; # if Xcond1 == true and CurrentContracts == CurrentContracts[1] Then{ # exitlong("익절1",AtStop,LatestEntrylow); # } } else{ #매수포지션이 아니면 false로 초기화 Xcond1 = false; Xcond2 = false; } }
프로필 이미지
종풍화성
2015-10-29
243
글번호 91894
시스템

회원 님에 의해서 삭제되었습니다.

프로필 이미지
회원
2015-10-29
1
글번호 91893
지표
답변완료

시스템문의합니다

해외선물 5일선 20일선 매수매도식입니다. 10틱이내 수렴중에 신호가 안나오게 하는 방법이 궁금합니다.ㅜㅜ 또는 var1 = ma(C,5); var2 = ma(C,20); if MarketPosition <= 0 and crossup(var1,var2) Then buy("매수",OnClose,def,2); if MarketPosition >= 0 and CrossDown(var1,var2) Then sell("매도",OnClose,def,2); if MarketPosition == 1 Then{ ExitLong("매수수익1",atlimit,EntryPrice+PriceScale*10,"",1,1); ExitLong("매수수익2",atlimit,EntryPrice+PriceScale*40,"",1,1); } if MarketPosition == -1 Then{ ExitShort("매도수익1",atlimit,EntryPrice-PriceScale*10,"",1,1); ExitShort("매도수익2",atlimit,EntryPrice-PriceScale*40,"",1,1); }
프로필 이미지
지오2014
2015-10-29
195
글번호 91890
시스템
답변완료

감사합니다.

우선 감사드립니다. 미국 나스닥지수가 전일대비하여 일정폭 이상 하락(30) 또는 상승(30)하는 경우 선물을 시초가에 매수 또는 매도하는 시스템수식은 어떻게 되는지요?
프로필 이미지
huhboo99
2015-10-29
178
글번호 91884
시스템
답변완료

옵션교차

늘 감사합니다. 1. data2의 종가가 data3의 저가에 도달할 때 매수 익절12틱, 손절6틱, 익절손절이 없는 경우 15시00청산. 2. data2의 종가가 data3의 고가에 도달할 때 매도 익절12틱, 손절6틱, 익절손절이 없는 경우 15시00청산. 감사합니다.
프로필 이미지
상암동
2015-10-29
234
글번호 91882
시스템
답변완료

문의드립니다.

날씨가 많이 쌀쌀해 졌습니다. 감기조심하기바랍니다. 1번) 지표식을 15분봉 기준 매시 13분 28분 43분 58분에 지표가 그려지도록 수정부탁드립니다. 과거봉의 지표는 그려지고 현재봉에만 해당됩니다. 2번)지표식을 당일 최초로 만족하는 첫봉에만 지표가 표시되도록 수정 부탁드립니다. 감사합니다. 1번) var : count(0),Price(0),idx(0); var4 = BollBandup(20,2); var5 = BollBandup(80,2); var6 = BollBandup(240,2); condition1 = c > highest(c,24)[1] ; ##125봉중-최고가 Condition2 = crossup(c,var5); Condition3 = crossup(c,var6); ##주가-240bbup돌파 ### 메인조건 if Condition1 == true and Condition3 == true and var4 > var6*0.8 and dayopen < dayclose(1)*1.15 and var4 > var4[1] and var4[1] <= var6[1] then{ Price = C; count = 0; idx = 0; } ### 지표조건 idx = idx+1; if idx == 2 and C >= Price Then{ count = count+1; plot1(H); } if idx > 2 and crossup(C,Price) Then{ count = count+1; if count == 1 Then plot1(H); } 2번) if date != date[1] Then{ var1 = min(c,o); } if DayClose(1) > DayClose(2)*1.10 and var1 <= dayclose(1) and c > o*1.015 and c > DayClose(1) then{ Plot1(c); }
프로필 이미지
부양가족
2015-10-29
202
글번호 91878
지표
답변완료

수식 수정 부탁드립니다

input : SellPrice1(),SellPrice2(),BuyPrice1(),BuyPrice2(); if CrossDown(c,SellPrice1) Then sell("s1"); if CrossDown(c,SellPrice2) Then sell("s2"); if CrossUp(c,BuyPrice1) Then buy("b1"); if CrossUp(c,BuyPrice2) Then buy("b2"); <개선 희망 사항> (1) SellPrice1()에서 매도 신호 발생후 BuyPrice1()에서 매수 신호 발생하고 상승시 SellPrice1() 에서 다시 매도 신호가 발생합니다 이 경우 SellPrice1()에서는 매도 신호가 발생하지 않고 그보다 높은 SellPrice2()에서만 매도 신호가 발생하게 수식 수정 부탁드립니다 즉 한번 발생한 매도 신호는 다음에 그 가격 터치할 경우 매도 신호를 발생시키지 않는 방식입니다 (2) BuyPrice1()에서 매수 신호 발생후 SellPrice1()에서 매도 신호 발생하고 하락시 BuyPrice1() 에서 다시 매수 신호가 발생합니다 이 경우 BuyPrice1()에서는 매수 신호가 발생하지 않고 그보다 낮은 BuyPrice2()에서만 매수 신호가 발생하게 수식 수정 부탁드립니다 즉 한번 발생한 매수 신호는 다음에 그 가격 터치할 경우 매수 신호를 발생시키지 않는 방식입니다 --------------- 그리고 앞에서 답변해주신 수식을 검색식에서 크루드오일 차트에 적용해보니 오늘자 차트에는 바닥 위로는 숫자와 선이 나타나는데 천정 아래로는 숫자와 선이 출력되지 않습니다 그리고 지나간 어제 차트에는 선이 나타나지 않고 숫자로 -40 만 출력됩니다 확인 부탁드립니다 감사합니다 ---------------- 안녕하세요 예스스탁입니다. 해당 내용 추세선과 텍스트 함수로 구현해야 합니다. 따로 plot명령어로 출력되는 부분이 없으므로 검색식으로 작성해 차트에 적용하시면 됩니다. input : N(40); var : HH(0),LL(0),T(0),HD(0),HT(0),LD(0),LT(0),HL(0),LH(0); var : Tx1(0),tx2(0),tx3(0),tx4(0),tx5(0),tx6(0),tx7(0),tx8(0),tx9(0); var : Tx11(0); var : TL1(0),tl2(0),tl3(0),tl4(0),tl5(0),tl6(0),tl7(0),tl8(0),tl9(0); if bdate != bdate[1] then{ HH = H; HD = sdate; HT = stime; HL = HH; LL = L; LD = sdate; LT = stime; T = 0; LH = H; } if H > HH Then{ T = 1; HH = H; HD = sdate; HT = stime; HL = HH; } if L < LL Then{ T = -1; LL = L; LD = sdate; LT = stime; LH = LL; } if T == 1 and T[1] == 1 Then{ if L < HL Then HL = L; TL_Delete(TL1); TL_Delete(TL2); TL_Delete(TL3); TL_Delete(TL4); TL_Delete(TL5); TL_Delete(TL6); TL_Delete(TL7); TL_Delete(TL8); TL_Delete(TL9); TL1 = TL_New(HT,HT,dayhigh-PriceScale*(N*1),sdate,stime,dayhigh-PriceScale*(N*1)); TL2 = TL_New(HT,HT,dayhigh-PriceScale*(N*2),sdate,stime,dayhigh-PriceScale*(N*2)); TL3 = TL_New(HT,HT,dayhigh-PriceScale*(N*3),sdate,stime,dayhigh-PriceScale*(N*3)); TL4 = TL_New(HT,HT,dayhigh-PriceScale*(N*4),sdate,stime,dayhigh-PriceScale*(N*4)); TL5 = TL_New(HT,HT,dayhigh-PriceScale*(N*5),sdate,stime,dayhigh-PriceScale*(N*5)); TL6 = TL_New(HT,HT,dayhigh-PriceScale*(N*6),sdate,stime,dayhigh-PriceScale*(N*6)); TL7 = TL_New(HT,HT,dayhigh-PriceScale*(N*7),sdate,stime,dayhigh-PriceScale*(N*7)); TL8 = TL_New(HT,HT,dayhigh-PriceScale*(N*8),sdate,stime,dayhigh-PriceScale*(N*8)); TL9 = TL_New(HT,HT,dayhigh-PriceScale*(N*9),sdate,stime,dayhigh-PriceScale*(N*9)); TL_SetColor(TL1,blue); TL_SetColor(TL2,blue); TL_SetColor(TL3,blue); TL_SetColor(TL4,blue); TL_SetColor(TL5,blue); TL_SetColor(TL6,blue); TL_SetColor(TL7,blue); TL_SetColor(TL8,blue); TL_SetColor(TL9,blue); Text_Delete(tx1); Text_Delete(tx2); Text_Delete(tx3); Text_Delete(tx4); Text_Delete(tx5); Text_Delete(tx6); Text_Delete(tx7); Text_Delete(tx8); Text_Delete(tx9); tx1 = Text_New(sdate,stime,dayhigh-PriceScale*(N*1),"-"+NumToStr(N*1,0)); tx2 = Text_New(sdate,stime,dayhigh-PriceScale*(N*2),"-"+NumToStr(N*2,0)); tx3 = Text_New(sdate,stime,dayhigh-PriceScale*(N*3),"-"+NumToStr(N*3,0)); tx4 = Text_New(sdate,stime,dayhigh-PriceScale*(N*4),"-"+NumToStr(N*4,0)); tx5 = Text_New(sdate,stime,dayhigh-PriceScale*(N*5),"-"+NumToStr(N*5,0)); tx6 = Text_New(sdate,stime,dayhigh-PriceScale*(N*6),"-"+NumToStr(N*6,0)); tx7 = Text_New(sdate,stime,dayhigh-PriceScale*(N*7),"-"+NumToStr(N*7,0)); tx8 = Text_New(sdate,stime,dayhigh-PriceScale*(N*8),"-"+NumToStr(N*8,0)); tx9 = Text_New(sdate,stime,dayhigh-PriceScale*(N*9),"-"+NumToStr(N*9,0)); if HL <= dayhigh-PriceScale*(N*1) and HL[1] > dayhigh-PriceScale*(N*1) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*1,0)); if HL <= dayhigh-PriceScale*(N*2) and HL[1] > dayhigh-PriceScale*(N*2) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*2,0)); if HL <= dayhigh-PriceScale*(N*3) and HL[1] > dayhigh-PriceScale*(N*3) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*3,0)); if HL <= dayhigh-PriceScale*(N*4) and HL[1] > dayhigh-PriceScale*(N*4) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*4,0)); if HL <= dayhigh-PriceScale*(N*5) and HL[1] > dayhigh-PriceScale*(N*5) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*5,0)); if HL <= dayhigh-PriceScale*(N*6) and HL[1] > dayhigh-PriceScale*(N*6) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*6,0)); if HL <= dayhigh-PriceScale*(N*7) and HL[1] > dayhigh-PriceScale*(N*7) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*7,0)); if HL <= dayhigh-PriceScale*(N*8) and HL[1] > dayhigh-PriceScale*(N*8) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*8,0)); if HL <= dayhigh-PriceScale*(N*9) and HL[1] > dayhigh-PriceScale*(N*9) Then Tx11 = Text_New(sdate,stime,L,"-"+NumToStr(N*9,0)); Text_SetStyle(tx11,2,2); } if T == -1 and T[1] == -1 Then{ if H > LH Then LH = H; TL_Delete(TL1); TL_Delete(TL2); TL_Delete(TL3); TL_Delete(TL4); TL_Delete(TL5); TL_Delete(TL6); TL_Delete(TL7); TL_Delete(TL8); TL_Delete(TL9); TL1 = TL_New(LD,LT,daylow+PriceScale*(N*1),sdate,stime,daylow+PriceScale*(N*1)); TL2 = TL_New(LD,LT,daylow+PriceScale*(N*2),sdate,stime,daylow+PriceScale*(N*2)); TL3 = TL_New(LD,LT,daylow+PriceScale*(N*3),sdate,stime,daylow+PriceScale*(N*3)); TL4 = TL_New(LD,LT,daylow+PriceScale*(N*4),sdate,stime,daylow+PriceScale*(N*4)); TL5 = TL_New(LD,LT,daylow+PriceScale*(N*5),sdate,stime,daylow+PriceScale*(N*5)); TL6 = TL_New(LD,LT,daylow+PriceScale*(N*6),sdate,stime,daylow+PriceScale*(N*6)); TL7 = TL_New(LD,LT,daylow+PriceScale*(N*7),sdate,stime,daylow+PriceScale*(N*7)); TL8 = TL_New(LD,LT,daylow+PriceScale*(N*8),sdate,stime,daylow+PriceScale*(N*8)); TL9 = TL_New(LD,LT,daylow+PriceScale*(N*9),sdate,stime,daylow+PriceScale*(N*9)); TL_SetColor(TL1,red); TL_SetColor(TL2,red); TL_SetColor(TL3,red); TL_SetColor(TL4,red); TL_SetColor(TL5,red); TL_SetColor(TL6,red); TL_SetColor(TL7,red); TL_SetColor(TL8,red); TL_SetColor(TL9,red); Text_Delete(tx1); Text_Delete(tx2); Text_Delete(tx3); Text_Delete(tx4); Text_Delete(tx5); Text_Delete(tx6); Text_Delete(tx7); Text_Delete(tx8); Text_Delete(tx9); tx1 = Text_New(sdate,stime,daylow+PriceScale*(N*1),"+"+NumToStr(N*1,0)); tx2 = Text_New(sdate,stime,daylow+PriceScale*(N*2),"+"+NumToStr(N*2,0)); tx3 = Text_New(sdate,stime,daylow+PriceScale*(N*3),"+"+NumToStr(N*3,0)); tx4 = Text_New(sdate,stime,daylow+PriceScale*(N*4),"+"+NumToStr(N*4,0)); tx5 = Text_New(sdate,stime,daylow+PriceScale*(N*5),"+"+NumToStr(N*5,0)); tx6 = Text_New(sdate,stime,daylow+PriceScale*(N*6),"+"+NumToStr(N*6,0)); tx7 = Text_New(sdate,stime,daylow+PriceScale*(N*7),"+"+NumToStr(N*7,0)); tx8 = Text_New(sdate,stime,daylow+PriceScale*(N*8),"+"+NumToStr(N*8,0)); tx9 = Text_New(sdate,stime,daylow+PriceScale*(N*9),"+"+NumToStr(N*9,0)); if LH >= daylow+PriceScale*(N*1) and LH[1] < daylow+PriceScale*(N*1) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*1,0)); if LH >= daylow+PriceScale*(N*2) and LH[1] < daylow+PriceScale*(N*2) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*2,0)); if LH >= daylow+PriceScale*(N*3) and LH[1] < daylow+PriceScale*(N*3) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*3,0)); if LH >= daylow+PriceScale*(N*4) and LH[1] < daylow+PriceScale*(N*4) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*4,0)); if LH >= daylow+PriceScale*(N*5) and LH[1] < daylow+PriceScale*(N*5) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*5,0)); if LH >= daylow+PriceScale*(N*6) and LH[1] < daylow+PriceScale*(N*6) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*6,0)); if LH >= daylow+PriceScale*(N*7) and LH[1] < daylow+PriceScale*(N*7) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*7,0)); if LH >= daylow+PriceScale*(N*8) and LH[1] < daylow+PriceScale*(N*8) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0)); if LH >= daylow+PriceScale*(N*9) and LH[1] < daylow+PriceScale*(N*9) Then Tx11 = Text_New(sdate,stime,H,"+"+NumToStr(N*9,0)); Text_SetStyle(tx11,2,2); } 즐거운 하루되세요 > 타이쿤 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다 > (1)당일 저가에서 상승시 40틱 단위로 적색선 그리기 ...선 우측에 +40,+80,+120,+160,+200,+240,+280,+320+360 글 쓰기 ...해당 캔들 위에 +40,+80,+120+160,+200,+240,+280,+320,+360 글 쓰기 (2)당일 고가에서 하락시 40틱 단위로 청색선 그리기 ...선 우측에 -40,-80,-120,-160,-200,-240,-280,-320-360 글 쓰기 ...해당 캔들 아래에 -40,-80,-120-160,-200,-240,-280,-320,360 글 쓰기 감사합니다
프로필 이미지
회원
2015-10-29
293
글번호 91876
시스템