커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1697
글번호 230811
답변완료
문의 드립니다.
국내 선물에서
월봉이 시가 위 양봉이면서 분봉에서 호가잔량오실레이터가
기준선0 아래서 위로 돌파시 매수진입
청산은 호가 잔량오실레이터 기준선0선 아래로 돌파 시 매도 청산 완료
월봉이 시가 아래 음봉이면서 분봉에서 호가 잔량 오실레이터가
기준선0 위에서 아래로 돌파시 매도 진입
청산은 호가 잔량오실레이터 기준선0선 위로 돌파 시 매수 청산 완료
부탁드립니다.
2021-04-27
1190
글번호 148450
답변완료
수정 부탁 드립니다.
더블라인을 만들고 싶은데요
고점이 만들어지면 고점라인 20틱 아래로 고점 라인과 같이 평행선이 만들어 지고
반대로 저점이 만들어지면 저점라인 20틱위에 저점라인과 평행되게
선을 추가해 주세요.
true선도 같이요.
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),
Text1(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
{
T = 1;
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;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
TL_Delete(TL2);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],
sDate[eBar],sTime[eBar],고점[1,1]);
TL2 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],
sDate[eBar],sTime[eBar],저점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],
NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
TL_SetSize(TL2,2);
TL_SetColor(TL2,BLUe); //저점
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
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;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
TL_Delete(TL2);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],
sDate[eBar],sTime[eBar],저점[1,1]);
TL2 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],
sDate[eBar],sTime[eBar],고점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],
NumToStr(저점[1,1],1));
Text_SetStyle(Text1, 2, 10);
TL_SetSize(TL2,2);
TL_SetColor(TL2,BLUe);
}
}
TL_SetSize(TL1,3);
TL_SetColor(TL1,CYAN);
TL_Delete(TL3);
if T == 1 then{
TL3 = TL_New(sDate[index-고점[1,2]],sTime[index-고점[1,2]],고점[1,1],sDate,sTime,고점[1,1]);
TL_SetColor(TL3,BLUe);
TL_SetSize(TL3,2);
TL_SetExtRight(TL3,true);
}
if T == -1 then{
TL3 = TL_New(sDate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1],sDate,sTime,저점[1,1]);
TL_SetColor(TL3,BLUe); //저점
TL_SetSize(TL3,2);
TL_SetExtRight(TL3,true);
}
2021-04-27
1332
글번호 148448
답변완료
궁금합니다!!!
후행스팬이 20일선을 돌파하고 macd 0선 위에 있는 종목 수식을 알고 싶습니다.
부탁드립니다. 감사합니다!!!
2021-04-27
1247
글번호 148447
답변완료
부탁 드립니다.
다바스 박스의 20기간중 상단 3프로 근처에 있는 종목 수식과
20일 상단 돌파 종목 검색식을 어떻게 만들어야 할지 수식좀 부탁드립니다.
2021-04-27
1016
글번호 148446
답변완료
부탁 드립니다.
변환 드립니다.
미리 감사 드립니다.
if(ull>c,floor(ull*rf),ceil(ull*rf))/rf;
2021-04-27
852
글번호 148445
답변완료
수정 부탁 드립니다.
피보나치 되돌림선 전캔들 까지만 표시 되는데
우측 끝까지 추세선 연장 부탁 드립니다.
Input:length(5);
input : Per1(0),Per2(23.6),Per3(38.2),Per4(50.0),Per5(61.8),Per6(76.4),Per7(100);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),처리구분(""),T(0),mav(0),diff(0);
var: TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(0);
var: TL12(0),TL13(0),TL14(0),TL15(0),TL16(0),TL17(0),TL18(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
{
T = 1;
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;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL_Delete(TL8);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL_SetColor(TL1,YELLOW);
#TL_SetSize(TL1,1);
var1 = 고점[2,1];
var2 = 저점[1,1];
var3 = abs(var1-var2);
TL2 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per1/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per1/100));
TL3 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per2/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per2/100));
TL4 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per3/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per3/100));
TL5 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per4/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per4/100));
TL6 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per5/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per5/100));
TL7 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per6/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per6/100));
TL8 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per7/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per7/100));
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);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1]+PriceScale*3,NumToStr((고점[1,1]*10)%1000,0)+" +"+NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 1);
Text_SetColor(Text1,RED);
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
{
T = -1;
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;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL_Delete(TL8);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
#TL_SetSize(TL1,1);
TL_SetColor(TL1,YELLOW);
var1 = 고점[1,1];
var2 = 저점[2,1];
var3 = abs(var1-var2);
TL2 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per1/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per1/100));
TL3 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per2/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per2/100));
TL4 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per3/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per3/100));
TL5 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per4/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per4/100));
TL6 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per5/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per5/100));
TL7 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per6/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per6/100));
TL8 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per7/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per7/100));
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);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1]-PriceScale*3,NumToStr((저점[1,1]*10)%1000,0)+" -"+NumToStr(abs(저점[1,1]-고점[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 0);
Text_SetColor(Text1,BLUE);
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);
if T == 1 Then{
TL_Delete(TL12);
TL_Delete(TL13);
TL_Delete(TL14);
TL_Delete(TL15);
TL_Delete(TL16);
TL_Delete(TL17);
TL_Delete(TL18);
var11 = 고점[1,1];
var12 = 저점[1,1];
var13 = abs(var11-var12);
TL12 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per1/100),sdate,stime,var11-var13*(Per1/100));
TL13 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per2/100),sdate,stime,var11-var13*(Per2/100));
TL14 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per3/100),sdate,stime,var11-var13*(Per3/100));
TL15 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per4/100),sdate,stime,var11-var13*(Per4/100));
TL16 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per5/100),sdate,stime,var11-var13*(Per5/100));
TL17 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per6/100),sdate,stime,var11-var13*(Per6/100));
TL18 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per7/100),sdate,stime,var11-var13*(Per7/100));
TL_SetColor(TL12,red);
TL_SetColor(TL13,red);
TL_SetColor(TL14,red);
TL_SetColor(TL15,red);
TL_SetColor(TL16,red);
TL_SetColor(TL17,red);
TL_SetColor(TL18,red);
}
if T == -1 Then{
TL_Delete(TL12);
TL_Delete(TL13);
TL_Delete(TL14);
TL_Delete(TL15);
TL_Delete(TL16);
TL_Delete(TL17);
TL_Delete(TL18);
var11 = 고점[1,1];
var12 = 저점[1,1];
var13 = abs(var11-var12);
TL12 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per1/100),sdate,stime,var11-var13*(Per1/100));
TL13 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per2/100),sdate,stime,var11-var13*(Per2/100));
TL14 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per3/100),sdate,stime,var11-var13*(Per3/100));
TL15 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per4/100),sdate,stime,var11-var13*(Per4/100));
TL16 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per5/100),sdate,stime,var11-var13*(Per5/100));
TL17 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per6/100),sdate,stime,var11-var13*(Per6/100));
TL18 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per7/100),sdate,stime,var11-var13*(Per7/100));
TL_SetColor(TL12,red);
TL_SetColor(TL13,red);
TL_SetColor(TL14,red);
TL_SetColor(TL15,red);
TL_SetColor(TL16,red);
TL_SetColor(TL17,red);
TL_SetColor(TL18,red);
}
2021-04-27
818
글번호 148431
답변완료
문의 드립니다.
input : P(60),P1(120);
var1 = ma(C,P);
if var1 > var1[1] Then
var2 = 1;
if var1 < var1[1] Then
var2 = -1;
if var2 == 1 Then
plot1(var1,"이평",RED,DEF,4);
Else
plot1(var1,"이평",BLACK,DEF,4);
Var3 = ma(C,P1);
if Var3 > Var3[1] Then
Var4 = 1;
if Var3 < Var3[1] Then
Var4 = -1;
if Var4 == 1 Then
Plot2(Var3,"이평1",RED,DEF,6);
Else
plot2(Var3,"이평1",BLACK,DEF,6);
=====================================================
안녕하세요. 고생 너무 많으십니다.
문의 드리는데요
이 60, 120 이평선 골든 크로스 되면 화살표 나오는 방법을 문의 해봅니다.ㅜㅜ
60, 120이평선 골든 크로스 하면 빨간색 화살표 나오게 하고 싶고
60, 120이평선 데드 크로스 하면 파란색 화살표 나오게 하고 싶습니다.
이방법은 지표 이라는 문서에서 넣고 하는 건가요? 아니면 시스템 문서 인가요?
감사합니다.
2021-04-27
889
글번호 148430
lbh1119 님에 의해서 삭제되었습니다.
2021-04-27
61
글번호 148428
답변완료
수식변경 부탁드립니다.
아래 트레이딩뷰 지표(SuperTrend MTF Headtmap) 수식변경 부탁드립니다.
1. 지표와 전략 두개로 작성 부탁드립니다. 함수로 작성하여 분리해주셔도 감사하겠습니다.
총 4개 주기를 각각 지정가능했으면 좋겠고, 긴 주기 2개가 상승추세일때 아래주기 두개가 하락>상승추세로 바뀔경우 매수, 반대의 경우 매도입니다.
2. 추세색상(형광, 빨강) 이외에 추세전환전 옅게 색칠되는 부분이 잘 보였으면 좋겠습니다.
//@version=4
study("Supertrend MTF Heatmap", shorttitle="Supertrend MTF Heatmap", overlay=false, precision=6)
Factor=input(3,title="[SUPERTREND] Factor", minval=1,maxval = 100, type=input.float)
Pd=input(7, title="[SUPERTREND] PD", minval=1,maxval = 100)
res1 = input("60", type=input.resolution, title="First Timeframe")
res2 = input("120", type=input.resolution, title="Second Timeframe")
res3 = input("240", type=input.resolution, title="Third Timeframe")
res4 = input("D", type=input.resolution, title="Fourth Timeframe")
res5 = input("W", type=input.resolution, title="Fifth Timeframe")
Supertrend(Factor, Pd) =>
Up=hl2-(Factor*atr(Pd))
Dn=hl2+(Factor*atr(Pd))
TrendUp = 0.0
TrendUp := close[1]>TrendUp[1] ? max(Up,TrendUp[1]) : Up
TrendDown = 0.0
TrendDown := close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn
Trend = 0.0
Trend := close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],1)
Tsl = Trend==1? TrendUp: TrendDown
S_Buy = Trend == 1 ? 1 : 0
S_Sell = Trend != 1 ? 1 : 0
[Trend, Tsl]
[Trend,Tsl] = Supertrend(Factor, Pd)
// Security
ST1_Trend_MTF = security(syminfo.tickerid, res1, Trend[1], lookahead=barmerge.lookahead_on)
ST2_Trend_MTF = security(syminfo.tickerid, res2, Trend[1], lookahead=barmerge.lookahead_on)
ST3_Trend_MTF = security(syminfo.tickerid, res3, Trend[1], lookahead=barmerge.lookahead_on)
ST4_Trend_MTF = security(syminfo.tickerid, res4, Trend[1], lookahead=barmerge.lookahead_on)
ST5_Trend_MTF = security(syminfo.tickerid, res5, Trend[1], lookahead=barmerge.lookahead_on)
h0 = hline(1, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)
h1 = hline(2, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)
h2 = hline(3, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)
h3 = hline(4, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)
h4 = hline(5, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)
h5 = hline(6, color=color.new(color.black, 10), linewidth=2, linestyle=hline.style_solid)
get_bars(Trend)=>
since_st_buy = barssince(Trend == 1)
since_st_sell = barssince(Trend == -1)
[since_st_buy, since_st_sell]
[since_st_1_buy, since_st_1_sell] = get_bars(ST1_Trend_MTF)
[since_st_2_buy, since_st_2_sell] = get_bars(ST2_Trend_MTF)
[since_st_3_buy, since_st_3_sell] = get_bars(ST3_Trend_MTF)
[since_st_4_buy, since_st_4_sell] = get_bars(ST4_Trend_MTF)
[since_st_5_buy, since_st_5_sell] = get_bars(ST5_Trend_MTF)
// selec the right heatmsap color
heatmap_color(cond1, cond2) =>
cond1 ? color.new(color.green, 20) : cond2 ? color.new(color.red, 20) : na
lapos_x = timenow + round(change(time)*3)
lapos_y = highest(5)// + (0.15 * highest(20))
// Displays the timeframe labels at the right
f_draw_label(x,y,_text,_textcolor, _size)=>
var label Label = na
label.delete(Label)
Label := label.new(x, y, _text, color=color.new(color.white, 20), textcolor=_textcolor, style=label.style_none, yloc=yloc.price, xloc=xloc.bar_time, size=_size)
// Display the labels in a more readable way
// If timeframe seleced is "Same as symbol" displays the timeframe.period string value
res_to_string(res)=>
str = iff(res == "1", "m1", iff(res == "5", "m5", iff(res == "15", "m15", iff(res == "30", "m30", iff(res == "60", "H1", iff(res == "120", "H2",
iff(res == "240", "H4", iff(res == "480", "H8", iff(res == "D", "Daily", iff(res == "W", "Weekly", iff(res == "360", "H3", timeframe.period)))))))))))
str
// draw the TF labels
f_draw_label(lapos_x, 1, res_to_string(res1), color.black, size.large)
f_draw_label(lapos_x, 2, res_to_string(res2), color.black, size.large)
f_draw_label(lapos_x, 3, res_to_string(res3), color.black, size.large)
f_draw_label(lapos_x, 4, res_to_string(res4), color.black, size.large)
f_draw_label(lapos_x, 5, res_to_string(res5), color.black, size.large)
// Draw the green/red heatmap raws
fill(h0 ,h1, color=heatmap_color(since_st_1_sell>since_st_1_buy, since_st_1_sell<since_st_1_buy))
fill(h1, h2, color=heatmap_color(since_st_2_sell>since_st_2_buy, since_st_2_sell<since_st_2_buy))
fill(h2, h3, color=heatmap_color(since_st_3_sell>since_st_3_buy, since_st_3_sell<since_st_3_buy))
fill(h3, h4, color=heatmap_color(since_st_4_sell>since_st_4_buy, since_st_4_sell<since_st_4_buy))
fill(h4, h5, color=heatmap_color(since_st_5_sell>since_st_5_buy, since_st_5_sell<since_st_5_buy))
2021-04-27
1582
글번호 148427